Windows – KVM instance creation fails with ‘virtio-net has no peer’

cloudimagekvm-virtualizationwindows

When I create a Windows Server 2008 instance for KVM with this command:

kvm -m 2048 -cdrom win2008.iso -drive file=windowserver.img,if=virtio
-boot d -drive file=.virtio-win-0.1-22.iso,index=3,media=cdrom -device virtio-net-pci -net nic -net user -nographic -vnc :5

The command returns with the following error:

Warning: nic virtio-net-pci.0 has no peer

How do I fix this?

Best Answer

I don't think that you want the -device parameter. If you want to use the virtio NIC, add the model option to the -net parameter like this:

-net nic,model=virtio

Your entire command would look like this then:

kvm -m 2048 -cdrom win2008.iso -drive file=windowserver.img,if=virtio -boot d -drive file=.virtio-win-0.1-22.iso,index=3,media=cdrom -net nic,model=virtio -net user -nographic -vnc :5