Create Virtual CD And DVD Drives Using CDEmu On Linux

CDEmu is a software suite used to emulate optical CD-ROM and DVD-ROM drives on Unix-like systems.Using CDEmu, we can easily mount various disk image formats, such as BIN, CUE, ISO, IMG, MDF and NRG etc., in Linux without having to write them in physical media.This can be helpful for playing certain types of Games which runs only from the optical drive.In this brief tutorial, we are going to see how to install CDEmu and create virtual CD ad DVD drives using CDEmu on Linux from command line as well as graphical mode.

CDEmu consists of the following components:

  • VHBA (Virtual HBA) – A kernel module implementing a virtual drive-controller.
  • libMirage – A software library for interpreting optical disc images.
  • CDEmu daemon – A userspace daemon that receives SCSI commands from kernel module and processes them, passing the requested data back to the kernel.
  • CDEmu client – A command-line client for controlling CDEmu daemon.
  • gCDEmu – A graphical interface for CDEmu client.
  • Image Analyzer – A Gtk + application that displays tree structure of disc image created by libMirage.

Install CDEmu on Linux

CDEmu is packaged for many popular Linux platforms.

On Arch Linux and its variants, make sure you have enabled [Community] repository and install CDEmu client using command:

$ sudo pacman -S cdemu-client

On Debian:

$ sudo apt install cdemu-client

On Ubuntu, it can be installed using PPA like below.

$ sudo add-apt-repository ppa:cdemu/ppa
$ sudo apt install cdemu-client

On openSUSE:

$ sudo zypper install cdemu-client

Create Virtual CD And DVD Drives Using CDemu On Linux

Here are a few basic examples to mount, unmount and list images using cdemu command.

Load images in virtual devices

To load an ISO image in the first virtual drive, run:

$ cdemu load 0 alpine-standard-3.10.3-x86_64.iso

Now Open your File manager to verify if the image is loaded.

As you see in the above screenshot, I have mounted Alpine ISO image using CDEmu client.

To load multiple images in the first drive, simply mention its path with space-separated like below.

$ cdemu load 0 alpine-standard-3.10.3-x86_64.iso ubuntu-18.04.2-live-server-amd64.iso

View images in virtual devices

To view the list of loaded images, run:

$ cdemu status

Sample output:

Devices' status:
0 True /home/sk/alpine-standard-3.10.3-x86_64.iso

Check cdemu status

As you see, I have loaded alpine ISO image in the first drive.

Unload images from virtual devices

To unload the first drive i.e unmount the loaded images from the first drive, run:

$ cdemu unload 0

This command will unload all images from the first device.You can verify if the images are unloaded using “Cdemu status” command.

Create new virtual device

By default, CDEmu has one virtual drive.You can of course create more drives if you like.

To add a new device, for example device 1, the command would be:

$ cdemu add-device

You will see an output like below.

Device added successfully.

To verify if the new device is created, run:

$ cdemu status
Devices' status:
0 False 
1 False

As you see, I have two virtual devices, 0 and 1.

You can create as many devices as you want.

To load the ISO images to the second drive, run:

$ cdemu load 1 alpine-standard-3.10.3-x86_64.iso

Load image using cdemu on second device

Remove virtual drives

To remove a virtual drive, run:

$ cdemu remove-device

This command will remove the last virtual device.Please note that this command will unmount all loaded images in the last drive automatically and then delete the drive itself.

This is just enough to get started with cdemu.

Of course, It has more options.You can refer them from the help section.

For help, run:

$ cdemu --help

gCDEmu – A GTK client for CDEmu

If you ’re not comfortable with command line, there are also a few graphical clients available for CDEmu. One such client is gCDEmu.

gCDEmu is a GTK application for controlling CDEmu daemon that allows you to load, unload and display virtual device status via a simple graphical window.

gCDEmu is available in the default repositories of some Linux distributions.

On Arch Linux and its variants, you can install gCDEmu from AUR using any AUR helpers, for example Yay.

$ yay -S gcdemu

On Debian 10, 9, 8:

$ sudo apt-get install gcdemu

On openSUSE:

$ sudo zypper install gcdemu

On Ubuntu, you need to add the official PPA for cdemu as shown in the “Install cdemu on Linux” section above an then install gCDEmu using command:

$ sudo apt install gcdemu

Once installed, launch gCDEmu either from Dash or Menu.It will be probably found under under Menu-> System Settings-> gCDemu.

Launch gcdemu

After launching, you will notice gCDEmu icon in the task bar.Click the gCDemu icon and select Device # 00 or Device # 01 to mount your images.

gcdemu icon in task bar

Click “Load” and browse the ISO to load:

Load images using gcdemu

The ISO will be mounted now and you can see it in the File manager.

view images in file manager

After done with the ISO image, simply press the “Unload” button in the gCDemu window or eject from the file manager.

Unload images

You can create many virtual devices and load the images in any virtual devices of your choice.To create a new device, click on the gCDEmu icon in the task bar and select “New device” option.

For more details, refer the official website linked below.