Tuesday, 23 April 2013

CD ROM related VM goodness

Need to change the settings for a CD ROM drive on a virtual machine? Here is an example for a physical device and for an .iso image. This needs to be put in the vm config xml file which should be accessed by entering the following command;
virsh edit <vmname>

Firstly for a block device;
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<source dev='/dev/sr0'/>
<target dev='hdc' bus='ide'/>
<address type='drive' controller='0' bus='1' unit='0'/>
<readonly/>
</disk>

And for a disk image try this;
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/srv/vmhost-01/ubuntu-12.04.2-server-amd64.iso'/>
<address type='drive' controller='0' bus='1' unit='0'/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>

I'm guessing the address line may need adjusting but it should be about right.

1 comment:

  1. Once, I can't open the file iso. and I can't nothing to, do with it. Until then, I found the article about how to open .iso file https://wikiext.com/iso. After all instructions, it was started to work. Thankfully to that website, it was easy than ever.

    ReplyDelete