Page 1 of 1

Going from headless to GUI mode seamlessly

Posted: 16. Oct 2012, 10:36
by monkry
Hello,

I would like to be able to launch headless machine's machine GUI without interrupting its work.
I launch my machine like so :

Code: Select all

C:\>VBoxManage startvm "ubuntu 12.04" --type headless
And after that I would like to use a command to launch its GUI. How can I do it ?

Re: Going from headless to GUI mode seamlessly

Posted: 16. Oct 2012, 13:06
by Twisted Lucidity
Do you have the extension pack installed? If so, enable "Remote Display" for the guest and defining an appropriate port.
Then connection using you RDP client to "host:port"

If you do not have the extension pack installed and the Guest is bridged, you could use its own desktop-sharing features like Vinagre (you'd need a VNC client) or X forwarding.

Re: Going from headless to GUI mode seamlessly

Posted: 16. Oct 2012, 13:32
by monkry
I have just tried X forwarding for the first time ( and it's awesome :) ) but I would need something like RDP but I can't connect to it via the regular Windows' RDP connection ( can't host URLs now - I will edit it later )
imgur H2sMi.png

How should I do this since I have the ports forwarded in VM options
imgur IBTcP.png

Re: Going from headless to GUI mode seamlessly

Posted: 16. Oct 2012, 14:38
by Twisted Lucidity
Have read the documentation? This included full details on how to run VRDP and running headless.

In short:
Install the extenstion pack.
Enabled "Remote Display" for the guest within VirtualBox ("Display/Remote Display") setting an appropriate port (e.g. "3389")?
Start the guest headless.
Use your RDP client (e.g. "mstc.exe") to connect to the relevant port (e.g. "host-name:3389")

Re: Going from headless to GUI mode seamlessly

Posted: 16. Oct 2012, 15:01
by monkry
I am doing things as you have said but I keep getting this 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
---------------------------
I am using mstsc.exe and connect to localhost:3389. I have my network adapter on guest set to NAT and ports are forwarded (it works for ssh when i connect to localhost:22 it works fine)

Re: Going from headless to GUI mode seamlessly

Posted: 16. Oct 2012, 16:00
by Twisted Lucidity
Are you remoted into the host? Have you tried changing the port?

The networking of the guest is irrelevant, VRDP is supplied by VBox itself.

Re: Going from headless to GUI mode seamlessly

Posted: 16. Oct 2012, 16:10
by monkry
What do you mean by
are you remotedd into the host ?
I can ssh to the box by using

Code: Select all

ssh localhost:22
I have changed the port and now I get something like a timeout :
---------------------------
Remote Desktop Connection
---------------------------
This computer can't connect to the remote computer.

Try connecting again. If the problem continues, contact the owner of the remote computer or your network administrator.
---------------------------
OK Help
---------------------------

Re: Going from headless to GUI mode seamlessly

Posted: 16. Oct 2012, 16:56
by Twisted Lucidity
If you are remoted into the host, then you will already be using port 3389 on the host.
If you set "Remote Display" of the guest to port 3389 and connect to "host-name:3389" then mstc.exe will think you are trying to connect to the same host again. Hence the error.

I accept you can SSH to the guest but that is going through into the guest itself. You are trying to use VRDP which is provided by VBox itself not the guest.

Does the host's firewall permit the port you set it to?

I just ran a quick test with a Lubuntu guest (called "lubuntu").
I went into the VBox GUI and enabled "Remote Display", I left the port at the default of 3390 (my host is Ubuntu, so that's a free port).
I then started my guest with:

Code: Select all

twisted@foo:~$ vboxmanage startvm lubuntu --type headless
Waiting for VM "Lubuntu" to power on...
VM "Lubuntu" has been successfully started.
Then using my RDP client (Remmina in my case) connected to "foo:3390" (note that I am connecting to the host, not the guest and there is no port-forwarding to the guest for port 3389 as it is not required).
Connection was immediate and without issue.

I also tried from a Windows 7 machine using mtsc.exe, connection occurred without issue.

When you are running VRDP VBox essentially hosts an RDP server for you and that is where all the GUI input/output for the gets handled.
This server is attached to a port on the host. So when you connect to "host-name:port", all your input gets sent through to the guest and response sent back.
The guest does not "know" you are using RDP. It just sees key-presses, mouse movements etc.

Re: Going from headless to GUI mode seamlessly

Posted: 17. Oct 2012, 09:33
by monkry
Ok, well I have no idea what am I doing wrong here. I have disabled the firewall on the host. Set up the RDP server to be listening on port 5454 (random) and then I try to connect to localhost:5454 and I get
---------------------------
Remote Desktop Connection
---------------------------
Remote Desktop can’t connect to the remote computer for one of these reasons:

1) Remote access to the server is not enabled
2) The remote computer is turned off
3) The remote computer is not available on the network

Make sure the remote computer is turned on and connected to the network, and that remote access is enabled.
---------------------------
OK Help
---------------------------

Re: Going from headless to GUI mode seamlessly

Posted: 17. Oct 2012, 11:25
by Twisted Lucidity
"Set up the RDP server"?
Are you setting up VRDP in VBox using the GUI/command-line, or are you setting-up an RDP server within the guest?
You should be doing it in VBox, not in the guest.
I'm sorry, it's just not clear to me what you are doing.

I just managed to figure out the URLs you tried to post - why did you port-forward 3389? Ubuntu has no RDP server, it uses Vinagre. You don't need this anyway, do not port-forward for VRDP.

If you start the guest via the command-line and then open the VBox GUI, you should still get a preview for the guest even though it is headless. Do you see this?

When you start a guest that has VRDP endabled and the Windows firewall is running, then you will get a challenge to allow access or not.
When you then try to connect to "localhost:5454" you will get a challenge from "mstc.exe" on whether or not to trust the other computer (the guest in this case).

I think you are over-complicating this. I suggest you remove a lot (all?) your port-forward settings unless you plan to actually use them and go through the docs again.

It'll repeat: VRDP is managed by VBox itself and the guest does not need to know about it.

Re: Going from headless to GUI mode seamlessly

Posted: 17. Oct 2012, 11:36
by monkry
I already know from your posts that its the VBox who is responsible for the RDP handling and :
  • I have removed all port forwarding except SSH - 22
  • I do see the preview in GUI when I launch the virtual machine from command line
  • As I wrote earlier I have disabled the firewall
Yet, when the virtual machine is launched I keep getting this error when trying to connect via RDP to the virtual machine - mstsc.exe to localhost:5454. I know what you mean by challenge, I do get it when I successfully connect to other machines.

Re: Going from headless to GUI mode seamlessly

Posted: 17. Oct 2012, 12:18
by Twisted Lucidity
Then I'm sorry, I don't know what is wrong with your system if VRDP is running OK.

I only get that error if I use the wrong name/port.