62

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.

2
  • Do you want to change to a different terminal? Ctrl-alt-F1 is your friend.
    – Robert
    Jan 6, 2012 at 8:07
  • 1
    No, I want to close the GUI session and the VM doesn't shut down. Like what we do in xen or kvm. Jan 6, 2012 at 8:10

3 Answers 3

83

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.

Screenshot of VirtualBox v5.1.6 Start Option: Detachable Start

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.

Screenshot of VirtualBox v5.1.6 menu: 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.

Screenshot of VirtualBox v5.1.6 toolbar: Show button


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

5
  • 1
    Very useful when need to hide/show GUI while VM running.
    – zhm
    Mar 13, 2017 at 9:47
  • 1
    Using version > 5.0. Dont see this option in Windows 10 in the GUI
    – alpha_989
    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
    Apr 27, 2018 at 16:28
  • 1
    In 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
    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. May 7, 2020 at 4:48
8

As of VBox 5.0 you can close the window and it will prompt you for action including "run in background"

4
  • 4
    Hmmm...I don't see this option. Apr 24, 2016 at 0:00
  • 5
    There is no such option
    – Yar
    May 27, 2016 at 12:53
  • 15
    This option appears for me only if I start the VM with a "Detachable Start"
    – antishok
    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
    Jan 9, 2017 at 9:52
2

in virtual box 5, click the arrow next to the "Start" button, select "Detachable Start" will have "run in background" option.

1
  • 1
    Could you include a screenshot?
    – Burgi
    Jun 2, 2016 at 7:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .