Configure KVM guest to have .iso mounted as a cdrom

From AcrodusWiki
Revision as of 17:11, 29 November 2024 by Alex (talk | contribs) (Created page with "This was a pain in the arse. So ensure that the xml file for the host includes the following. <pre> <disk type=’file’ device=’cdrom’> <driver name=’qemu’ type=’raw' cache=’none’/> <source file=’/var/lib/libvirt/images/my-cdrom.iso’/> <target dev=’sda’ bus=’sata’/> <readonly/> <address type=’drive’ controller=’0' bus=’0' target=’0' unit=’0'/> </disk> </pre> and then run the command from the host to mount <pre> sudo virsh attac...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This was a pain in the arse.

So ensure that the xml file for the host includes the following.

<disk type=’file’ device=’cdrom’>
<driver name=’qemu’ type=’raw' cache=’none’/>
<source file=’/var/lib/libvirt/images/my-cdrom.iso’/>
<target dev=’sda’ bus=’sata’/>
<readonly/>
<address type=’drive’ controller=’0' bus=’0' target=’0' unit=’0'/>
</disk>

and then run the command from the host to mount

sudo virsh attach-disk vm-wshark0 /var/lib/libvirt/images/debian-12.5.0-amd64-STICK16GB-1.iso sda --type cdrom