Is it possible to close the gui of a virtualbox vm and return it to headlessly running without rebooting it with opensuse as host system
I start windows with a database server in a virtual box by the command:
VBoxManage startvm Wind10 --type headless
Then maybe I want to show the gui by
VirtualBox
or by
VBoxSDL --startvm Wind10 --separate
to do some work there. Afterwards I want to close the gui again but the headless windows os to continue running neatlessly (without having all the database clients being crashed by rebooting it). I found a solution for ubuntu (Is it possible to launch GUI of headless VirtualBox' machine?) with a menu entry "Detach GUI", but this entry is missing in my OpenSuse 15.3.
Starting the VM from VirtualBox itself you can choose Detachable Start:
This will bring Detach GUI -option to the VM menu:
This also gives an additional shutdown option that just closes the GUI but leaves the VM running:
To start the VM with detachable GUI on commandline, use command VBoxManage startvm <VMNAME> --type separate
.
This also works when restoring a saved VM.
In my system both Oracle VM VirtualBox Extension Pack for host OS and VirtualBox Guest Additions for guest are installed by default (download links for current version 6.1.26 r145957). However neither of these is required for Detachable options to be available.
Tested and confirmed with VirtualBox 6.1.26 on OpenSUSE Leap 15.3, Debian 10 and MacOS Mojave (host OS:s).