How could we close GUI session in virtual box without shutting down the virtual machine. I have a lot of Linux instances 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 Jan 6 '12 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. – Majid Azimi Jan 6 '12 at 8:10

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

| improve this answer | |
  • 1
    Very useful when need to hide/show GUI while VM running. – zhm Mar 13 '17 at 9:47
  • 1
    Using version > 5.0. Dont see this option in Windows 10 in the GUI – alpha_989 Apr 17 '18 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 '18 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 '19 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 May 7 at 4:48

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

| improve this answer | |
  • 4
    Hmmm...I don't see this option. – Dave Mackey Apr 24 '16 at 0:00
  • 4
    There is no such option – Yar May 27 '16 at 12:53
  • 11
    This option appears for me only if I start the VM with a "Detachable Start" – antishok Jun 3 '16 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 '17 at 9:52

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

| improve this answer | |
  • 1
    Could you include a screenshot? – Burgi Jun 2 '16 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.