VBoxHeadless - Running Virtual Machines With VirtualBox 4.1 On A Headless Ubuntu 12.04 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 Ubuntu 12.04

On Ubuntu 12.04 desktops, you can use the Remmina Remote Desktop Client to connect to the VM. Just search for remote desktop and then double-click the Remmina Remote Desktop Client icon:

In the Remmina Remote Desktop Client, click on the plus icon to add a new remote desktop connection:

In the Remote Desktop Preference window, fill in a name for the profile (like Ubuntu 12.04 Server), make sure that RDP is selected as the protocol (it should be selected by default), then fill in the host IP address - not the IP of the VirtualBox guest! - in the Server field, and select a higher Color depth than the default of 8bpp - 16bpp is ok. Then click on Connect:

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.


5 Links

Share this page:

5 Comment(s)

Add comment


From: Steve at: 2012-07-02 17:56:32

Thanks for this. It worked perfectly for me, using Ubuntu 12.04 Server. Previously I had tried this myself (using the "virtual box" Aptitude package that comes with Ubuntu, and got an old version of VirtualBox without VRDE (VNC only, which has mouse pointer offset issues). This gave me the latest VirtualBox with the extension pack and VRDE. Thank-you so much. -- Steve.

From: Ace Suares at: 2012-09-15 12:38:40

 Great guide!

But it leave the VM open to anyone who connects to your public facing IP on the RDP port.

That's why I added this before I start the machine:

VBoxManage modifyvm "$VM_NAME" --vrdeaddress --vrdeport 23771

(any port wil do)

So now the RDP is only on and no one can enter it.
If the host is remote, then the next thing to do is from you development/office/home machine do:


ssh -N -f -L localhost:23771:localhost:23771 user@remotehost
This wil open a port 23771 on YOUR localhost connected to port 23771 on the remote hosts localhost, so to say

After that you can instruct you RDP viewer to connect to and you will have a secure connection with your VM.

By the way, after installing, I do this:

VBoxManage modifyvm "$VM_NAME" --natpf1 "guestssh,tcp,,12222,,22"
VBoxManage modifyvm "$VM_NAME" --boot1 disk

The second line makes the vm boot from disk or else it will always start with the installer !

The first line does portforwarding from the host to the vm's secure shell server (only if you had NAT as network card)

So  after install you can do
ssh -p 12222 user@remotehost
where remotehost is the IP address of the host,

but user is the user on the VM.




From: Anonymous at: 2012-06-29 14:47:46

yea I thing, that this virtualbox articel should be about phpvirtualbox. Author still must using command line instead of remote controled interface.

From: Anonymous at: 2012-06-29 04:16:21

if you'd add a web server daemon and phpVirtualBox, you'd have almost the same interface as if gunning the  VirtualBox GUI

From: at: 2012-09-06 04:10:16

Hello Guys, What would be the pros and cons of running the phpVirtualBox and the Web Server on the same server just curious? Also is there a way to look at your server with a web intervace that would let you see all the vms and performance and such kind of like vmware client? What is the result of trying to use this to serve out VPS type of stuff has anyone considered this? Would the overhead be to much for the server? Last but not least how would I create vms for windows or other oses? Is their a guide for this? Thanks,