>

It makes no senses that we open a VirtualBox GUI but never work in Guest OS provided in it, becasue it is common that we use a third party SSH client to connect to the Guest OS and do everything in the Interface it provided, so we actually don’t need to VirtualBox GUI interface to displacy the Guest OS locally, we only need the VM to run in background, by another word, headless!.

VirtualBox provides a front-end called VBoxHeadless, it has no GUI and produces no visible output on the host at all, it works completely in background siliently.

There three ways to start a virtual machine with VBoxHeadless

(1) use --type headless option
$ VBoxManage startvm "VM name" --type headless

Note the extra --type option causes VirtualBox to use VBoxHeadless as the front-end to the internal virtualization engine instead of the Qt front-end. Beside, there are actually 4 types of front-end are supported in VirtualBox: --type gui|sdl|headless|separate.

(2) VBoxHeadless is provided as an executable, so we can execute it directly
$ VBoxHeadless --startvm <uuid|name>

This way of starting the VM helps troubleshooting problems reported by VBoxManage startvm ..., because it provides more detailed error messages, especially for early failures before the VM execution is started.

(3) In VirtualBox Manager GUI, hold the Shift key when starting a virtual machine or selecting Headless Start from the Machine menu

We can automate the starting/poweroff of VMs in a script file so that we never need to Open a VirtualBox Manager GUI or type vboxmanage startvm ... command each time we start or poweroff the VMs.

Below are two scripts of Windows command Line that can do the job.

(1) unbuntu17.10_start.cmd

@echo off
"VBoxManage.exe" -nologo startvm "Ubuntu17.10" --type headless 2>NUL

(2) unbuntu17.10_start.cmd

@echo off
VBoxManage.exe controlvm Ubuntu_16.10 poweroff 2>NUL  2>NUL




Reference

https://www.virtualbox.org/manual/ch07.html