I was setting up some Windows virtual machines this evening on my Linux KVM/libvirt server, in order to experiment with how Windows handles IPv6 networks.
Installing windows was easy enough – standard virt-install commands, however post-reboot, Windows XP wants to access the CDROM again.
However the reboot causes the CDROM ISO to be unattached from the virtual CDROM drive – so it’s necessary to re-add it to continue installation
However the logical syntax based on virsh help, doesn’t work:
virsh # attach-disk devel-winxp1 /tmp/winxp.iso hdc error: Failed to attach disk error: this function is not supported by the connection driver: disk bus 'ide' cannot be hotplugged.
The correct syntax is:
virsh # attach-disk devel-winxp1 /tmp/winxp.iso hdc --type cdrom --mode readonly Disk attached successfully
Basically you need to tell libvirt that you’re attaching a *cdrom* and not an actual disk – I’m not sure why it doesn’t just figure that out, based on the fact the user is trying to obviously attach an ISO to a virtual optical drive device – maybe nobody has gotten around to implementing a nice autodetect method yet…