To begin, I am not trying to run Docker inside Ubuntu, I want the other way around, run Ubuntu in Docker.
It's technically possible because the official repository is here https://hub.docker.com/_/ubuntu/
It gives methe rootfs and it runs bash after I run docker, fine.
It comes with root account only, I used adduser to create my own account. I need to install sudo, and vim, so that I can edit the /etc/sudoers file, also ok. I installed openssh-server so that I can connect to it via ssh, with my own non-root account.
In order to get a desktop I install the ubuntu-desktop, gnome-panel, gnome-settings-daemon, metacity, nautilus, gnome-terminal, and vnc4server
Here's my xstartup file
~/.vnc$ cat xstartup #!/bin/sh #export XKL_XMODMAP_DISABLE=1 # Uncomment the following two lines for normal desktop: unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc unset DBUS_SESSION_BUS_ADDRESS [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & x-window-manager & gnome-panel & gnome-settings-daemon & metacity & nautilus & gnome-terminal &
It is almost ok, but there are a few issues. 1. The services in /etc/init.d/ don't start, it's obvious because I don't have the sshd running until I manually run /etc/init.d/ssh start. One of the services that breaks my network-manager is dbus, it does not seem to start automatically; and the network-manager itself does not start on startup 2. The nm-applet is not working! This is a deal breaker! 3. Some other issues here and there
So the ultimate question is, is there a fool prove procedure to configure/install the Ubuntu container pulled from the docker hub, to a full fledged desktop?