Setup of Windows Server 2008 Guest on KVM

From Wiki

Jump to: navigation, search

If you followed the setup of the KVM host at KVM_Setup_on_Debian_Squeeze you will notice that we are using libvirt to manage and control KVM. You should also have a Linux Virtual Machine setup using virt-install. This is required, as we are going to copy its libvirt xml config, edit it and then save it and create our own config for this Windows VM.

I place all ISOs on the KVM host at: /srv/os-images/ In the config below I add in the config to provide a boot menu allowing me to boot from the HD or CDROM at a later date (see: Provide_Boot_Menu_options_for_VMs_accessible_using_VNC )

lvcreate -n win01-vm --size 50g vg0
cd /etc/libvirt/qemu
cp lin01-vm.xml win01-vm.xml
vi win01-vm

When editing the copy of the xml config, we need to remove any UUID, MAC address and/or unique identifiers. The config below uses br1 bridge which is on a range. I am not using virtio for the Windows VM (at this stage).

<domain type='kvm'>
   <type arch='x86_64' machine='pc-0.12'>hvm</type>
   <boot dev='hd'/>
   <boot dev='cdrom'/>
   <bootmenu enable='yes'/>
 <clock offset='utc'/>
   <disk type='block' device='disk'>
     <target dev='hda' bus='ide'/>
     <source dev='/dev/vg0/win01-vm'/>
   <disk type='file' device='cdrom'>
     <target dev='hdc' bus='ide'/>
     <source file='/srv/os-images/en_windows_server_2008_r2_standard.iso'/>
   <interface type='bridge'>
     <source bridge='br1'/>
   <serial type='pty'>
     <target port='0'/>
   <console type='pty'>
     <target type='serial' port='0'/>
   <input type='mouse' bus='ps2'/>
   <graphics type='vnc' port='-1' autoport='yes' keymap='de'/>
     <model type='cirrus' vram='9216' heads='1'/>

Once the config is edited, we need to define it, look at the resulting completed config and then start the VM.

virsh define win01-vm.xml
vi win01-vm.xml
#You will notice extra uuid's and mac address added in.
virsh list --all
virsh start win01-vm

The vm will now start. Connect using VNC. You can right-click on the VNC window titlebar, send a CTRL+ALT+DELETE to reboot and then press F12 to see the boot bios.

Server 2008 Core Install

Note: a server core install of windows server 2008 is a minimal install of ~2-3gb with only a command line interface. You can download the installation guide at: and read more info at:

Personal tools