Nice simple kvm/qemu config for windows

Updated… this now uses volume groups for the disk storage, virtio for both disk and network. Created by Fedora 13.

There seem to be a real lack of decent xml examples for libvirt/kvm/qemu on the internet for people using it in a bit more of an infrastructury way (where you want to be able to access the consoles remotely using VNC) and to run windows virtual machines.

This example is a dump that doesn’t include a uuid or mac address, they will be automatically generated by libvirt.


sudo virsh define

or similar to install it.

More useful virsh commands:

virsh list --all	show all VMs, running or not
virsh start 		start a VM
virsh shutdown 		shutdown a VM
virsh edit 		edit the config for a VM
virsh dumpxml 		dump the xml config for a VM
virsh define 		create a VM without starting it
virsh undefine 		undefine a VM
<domain type='kvm'>
    <type arch='x86_64' machine='fedora-13'>hvm</type>
    <boot dev='cdrom'/>
    <boot dev='hd'/>
    <topology sockets='1' cores='2' threads='2'/>
  <clock offset='utc'/>
    <disk type='block' device='disk'>
      <source dev='/dev/vg1/'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    <disk type='file' device='cdrom'>
      <target dev='hdc' bus='ide'/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    <interface type='bridge'>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
      <alias name='serial0'/>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
      <alias name='serial0'/>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='no' listen='' keymap='en-gb'/>
      <model type='cirrus' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>


    Leave a comment