That's essentially the way I did it.
I did create the disk image manually with qemu-img prior to calling virt-install:
Code:
qemu-img -f qcow2 hda.qcow2 100GB
Here's my virt-install:
Code:
virt-install -n win2003-master \
-r 1000 \
--vcpus=1 \
-f /var/vm/win2003-master/hda.qcow2 \
-w bridge:br0 \
--vnc \
--accelerate \
-c /var/iso/win2003.iso \
--os-type=windows \
--os-variant=win2k3 \
--noapic \
--connect qemu:///system
And the config file I ended up with ("virtio" for the network model is after installing virtio driver in guest):
Code:
<domain type='kvm'>
<name>win2003-master</name>
<uuid>13f177ac-adfd-3cc9-a61d-9f9c10633845</uuid>
<memory>1024000</memory>
<currentMemory>1024000</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='localtime'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<disk type='file' device='disk'>
<source file='/home/data/vm/win2003-master/hda.qcow2'/>
<target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3e:43:8a:08'/>
<source bridge='br0'/>
<model type='virtio'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target port='0'/>
</console>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
</devices>
</domain>
As I mentioned, my libvirt and qemu/kvm are the latest versions compiled from source so maybe something was fixed.
Code:
root@vhost:~# virsh version
Compiled against library: libvir 0.4.6
root@vhost:~# qemu-system-x86_64
QEMU PC emulator version 0.9.1 (kvm-77)
I assume after changing the xml config you did a "virsh define <filename>" or possibly restarting libvirtd would do it too.
I haven't tried a guest with XP, just 2003 server. I'll try one with XP and see if I have any issues.
Bookmarks