Proxmox VE – use your CD/DVD Burner within your kvm virtual machine

Hello World,

Recently, I had to install a Proxmox VE server in a Lab environment.   Because this was a lab, we had to reuse an “old” HP workstation mounted with a cd/dvd burner device.  This machine was the only one having such device. Moreover, it’s was not possible to mount the device on other machines because of physical constraints (smaller pc with no space to add extra devices,different connectors and so on).  So, at this stage, I had the question about the possibility to use the device within a virtual machine.

I knew that with VMware software there is a way to present physical tape devices into a virtual machine through ISCSI.  I remembered also that reading through the Proxmox VE wiki pages, there was a similar option.  Proxmox VE is able to present through ISCSI protocol tape drivers within virtual machines.

I didn’t need to search long for the answer. Looking in the Proxmox VE wiki pages, I’ve noticed that there was an article describing the process of mounting the CD/DVD Writers into a virtual machine.  That was exactly what I was looking for.  I’ve decided to give it a try and this post basically documents the process.  I was expecting some issues but everything went smoothly.

Note : again, this post is mainly based on the instructions found on the Wiki Proxmox VE page located at http://pve.proxmox.com/wiki/CD/DVD_Writer.

Configuring the Proxmox VE host to detect the CD/DVD Writer

Following the Proxmox ve wiki information about using the cd/dvd burner device within a virtual machine, we had first to download and install the following packages

  • iscsi-scst
  • scstadmin

To perform this installation, you need to connect to the PVE console (locally or through a tool such as putty) and type the following command : apt-get install iscsi-scst scstadmin

the following screenshot shows the command and output you should get

Click to Enlarge 

When the installation is completed, we can start gathering the information about the cd/dvd device. We basically need to gather the “Device ID”.  To get this information, we have type (as explained on the PVE Wiki pages), the following command  dsmeg | grep DVD

In the screenshot, you can see the output of the command.  In my example, the Device ID is set to 1:0:0:0

Click to Enlarge

At this stage, you need to check if a device handler is available or not within your PVE host.  To verify this, you type the following command : cat /proc/scsi_tgt/scsi_tgt

The screenshot shows the output in my case.  On the right column, you can notice that there is no reference to CD/ DVD device.

Click to Enlarge

Apparently,this situation can happen quite often.  But again, the PVE team has provided the correct information to solve this small issue.  You need to load a kernel module in order to see the device handler. You will simply type the following commands : modprobe scst_cdrom

If you check again for the device handler (by typing the command cat /proc/scsi_tgt/scsi_tgt),  you should know see ,in the device handler column, something like dev_cdrom (as shown in the following screenshot

Click to Enlarge

 We are almost finished !  The final steps consists of editing 2 files located under the /etc and add some information.  We will need to edit the

  • /etc/modules file and
  • /etc/scst.conf file

To edit the first file, you simply type in your console the following command nano /etc/modules

At the end of the file, you type the following information scst_cdrom (as shown in the screenshot). Type X to exit the file, you will be prompted to save the file.  Press Y to save your changes

Click to Enlarge

To edit the scst.conf file, you simply type the following command nano /etc/scst.conf. The screenshot below shows you the original file for my environment.

Click to Enlarge

We need to add 2 pieces of information to be able to use the cd/DVD writers within our virtual machine.  We will create a new section called [HANDLER cdrom] where we will insert the device ID that needs to be used by the system and at the end of the [ASSIGNEMENT Default] section we will also insert the information regarding the device ID

The screenshot shows you the changes that have been made compared to the original file

Click to Enlarge

Finally, we simply need to reload the scst configuration to have the change applied.  You will simply type /etc/init.d/scst reload (as shown in the screenshot)

Click to Enlarge

We are done with the configuration changes needed on the Proxmox VE Host.  It’s time to move on the Virtual machine and configure it to have access to the cd/DVD writer device.

Configuring the KVM Virtual machine to use the CD/DVD Writer

To connect to the dvd writer device within the virtual machine, we will use an ISCSI connection.  In my lab, we have deployed Windows 2008 R2. These operating systems comes by default with the iscsi initiator clients. (if you have previous version of the operating system, you will need to download the iscsi client software)

Within your Windows 2008/R2 virtual machine, you can launch the iscsi client from the start menu >Administrative Tools > iSCSI Initiator.  You will be presented with a dialog box similar to this screenshot.

Click to Enlarge

 In the target, type the name or ip of the proxmox ve host where you have performed the changes described in the previous section and press Quick connect.  You will be presented with the quick connect page and you should see (if everything went fine) a iscsi target that represent in fact your cd\dvd writer device.  Press Done 

Click to Enlarge

Again, you can check that the iscsi target device is recognized and that your virtual machine has made a connection to the device. Press OK and you are done !

Click to Enlarge

You can check through Windows explorer that you are effectively connected to the cd\dvd writer device.  In this screenshot, you can see that the system has detected an additional device and the label clearly tells you that the dvd rw device

Click to Enlarge

As a final test, we decided to burn a cd/dvd from the virtual machine to be sure that the configuration would be working as expected.  We simply downloaded a free burning software (here that was infrarecoder but you can choose any software) and yes, we were able to write data into the disc.

Click to Enlarge

Final Notes

After the successful writing process, we’ve tried to check the content of the cd but I was empty from the virtual machine.  We had to eject the cd and put it back to start viewing information.  This is the only side effect we have encountered with this procedure.

In this post, we focused on the cd/dvd writers but in fact, you can use quite the same process to connect a tape drive into your virtual machine. I might not be using quite often this configuration but I have to say it’s great to known that you can use Proxmox VE host devices within your virtual machine by justing making an iSCSI connection.  This is really cool !

Till next time

See ya

 

2 thoughts on “Proxmox VE – use your CD/DVD Burner within your kvm virtual machine

  1. I’m having problems on the first step.

    proxmox:~# aptitude install iscsi-scst scstadmin
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Reading extended state information
    Initializing package states… Done
    Reading task descriptions… Done
    The following NEW packages will be installed:
    iscsi-scst scstadmin
    0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0B/91.1kB of archives. After unpacking 381kB will be used.
    Writing extended state information… Done
    Selecting previously deselected package iscsi-scst.
    (Reading database … 27819 files and directories currently installed.)
    Unpacking iscsi-scst (from …/iscsi-scst_1.0.1.1-4_amd64.deb) …
    Selecting previously deselected package scstadmin.
    Unpacking scstadmin (from …/scstadmin_1.0.6-1_all.deb) …
    Processing triggers for man-db …
    Setting up iscsi-scst (1.0.1.1-4) …
    Starting iSCSI-SCST target service: FATAL: Error inserting crc32c_intel (/lib/modules/2.6.32-7-pve/kernel/arch/x86/crypto/crc32c-intel.ko): No such device
    FATAL: Module iscsi_scst not found.
    netlink open failed: Connection refused
    failed.
    Setting up scstadmin (1.0.6-1) …
    Loading and configuring the mid-level SCSI target SCSTFATAL: Module scst not found.
    failed!
    invoke-rc.d: initscript scst, action “start” failed.
    dpkg: error processing scstadmin (–configure):
    subprocess post-installation script returned error exit status 5
    Errors were encountered while processing:
    scstadmin
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install. Trying to recover:
    Setting up scstadmin (1.0.6-1) …
    Loading and configuring the mid-level SCSI target SCSTFATAL: Module scst not found.
    failed!
    invoke-rc.d: initscript scst, action “start” failed.
    dpkg: error processing scstadmin (–configure):
    subprocess post-installation script returned error exit status 5
    Errors were encountered while processing:
    scstadmin
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Reading extended state information
    Initializing package states… Done
    Writing extended state information… Done
    Reading task descriptions… Done

  2. hello there,

    It’s seems that you have a Proxmox VE using the pve kernel version 2.6.35. This version has known problems with SCST module. Plus it’s unclear if Proxmox VE tea will continue to support this
    This setup might not be working anymore…..

    I’ll have to check the PVE forum and do a test to see if there is a way to present iscsi devices within vm in proxmox ve

    Might take some time… not much time left for blogging.

    Hope this help

    see ya

Leave a Reply