Virsh Attach Iso to a VM

Friday, February 28, 2020

Attach a disk image to a guest’s CD-ROM drive.

Via command line

Add CDROM:

virsh attach-disk guest01 /root/disc1.iso hdc --driver file --type cdrom --mode readonly

Change CDROM:

virsh attach-disk guest01 /root/disc2.iso hdc --driver file --type cdrom --mode readonly

Remove CDROM:

virsh attach-disk guest01 " " hdc --driver file --type cdrom --mode readonly

One can also use change-media, but i have no experince using it.

From the virsh man page:

change-media domain path [--eject] [--insert] [--update] [source] [--force] [[--live] 
[--config] | [--current]] [--print-xml] [--block]

Change media of CDROM or floppy drive. path can be the fully-qualified path or the unique target name () of the disk device. source specifies the path of the media to be inserted or updated. The –block flag allows setting the backing type in case a block device is used as media for the CDROM or floppy drive instead of a file.-

libvirtkvmvirshqemu
as free as beer

Brotli on CentOS Web Panel

OpenSSH legacy options