Comments on VBoxHeadless - Running Virtual Machines With VirtualBox 4.1 On A Headless Ubuntu 12.04 Server
VBoxHeadless - Running Virtual Machines With VirtualBox 4.1 On A Headless Ubuntu 12.04 Server This guide explains how you can run virtual machines with VirtualBox 4.1 on a headless Ubuntu 12.04 server. Normally you use the VirtualBox GUI to manage your virtual machines, but a server does not have a desktop environment. Fortunately, VirtualBox comes with a tool called VBoxHeadless that allows you to connect to the virtual machines over a remote desktop connection, so there's no need for the VirtualBox GUI.
2 Comment(s)
Comments
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.
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 127.0.0.1 --vrdeport 23771
(any port wil do)
So now the RDP is only on 127.0.0.1 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 127.0.0.1:23771 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.
Cheers
ace