VBoxHeadless - Running Virtual Machines With VirtualBox 4.1 On A Headless CentOS 6.2 Server - Page 2

4 Connecting To A VM From A Remote Desktop

4.1 Windows XP

You can use the built-in Remote Desktop Connection utility to connect to the VM:

Type in the hostname or IP address of the host (not the guest!):

And voilà, you should be connected to the VM:


4.2 Linux

On Linux desktops, you can use the rdesktop command to connect to the VM. I'm assuming you're using a Fedora desktop here.

On Fedora, you must install rdesktop first. Open a terminal (Applications > System Tools > Terminal)...

... and become root:

$ su 

Then install rdesktop...

# yum install rdesktop

... and leave the root shell:

# exit  

Then type in the following command:

$ rdesktop -a 16

( is the host IP address, not the one of the guest - replace it with your own IP address or hostname; -a 16 means 16 bit colour depth.)

And voilà, you should be connected to the VM:


4.3 If The Remote Desktop Connection Doesn't Work...

If the remote desktop connection doesn't work, you've probably missed the step where I install the VirtualBox extension pack in chapter 2. Please install the extension pack now, stop your virtual machine (see chapter 3.3), and modify your virtual machine to accept remote desktop connections:

$ VBoxManage modifyvm "Ubuntu 12.04 Server" --vrde on

(If the extension pack is already installed when you create your virtual machine, remote desktop connections are automatically enabled.)

Then start your virtual machine again.


Share this page:

3 Comment(s)

Add comment

Please register in our forum first to comment.


By: Anonymous

Hi and thanks for the guide. I have a question on chapter 4. What if you have more than 1 running VMs on the host? so if you type in the host IP which guest will you be connecting to?

By: Jay

I was wondering the same thing, but I figured you could use remote desktop to install the OS, and once running, switch to native remote connectivity to that box as you would any other system.  Not exactly useful in a prod environment, but a pretty cheap and easy test/home space.

By: Anonymous

For all what I know, each running virtual machine simply needs a different remote desktop port number: number

...rather than... (no port number = default port)

In this tutorial, there is only one virtual machine, so its remote desktop uses the default port.

You can specify the remote desktop port number for each virtual machine in its settings in VirtualBox. ("Display ? Remote display" tab in the graphical manager. I haven't tried this in the headless tool yet.)