3

Is it possible to make a running VirtualBox VM headless after it has been started in gui mode on Mac OS X?

On windows I managed to do this using VBoxHeadlessTray. This tool offers the ability to disable gui mode even after the VM has been started using the original VirtualBox VM list.

Can this be accomplished by command line as well? Of course the other way around (headless -> gui) would be nice to have as well.

2 Answers 2

2

VBoxHeadless may be what you're after.

Regardless of if you create a new VM or import an old one, you can start it with the command:

VBoxHeadless --startvm "Ubuntu 16.04 Server"

(Replace Ubuntu 16.04 Server with the name of your VM.)

VBoxHeadless will start the VM and a VRDP (VirtualBox Remote Desktop Protocol) server which allows you to see the VM's output remotely on another machine.

To stop a VM, run

VBoxManage controlvm "Ubuntu 16.04 Server" poweroff

To pause a VM, run

VBoxManage controlvm "Ubuntu 16.04 Server" pause

To reset a VM, run

VBoxManage controlvm "Ubuntu 16.04 Server" reset

I've been researching this tonight for another reason, making it a little more flexible to my needs isn't working, but it may be just what you need.

also:

$ VBoxHeadless --help
Oracle VM VirtualBox Headless Interface 5.2.10
(C) 2008-2018 Oracle Corporation
All rights reserved.

Usage:
   -s, -startvm, --startvm <name|uuid>   Start given VM (required argument)
   -v, -vrde, --vrde on|off|config       Enable or disable the VRDE server
                                           or don't change the setting (default)
   -e, -vrdeproperty, --vrdeproperty <name=[value]> Set a VRDE property:
                                     "TCP/Ports" - comma-separated list of
                                       ports the VRDE server can bind to; dash
                                       between two port numbers specifies range
                                     "TCP/Address" - interface IP the VRDE
                                       server will bind to
   --settingspw <pw>                 Specify the settings password
   --settingspwfile <file>           Specify a file containing the
                                       settings password
   -start-paused, --start-paused     Start the VM in paused state
   -c, -capture, --capture           Record the VM screen output to a file
   -w, --width                       Frame width when recording
   -h, --height                      Frame height when recording
   -r, --bitrate                     Recording bit rate when recording
   -f, --filename                    File name when recording. The codec used
                                       will be chosen based on file extension

note: right before posting I saw this is a few years old. Sorry for dragging up something from the archives, but I do feel it's useful to post.

0

Yes, you can run a VM headless using VirtualBox, if you use something like Vagrant too;

http://www.vagrantup.com/

It's intended for devs and as an added bonus uses a shared filesystem so you can easily host a LAMP or LEMP stack on a Vagrant VM (any distro you like) and then use your favorite editor in OSX to change files on your VM.

Have a read through, I think it's what you're looking for.

You must log in to answer this question.