I had a similar problem which I eventually solved. Maybe it also helps you. Maybe interesting to note is that Ubuntu and its variants do not use the normal runlevels. Whatever you read about working with runlevels, be prepared nothing works.
Note that this only works if your desktop is using the LightDM display manager. I am using Xubuntu, but I think Ubunutus Unity is the same.
1) In order to prevernt the login to appear, the responsible DM (LightDM must be modified:
sudo nano /etc/init/lightdm.conf
start on ((filesystem
and runlevel [!06]
and runlevel [!03]
and started dbus
and plymouth-ready)
or runlevel PREVLEVEL=S)
2) Change grub:
sudo nano /etc/default/grub
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="3"
# comment the next line to disable boot to graphical terminal
GRUB_TERMINAL=console
sudo update-grub
That should do it. I did not care to create a new grub menu entry, because its really quick to start the x window desktop. I guess you are aware that startx does not work in Ubuntu.
sudo service lightdm start
If you need that often I would put an alias
alias startx = sudo service lightdm start
Hope it works for you.