Summer Nights

A blog on embedded and real-time systems as well as on general computing issues

Remote Desktop to a Virtual Machine on VirtualBox running on a Headless Server

I have followed the excellent directions given by Falko Timme at howtoforge. I am copying his directions here with some changes to install a Windows 7 system.

First you need to add the VirtualBox repo to the Ubuntu resources.lst:
emacs /etc/apt/sources.list
Add the following line to it:
deb http://download.virtualbox.org/virtualbox/debian oneiric contrib

Then download and install the VirtualBox public key:
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
Update our package database:
apt-get update
Afterwards, install the VirtualBox 4.1 as follows:
apt-get install linux-headers-$(uname -r) build-essential virtualbox-4.1 dkms

Now install the VirtualBox extensions.

cd /tmp
wget http://download.virtualbox.org/virtualbox/4.1.10/Oracle_VM_VirtualBox_Extension_Pack-4.1.10-76795.vbox-extpack
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.8-75467.vbox-extpack

Now add the user who will run VirtualBox to the vboxusers group:
adduser root vboxusers

Now get a Windows 7 iso and do the following steps to install it to a virtual machine:

VBoxManage createvm --name "Windows 7" --register
VBoxManage modifyvm "Windows 7" --memory 2048 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 eth0
VBoxManage createhd --filename windows7.vdi --size 50000
VBoxManage storagectl "Windows 7" --name "IDE Controller" --add ide
VBoxManage storageattach "Windows 7" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium /mnt/Windows/windows7.vdi
VBoxManage storageattach "Windows 7" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /mnt/Windows/Windows7Ultimate.iso
VBoxHeadless --startvm "Windows 7"

You can now connect using Remote Desktop to this virtual machine.

One Response to “Remote Desktop to a Virtual Machine on VirtualBox running on a Headless Server”

  • Marie says:

    I get to step 2. But this fails. I tried copying the oiinrgal xp.vdi to OLDxp.vdi but the UUID is registered somewhere.ERROR: Cannot register the hard disk /Users/eamon/Desktop/Eamon/virtual box/OLDxp.vdi’ with UUID {447a6705-e94f-44da-8acb-2ab56e3096a9} because a hard disk /Users/eamon/Desktop/Eamon/virtual box/xp.vdi’ with UUID {447a6705-e94f-44da-8acb-2ab56e3096a9} already exists in the media registry ( /Users/eamon/Library/VirtualBox/VirtualBox.xml’)Details: code NS_ERROR_INVALID_ARG (0 80070057), component VirtualBox, interface IVirtualBox, callee nsISupportsContext: OpenHardDisk(Bstr(szFilenameAbs), AccessMode_ReadWrite, false, Bstr( ), false, Bstr( ), srcDisk.asOutParam()) at line 633 of file VBoxManageDisk.cppGD Star Ratingloading…

Leave a Reply

Your email address will not be published. Required fields are marked *