Windows CDROM's in Xen VM's
This How-to applies to:
All
This How-to is intended for:
Server Administrator
Some brief detail on how to connect up and switch CDROM's within Windows instances when running inside Xen
Purpose
How to persuade a Windows (2000) virtual machine running inside Xen (3.2) that you have physically changed the CD in the drive.
Prerequisities
Xen 3.2 with a Windows 2000 instance running on top with VNC console access.
Step by step
Inside the VNC console you first need to switch into the Xen monitor with;
ctrl-alt-2If necessary you can list the monitor commands available with;
help <return>Now tell the monitor that you're changing the CD
eject hdc <return>Now you need to physically change the CD in the drive;
[Remove CD] [Insert new CD]Now tell Windows it can reconnect to the drive;
change hdc /dev/cdrom
And switch back into Windows;
ctrl-alt-1
Using command line tools
You can also change the connection from the Xen Dom0 using the xm command tool as follows;
xm block-configure <instance> phy:/dev/cdrom hdc:cdrom r
If for some reason your cdrom isn't /dev/cdrom, obviously you will need to change this, but another method for forcing a change is to connect the cdrom to a dummy ISO file, then bacl to /dev/cdrom .. apparently this should also do the trick. Indeed this command can be quite useful after startup, if you have a number of HVM's that all map to the CDROM, sometimes they don't actually attach themselves properly (parallel conflict??). This command can however be used to remedy the problem on a running instance.
Further information
There are / will be a number of Xen related articles, watch this space (or make a request!)

