How could we close GUI session in Virtual Box without shutting down the virtual machine? I have a lot of Linux instances and I only need to connect to one of them.
- Do you want to change to a different terminal? Ctrl-alt-F1 is your friend.Robert– Robert2012-01-06 08:07:27 +00:00Commented Jan 6, 2012 at 8:07
- 1No, I want to close the GUI session and the VM doesn't shut down. Like what we do in xen or kvm.Majid Azimi– Majid Azimi2012-01-06 08:10:58 +00:00Commented Jan 6, 2012 at 8:10
3 Answers
Edit: VirtualBox keeps getting better and better! Since VirtualBox 5.0, there is now an extra dropdown menu next to the Start button with an even better option: Detachable Start! It is a hybrid start option where they run the VM process in the background, and simply display a headless VM client that you can easily close.
Well, almost easily... closing the window that appears will result in the same dialog box asking you if you want to save state, send the shutdown signal, or just power it completely off... no option to just close the window. That said, there is an option in the menu above to close the window only: Machine > Detach GUI.
Since this option is somewhat experimental (like no 3D acceleration), they may not have fully fleshed out the feature yet. We might see a keybinding + option in the close dialog once they are done!
If you still prefer the shortcut, holding SHIFT down and clicking Start will continue to work to run the VM in headless mode. Since they have developed a headless VM client, you will also be able to click Show to see the VM.
This has already been answered already, but...
With Virtualbox 4.2 and later, there is a quiet little option to start the VM in headless mode. Simply select your VM, then while holding SHIFT down, click Start. This will run the VM in headless mode. Note that there is still no way to "detach" from the VM in GUI mode, but you can suspend the VM with Save State and restart in headless mode.
Better yet, only run in headless mode and use RDP/VNC to manage. phpVirtualBox is a decent web interface to remotely manage VirtualBox instances.
Source: https://blogs.oracle.com/fatbloke/entry/creating_and_using_vm_groups
- 1Very useful when need to hide/show GUI while VM running.zhm– zhm2017-03-13 09:47:52 +00:00Commented Mar 13, 2017 at 9:47
- 1Using version > 5.0. Dont see this option in Windows 10 in the GUIalpha_989– alpha_9892018-04-17 15:13:04 +00:00Commented Apr 17, 2018 at 15:13
- it appears that since upgrading to 5.2.10 (I was running 5) the option to detach the GUI has been removed. You can still start headless, but you can no longer fade to the background... or not with any research I have found so far. edit: it seems to be only available if it's STARTED detachable or headless that the option is available.Madivad– Madivad2018-04-27 16:28:47 +00:00Commented Apr 27, 2018 at 16:28
- 1In VirtualBox 6 there is no option to detach if you didn't start VM as detachable. Close VM and select "Save state". Then start as detachable and detach (or start as headless if you don't need UI at all).izogfif– izogfif2019-11-14 14:26:17 +00:00Commented Nov 14, 2019 at 14:26
- To be clear, the option to "Detach GUI" exists in the menu in the Virtual Machine window, not in the VirtualBox Manager window.Abhirup Das– Abhirup Das2020-05-07 04:48:32 +00:00Commented May 7, 2020 at 4:48
As of VBox 5.0 you can close the window and it will prompt you for action including "run in background"
- 4Hmmm...I don't see this option.Dave Mackey– Dave Mackey2016-04-24 00:00:40 +00:00Commented Apr 24, 2016 at 0:00
- 5
- 15This option appears for me only if I start the VM with a "Detachable Start"antishok– antishok2016-06-03 08:36:51 +00:00Commented Jun 3, 2016 at 8:36
- @antishok thanks for this. I couldn't find the option and didn't understand it's because of this.andy– andy2017-01-09 09:52:22 +00:00Commented Jan 9, 2017 at 9:52
in virtual box 5, click the arrow next to the "Start" button, select "Detachable Start" will have "run in background" option.
- 1Could you include a screenshot?Burgi– Burgi2016-06-02 07:33:30 +00:00Commented Jun 2, 2016 at 7:33


