Difference between revisions of "CD Rom Support in Xen"

From Xen
(Updated xml to xl)
Line 21: Line 21:
 
To add a physical CDROM drive or iso file as CDROM, you need to append ":cdrom" suffix to the target device name. Eg.
 
To add a physical CDROM drive or iso file as CDROM, you need to append ":cdrom" suffix to the target device name. Eg.
 
<pre><nowiki>
 
<pre><nowiki>
  +
disk = ['phy:/dev/sr0,hdc:cdrom,r']
 
disk = ['phy:/dev/hdc,hdc:cdrom,r']
 
disk = ['phy:/dev/hdc,hdc:cdrom,r']
 
disk = ['file:/test.iso,hdc:cdrom,r']
 
disk = ['file:/test.iso,hdc:cdrom,r']

Revision as of 23:28, 5 December 2014


CDROM Support under Xen Guests


This page will give some information about CDROM support under Xen guests.

PV Guest

Currently, there's no paravirtual CDROM driver available. So in PV guest, you can only add a iso image as a disk and cannot change this disk at runtime. But as a workaround, you can detach it and re-attach another iso as the same frontend.

HVM Guest

Adding CDROM to Guest

To add a physical CDROM drive or iso file as CDROM, you need to append ":cdrom" suffix to the target device name. Eg.

disk = ['phy:/dev/sr0,hdc:cdrom,r']
disk = ['phy:/dev/hdc,hdc:cdrom,r']
disk = ['file:/test.iso,hdc:cdrom,r']
disk = ['phy:/dev/null,hdc:cdrom,r']
disk = [',hdc:cdrom,r']


Change CDROM for a running guest

If you attached a physical CDROM drive, the CDROM media in the guest will change automatically when you change it physically.

If it doesn't change, execute the following command in Dom0:

# xl block-configure [DomID] phy:/dev/hdc hdc:cdrom r
or: 
# xl block-configure [DomID] file:/test.iso hdc:cdrom r
if you want to bind an iso to a CDROM.

If you are using the SDL viewer, Inside the VM press the following key combination to get into the monitor:

Ctrl-Alt-2

And then use the following command to eject the CDROM:

eject hdc [return]

Now you should be able to eject the cd manually, and put in a different CD. Then type the following command to change CDROM for the guest:

change hdb /dev/hdc [return]

To get back to the VM gui, press:

Ctrl-Alt-1

The new disk should be ready for mounting.

Booting from CDROM

To boot from CDROM, add config parameter "boot=c" to the vm configure file.

Troubleshooting

  • Under certain circumstance, using /dev/cdrom, which is a symbol link to the actual device, doesn't work.