Ubuntu has a great "FEATURE" (ok, it actually sucks) that disables/stops booting your system (and/or) graphical system if there is no monitor. The devs weren't smart enough to allow the system to remember the last monitor attached and/or switch to a different display automatically if you start headless and then attach a different different monitor than before.
This post will help you out (best I can do):
How to remove the graphical user interface?
Look for the answer with lots of updvotes.
You can also do this if that answer doesn't work all the way:
Create an override file for you display manager in /etc/init/ and place the word 'manual' in it. So if you have 'lightdm' you would create a 'lightdm.override' with the single word 'manual' in it, and put it in the '/etc/init/' directory. You will need to use 'sudo' to create and edit the file. Same with the grub file in the link I provided.
You can start the xserver/GUI manually:
sudo service lightdm start
and to stop it:
sudo service lightdm stop