Mounting CDROM ISO To a Running KVM Guest

When you created your virtual machine with KVM maybe you specified a CDROM image file but need to attach a different image during install to load drivers? This is almost guaranteed if you are setting up a Windows virtual machine with virtio devices. You must first ensure that your ISO image is within /var/lib/libvirt/images (it may vary on your distro) however this path is correct for my install of CentOS 7.

To attach a CDROM ISO image use the following, in my case I am attaching the virtio drivers iso. The command is formatted as follows attach-disk <virtual machine name> <image file> <device> <type> <mode>

virsh attach-disk vm102 /var/lib/libvirt/images/virtio-win.iso hda –type cdrom –mode readonly

If you are in the same position as me and need the virtio drivers you will find after attaching the Virtio iso image you can not continue the Windows install. Once the drivers are installed you must attach the Windows ISO image again.

virsh attach-disk vm102 /var/lib/libvirt/images/en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso hda –type cdrom –mode readonly

Leave a Reply

Your email address will not be published. Required fields are marked *