Bring up the GUI for a Vagrant managed Virtual box while the box is running

vagrantvirtualbox

I know that I can configure my Vagrantfile to boot my machine with a GUI according to http://docs.vagrantup.com/v2/virtualbox/configuration.html with:

config.vm.provider "virtualbox" do |v|
  v.gui = true
end

But if I've started a box headless, is there any way to bring up a GUI while the machine is running? Virtualbox provides the small preview, so I suspect it is possible but I haven't found any documentation on how to do this.

Edit: Terry pointed out that I can vagrant reload after changing the setting above to get a gui, but that reboots the box. I'm still hoping there's a easy way to enable the gui without a reboot.

Best Answer

There are 3 ways I've found to get a gui on a running headless machine if you can see it in the VirtualBox Manager:

  • You can suspend the machine (Close|Save State or vagrant suspend) and then start it again. When you restart it, you will see the GUI.

or, if you don't want to stop the machine at all:

  • You can go to display settings and enable the Remote Display Server while it's running (you may want to change the default port), and then use an RDP viewer (On Windows use Remote Desktop Connection) to access the GUI.

  • [Edit July 2015] With VirtualBox 5.0, click on the headless VM, choose "Show", and it will bring up the gui.