I use VirtualBox when I need to run Windows, and it works beautifully. But today I went to install some Windows software off a CD and discovered that I could no longer connect the CD drive on my laptop to VirtualBox.
Normally you click on "Devices->CD/DVD Drives" and choose your host's CD/DVD drive from the list. (You can also use this to mount iso images as if they were CDs as well, which is a nice feature.) But today, there's no host CD drive listed, only the ISO images that I've previously used.
Now the last time I did this was probably 6 months ago. I don't use Windows very much and I almost never install new software. But I know it was working when last I needed this. So either a change to my system or a change in a VirtualBox upgrade has made the CD drive disappear. Regardless of the cause, I want that drive back.
I did a lot of googling and installed a bunch of packages that weren't already installed like "libhal-dev", but after all that VirtualBox still didn't see my host system's CD drive.
So in the end I decided to use the "big stick" approach. I found in the documentation that before it tries to find CD/DVDs drives on the host system, VirtualBox checks for the presence of the environmental variable "VBOX_CDROM". If that variable is set, then it simply uses the content of it instead of searching for drives on the host. Since I know my CD drive can be accessed at "/dev/cdrom" (which is a symlink to the "real" device = /dev/sr0), I enteredVBOX_CDROM='/dev/cdrom'into the the "/etc/environment" file.
Now, voila, when I start VirtualBox it adds an item for my laptop's CD/DVD drive that I can use to mount the CD/DVD into the virtual Windows OS. It's a hack, but it works. :-)
Navigation
Search
Recent blog posts
- Installing OpenVPN on Ubuntu Natty
- apt-get remove old modules errors
- Cloning Drupal Sub-site
- GnuTLS error with FileZilla and vsftpd
- Installing grub on multiple drives
- Finding the fastest Debian repository
- Changing the console resolution in Grub2
- Lightning calendar plugin for x86_64
- Adding a CAPTCHA to a webform in Drupal
- Our High-Availability Setup

Comments
It works
Really, it works, I have tried many ways to make my CD/DVD drive working as well, and finally, I found this article and it helped me.
Thanks...
How do I find these things?
As a semi computer bozo, could you please explain the following?
1. How do I find the name of my cd rom that I want virtualbox to recognize?
2. Where specifically is the file you mention above that you change to the name of your cd drive?
Thank you!
Re: How do I find these things?
These instructions are for running VirtualBox on Linux. So Linux is the host operating system. They won't work if you are using Mac or Windows as the host.
>> 1. How do I find the name of my cd rom that I want virtualbox to recognize?
You can probably use "/dev/cdrom" and it will work. Most any linux distribution these days creates that entry.
>> 2. Where specifically is the file you mention above that you change to the name of your cd drive?
The file where you need to add the entry is "/etc/environment". Again, if you are not using Linux, then this won't work because the file won't exist. But if you are using Linux, then the file should be there, and you can add the entry to it.