Is it possible to launch GUI of headless VirtualBox' machine?

After I launch a virtual machine (Ubuntu 12.04) in headless mode on Windows 7 host

C:\Users\XXX>VBoxManage startvm "ubuntu 12.04" --type headless 
Waiting for VM "ubuntu 12.04" to power on... 
VM "ubuntu 12.04" has been successfully started.

Can I somehow launch the normal GUI that I would get by launching the virtual machine from VirtualBox' GUI ?

I know that I should be able to RDP to this machine but when I use Windows 7 built in RDP client and use localhost:rdp_port (forwarded by NAT in VB options) I get the error

    ---------------------------
    Remote Desktop Connection
    ---------------------------
    Your computer could not connect to another console session on the remote 
    computer because you already have a console session in progress.
    ---------------------------
    OK   Help   
    ---------------------------

What can I do in this situation to connect to this virtual machine with GUI ?

Is it the only solution for me to turn the machine off and then launch it with the GUI ? It sounds really not convenient to do this every time I need GUI - since I want the machine to be headless.

EDIT

I have also tried xrdp but I cannot connect to the machine - I have it behind the VirtualBox NAT and the ports are forwarded.


I just solved this problem by clicking the green arrow "Show" at the top of the VirtualBox GUI while my headless instance was already running.

I could see what the VM window would look like inside the "Preview" Pane on the VirtualBox GUI, and after clicking "Show", the VM window came up as though I had initially powered on the machine from the Virtualbox GUI.

Edit: When you close the VM window, it will give you the additional option to "Continue running in the background", so your headless instance can revert to being headless again. VirtualBox GUI with Show button highlighted


You can attach to a headless VM by running VBoxSDL --startvm <VMname> --separate. If you run VBoxSDL with no args you can see other options you may be interested in.


  1. You can click on the Show button to get the GUI of a headless VM in the VirtualBox Manager:

  2. When you are done with using the GUI, you can detach it and your VM will go back headless.

I tested this on Windows 10 and it worked as of VirtualBox 5.1.22. Should be the same on Mac/Linux.


After getting the same error, I just changed the default port 3389 to something else.

I used random port number (in my case 5500). Then it worked.

And disabled Windows firewall for a moment - but I don't think firewall was the problem.