The following instructions describe how to create a virtual machine on a headless server over a network connection. This example creates a virtual machine, establishes an RDP connection and installs a guest operating system. All of these tasks are done without having to touch the headless server. You need the following prerequisites:
An ISO file accessible from the server, containing the installation data for the guest operating system to install. Windows XP is used in the example.
A terminal connection to that host through which you can
access a command line, such as
An RDP viewer on the remote client. See
Note that on the server machine, since we will only use the headless server, Qt and the X Window system are not required.
On the headless server, create a new virtual machine. For example:
VBoxManage createvm --name "Windows XP" --ostype WindowsXP --register
If you do not specify
You do not need to specify
VBoxManage list ostypes
Ensure the settings for the VM are appropriate for the guest operating system that we will install. For example:
VBoxManage modifyvm "Windows XP" --memory 256 --acpi on --boot1 dvd --nic1 nat
Create a virtual hard disk for the VM. For example, to create a 10 GB virtual hard disk:
VBoxManage createhd --filename "WinXP.vdi" --size 10000
Add an IDE Controller to the new VM. For example:
VBoxManage storagectl "Windows XP" --name "IDE Controller" --add ide --controller PIIX4
Set the VDI file you created as the first virtual hard disk of the new VM. For example:
VBoxManage storageattach "Windows XP" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium "WinXP.vdi"
Attach the ISO file that contains the operating system installation that you want to install later to the virtual machine. This is done so that the VM can boot from it.
VBoxManage storageattach "Windows XP" --storagectl "IDE Controller" --port 0 --device 1 --type dvddrive --medium /full/path/to/iso.iso
Enable the VirtualBox Remote Desktop Extension, the VRDP server, as follows:
VBoxManage modifyvm "Windows XP" --vrde on
Start the virtual machine using the
VBoxHeadless --startvm "Windows XP"
If the configuration steps worked, you should see a copyright notice. If you are returned to the command line, then something did not work correctly.
On the client machine, start the RDP viewer and connect to
the server. See
The installation routine of your guest operating system should be displayed in the RDP viewer.