Closing GUI Session While Running Virtual Mashine - Virtual Box

53

9

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.

Majid Azimi

Posted 2012-01-06T08:04:12.697

Reputation: 917

Do you want to change to a different terminal? Ctrl-alt-F1 is your friend. – Robert – 2012-01-06T08:07:27.403

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 – 2012-01-06T08:10:58.723

Answers

73

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

Albert H

Posted 2012-01-06T08:04:12.697

Reputation: 876

1Very useful when need to hide/show GUI while VM running. – zhm – 2017-03-13T09:47:52.507

Using version > 5.0. Dont see this option in Windows 10 in the GUI – alpha_989 – 2018-04-17T15:13:04.673

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 – 2018-04-27T16:28:47.327

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 – 2019-11-14T14:26:17.390

8

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

Aaron Sua

Posted 2012-01-06T08:04:12.697

Reputation: 89

4Hmmm...I don't see this option. – Dave Mackey – 2016-04-24T00:00:40.057

4There is no such option – Yar – 2016-05-27T12:53:23.920

11This option appears for me only if I start the VM with a "Detachable Start" – antishok – 2016-06-03T08:36:51.950

@antishok thanks for this. I couldn't find the option and didn't understand it's because of this. – andy – 2017-01-09T09:52:22.360

2

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

Rick Wong

Posted 2012-01-06T08:04:12.697

Reputation: 29

1Could you include a screenshot? – Burgi – 2016-06-02T07:33:30.983