Difference between revisions of "CD Rom Support in Xen"

From Xen
(Migrated page)
 
(block-configure isn't an xl command. switch to block-attach)
 
(3 intermediate revisions by 2 users not shown)
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']
Line 32: Line 33:
 
If you attached a physical CDROM drive, the CDROM media in the guest will change automatically when you change it physically.
 
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:
+
If it doesn't change, you can try a few things:
  +
  +
=== Reinsert cdrom from guest ===
  +
  +
Typically if the CDROM drive is not automatically detected by the guest it is due to the fact that eject / insert of the device is not propagated to the guest, this can be fixed, but to avoid dealing with that you can also just try to use the following commands from the guest:
  +
  +
To eject from the guest:
  +
<pre><nowiki>
  +
# eject
  +
</nowiki></pre>
  +
  +
To detect the insertion of a new CD:
  +
<pre><nowiki>
  +
# eject -t
  +
</nowiki></pre>
  +
  +
Playing with these two should in most cases resolve messaging issues.
  +
  +
=== Reinsert cdrom to guest from dom0 ===
  +
  +
Execute the following command in Dom0:
 
<pre><nowiki>
 
<pre><nowiki>
# xm block-configure [DomID] phy:/dev/hdc hdc:cdrom r
+
# xl block-attach [DomID] "phy:/dev/hdc,hdc:cdrom,r"
 
</nowiki></pre>
 
</nowiki></pre>
 
or:
 
or:
 
<pre><nowiki>
 
<pre><nowiki>
# xm block-configure [DomID] file:/test.iso hdc:cdrom r
+
# xl block-attach [DomID] "file:/test.iso,hdc:cdrom,r"
 
</nowiki></pre>
 
</nowiki></pre>
 
if you want to bind an iso to a CDROM.
 
if you want to bind an iso to a CDROM.
Line 74: Line 95:
 
= Troubleshooting =
 
= Troubleshooting =
   
* The configure option "cdrom" is obsolete as of Xen 3.0.3.
 
 
* Under certain circumstance, using /dev/cdrom, which is a symbol link to the actual device, doesn't work.
 
* Under certain circumstance, using /dev/cdrom, which is a symbol link to the actual device, doesn't work.
   

Latest revision as of 14:47, 12 December 2016


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, you can try a few things:

Reinsert cdrom from guest

Typically if the CDROM drive is not automatically detected by the guest it is due to the fact that eject / insert of the device is not propagated to the guest, this can be fixed, but to avoid dealing with that you can also just try to use the following commands from the guest:

To eject from the guest:

# eject

To detect the insertion of a new CD:

# eject -t

Playing with these two should in most cases resolve messaging issues.

Reinsert cdrom to guest from dom0

Execute the following command in Dom0:

# xl block-attach [DomID] "phy:/dev/hdc,hdc:cdrom,r"
or: 
# xl block-attach [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.