Can I open a GUI for a virtual window managed by Vagrant while the box is running?

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

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

But if I run a headless box, is there a way to invoke a graphical interface while the machine is running? Virtualbox provides a small preview, so I suspect it is possible, but I have not found any documentation on how to do this.

Edit: Terry indicated that I can vagrant reload after changing the settings above to get gui, but this will reload the window. I still hope there is an easy way to enable gui without rebooting.

+56
vagrant virtualbox
Nov 26 '13 at 20:19
source share
4 answers

I found 3 ways to get a GUI on a running headless machine if you can see this in VirtualBox Manager:

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

or, if you do not want to stop the machine at all:

  • You can go to the display settings and enable the remote display server while it is running (you may need to change the default port), and then use the RDP viewer (Windows uses Remote Desktop Connection) to access the graphical interface.

  • [Change July 2015] In VirtualBox 5.0, click the headless virtual machine, select "Show", and a window with a graphical interface will appear.

+37
Apr 25 '14 at 15:48
source share

You will need to do a vagrant reload after turning on gui.

But there is a trick (a little risky, in my opinion) 1. save the state of the VM VBoxManage controlvm NAME_OR_UUID savestate 2. star vbox gui and resume

BTW: BTW: why do you need a GUI for managed virtual machines managed by Vagrant? If you prefer a GUI for managing headless virtual machines, try phpVirtualBox .

+7
Nov 27 '13 at 4:18
source share

From my experience working with a stroller, when you start completely without a hat, there is no way to load a graphical interface, you need to load it from the beginning with the above line.

+1
Nov 26 '13 at 21:24
source share

If it runs on VirtualBox (which a tramp usually uses):

foreword: you cannot (briefly) interrupt a virtual machine! Therefore, you cannot just open it to start an instance in VirtualBox.

You may find http://www.toptensoftware.com/VBoxHeadlessTray/ useful, it has small errors if you ask me, but it's nice that you need to save what you can do ..

... On the console: you can just do what @ terry-wang wrote:

  • suspend VBoxManage controlvm <NAME_OR_UUID> savestate
  • reboot with the gui option VBoxManage startvm <NAME_OR_UUID> --type gui
    alternative: run gui manager yourself since terry wrote
    return / do headless from gui: VBoxManage startvm <NAME_OR_UUID> --type headless

Update on VirtualBox 5: the VirtualBox GUI has a function to run in the background, which is currently turned on, so the tool is still a shortcut, but not yet needed so as not to force the console to be used

+1
Jun 18 '15 at 12:44
source share



All Articles