Mounting CUE/BIN/NRG/CCD (& other) Images on Linux Using CDemu

CDemu is basically a Daemon Tools alternative for Linux. It is a kernel module that lets you mount disk images to a virtual disk drive. It is capable of mounting TOC/CUE/BIN, NRG (Nero), CDI (DiskJuggler), CCD (CloneCD), MDS/MDF (Alcohol 120%), B6T (BlindWrite 6) and TOC images, and probably whatever else libMirage can handle.

Installation isn’t an apt call away, but it’s simple enough. I literally had my legal CUE/BIN image mounted and installing 5 minutes after discovering this awesome ‘ware.

SHORT VERSION: Do not use CDemu 0.8.0 or older! LONG VERSION: The original CDemu (dev stopped at version 0.8) can be found here, but according to Wikipedia, has a bug which may corrupt your disk images when mounting. The newer userspace-CDemu (this) does not have this problem and works flawlessly.


Installation

CDemu consists mainly of two apps. CDemu-daemon, which is where the magic happens, and CDEmu-client, the (CLI) frontend you’ll use to mount/unmount images.

If you wish to download all the code before getting started, go here and get every package that applies to your distro, or the source code, except for the *-dev (development), *-dbg (debug) and diff (patch) stuff. You may also skip fetching gCDemu, which is a Gnome applet.

http://sourceforge.net/project/showfiles.php?group_id=93175

Be sure to download the package compiled for your architecture (i.e., AMD64 for 64 bit, or i386 for 32 bit processors).



Ubuntu (From repository OR installing the packages manually)

Here are the names of each package you’ll need:

$ apt-cache search cdemu
libmirage1 - A CD-ROM image access library
cdemu - cdemu-client from SVN, compiled
cdemu-daemon - CDEmu daemon
vhba-dkms - VHBA virtual host bus adapter module

Be sure to sync the package list before starting:

$ sudo apt-get update
...
$ sudo apt-get upgrade

DKMS

First we need the Virtual Host Bus Adapter module (vhba-dkms). This depends on Dynamic Kernel Module Support (DKMS):

$ sudo apt-get install dkms

vhba-dkms

and then either install from repository:

$ sudo apt-get install vhba-dkms

or download the vhba-dkms deb package from the Sourceforge page:

$ sudo dpkg -i vhba-dkms_1.1.0-0ubuntu2_all

libMirage

Now we need to install libMirage:

$ sudo apt-get install libmirage1

or if you wish to install the package manually (can fetch that from here):

$ sudo dpkg -i libmirage1_1.1.0-0ubuntu1_amd64.deb

cdemu-daemon

and now the CDemu daemon:

$ sudo apt-get install cdemu-daemon

or

$ sudo dpkg -i cdemu-daemon_1.1.0-0ubuntu1_amd64.deb

If either of these are giving you a python-central error (depends on >= 0.6.7 but system has 0.6.5ubuntu1), SEE THIS.

cdemu-client

and CDemu client:

$ sudo apt-get install cdemu

or

$ sudo dpkg -i cdemu-client_1.1.0-0ubuntu1_all.deb

Common cdemu/daemon problem: Packages depend on python-central >= 0.6.7 but system has 0.6.5ubuntu1

As of this writing, the python-central package in Hardy is 0.6.5ubuntu1. You might get this error:

Selecting previously deselected package cdemu.
(Reading database ... 8.34 gazillion files and directories currently installed.)
Unpacking cdemu (from cdemu_1.1.0-0ubuntu1_all.deb) ...
dpkg: dependency problems prevent configuration of cdemu:
 cdemu depends on python-central (>= 0.6.7); however:
  Version of python-central on system is 0.6.5ubuntu1.
dpkg: error processing cdemu (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 gcdemu

I believe 0.6.7 is in testing.. but I don’t recommend getting it, as it can break other apps that depend on 0.6.5ubuntu1. Instead, you can install cdemu/cdemu-daemon from source tar or subversion. Download the source and then do the usual:

$ sudo apt-get install build-essential
$ tar -xvjf cdemu-1.1.0.tar.bz2
$ cd cdemu-1.1.0/
$ ./configure && make

Instead of running sudo make install next, use checkinstall, an installation tracker that can make Deb packages and keep track of the files installed. Should you decide to remove the package later, you can use aptitude or dpkg -r .

Run this while still in the cdemu directory:

$ sudo apt-get install checkinstall
$ sudo checkinstall -D

or install using subversion (recommended).

You’re ready to go, skip down to the usage section.

gCDemu (optional)

gcdemu is a Gnome applet interacting with the CDemu-daemon. I can’t say I recommend it. Actually, I don’t even know if it works. It seems obsolete in the current Hardy repos, and I think gCDemu is the only app that froze my Linux box, but it was likely due to my own tinkering and not the applet itself. dpkg had a hard time removing it, hang on ‘Removing gcdemu …’ (but did remove it if you waited long enough).

If I haven’t Curbed Your Enthusiasm… you can try the package, but it gives me the same python-central error cdemu gives me:

$ sudo dpkg -i gcdemu_1.1.0-0ubuntu1_all.deb

In that case (read), you can install from source:

$ tar -xvjf gcdemu-1.1.0.tar.bz2
$ cd gcdemu-1.1.0/
$ ./configure --prefix=/usr && make
$ sudo checkinstall -D

If you’d like to remove it, use sudo dpkg –purge gcdemu or aptitude. If you’d like to see command-line usage, jump down.

Gentoo

Use the heart of Portage. Be sure to update the portage tree first:

$ sudo emerge sync

and then:

$ sudo emerge -av cdemu

Ebuilds are available for every package/dependency:

  • http://www.gentoo-portage.com/app-cdr/cdemu
  • http://packages.gentoo.org/package/sys-fs/vhba
  • http://packages.gentoo.org/package/app-cdr/gcdemu
  • etc


    • Fedora (RPM)

      You can download binary packages from the official SourceForge page: http://sourceforge.net/project/showfiles.php?group_id=93175&package_id=256720





      Subversion (SVN)

      This is straight from the official page:

      If you want to live on the bleeding-edge, want to participate in development, are just curious, etc., you can always checkout the current SVN tree. For more information, click here.

      To check out only trunk, use:

      svn co https://cdemu.svn.sourceforge.net/svnroot/cdemu/trunk

      To check out specific part of project, append its name to above URL; i.e.:

      svn co https://cdemu.svn.sourceforge.net/svnroot/cdemu/trunk/libmirage

      Currently, the following components can be retrieved:

      * cdemu-client
      * cdemu-daemon
      * gcdemu
      * image-analyzer
      * libmirage
      * vhba-module

      If present, ./autogen.sh script needs to be run prior to building the sources checked out from SVN. Please note that for building from SVN, some additional tools which are not needed when building from released sources might be required (e.g. recent version of flex and bison for libmirage).

      Here’s an example session:

      $ svn co https://cdemu.svn.sourceforge.net/svnroot/cdemu/trunk/cdemu-client
      $ cd cdemu-client/
      $ view INSTALL
      $ view README
      $ sudo apt-get install intltool
      $ sudo apt-get install automake
      $ ./autogen.sh
      $ ./py-compile
      $ ./configure && make
      $ sudo checkinstall -D
      


      Usage & Examples

      Easy!

      CDemu daemon (“service”)

      The CDemu-daemon (cdemud) needs to be started as root, else you get this error:

      Starting daemon in local mode with following parameters:
       - num devices: 1
       - ctl device: /dev/vhba_ctl
       - audio driver: null
       - bus type: system
      cdemud: cdemud_daemon_initialize: failed to request name on system bus!
      Daemon initialization failed: Name request on D-BUS failed.
      

      Let’s start it the correct way and mount a CUE/BIN image. Start a terminal and enter the following:

      $ sudo cdemud
      

      and if all is well with the world, you should get this output, followed by a blinking cursor:

      $ cdemu status
      
      Devices' status:
      DEV   LOADED     TYPE       FILENAME
      0     0          N/A        N/A
      

      My device is 0.

      $ cd not_porn/
      $ ls
      not_porn.bin  not_porn.cue
      $ cdemu load 0 not_porn.cue
      $ cdemu status
      Devices' status:
      DEV   LOADED     TYPE       FILENAME
      0     1          PARSER-CUE /marco/polo/not_porn.cue
      

      and should be greeted with a window featuring the contents of the image file. If not, it means you’re wack, but you can head over to /media/ or /mnt/ – usual places the image gets mounted.

      (Final Fantasy 7 battle victory sound clip plays)

      Note on BIN Files

      Remember to mount the CUE/TOC and not the actual BIN file.

      Unmount

      $ cdemu unload 0 or just close the terminal.


      Find Softwarez for your New Toy

      What better way to learn something than hands-on experience?

      BTJunkie.org is the largest torrent index on the Internets. It uses a crawler (or “spider”) to add torrents on other sites to its database, and features an excellent feedback system (which is new, but usage is growing) to help weed out broken/malicious and otherwise worthless torrents.

      and remember kids,



      External links

      This was written from memory a short time *after* I had my fun with CDemu. Mistakes/problems/updates/tips can be left in a comment or my inbox.

    2 thoughts on “Mounting CUE/BIN/NRG/CCD (& other) Images on Linux Using CDemu”

    1. There is now an APT repository that provides up-to-date packages, at least for ubuntu. worked out of the box to me:

      1. add repository: deb http://ppa.launchpad.net/cdemu/ubuntu intrepid main
      2. install packages: sudo apt-get install cdemu-daemon gcdemu
      3. reboot or run cdemu manually: sudo /etc/init.d/cdemu-daemon start
      4. launch daemon (sudo required!): sudo cdemud
      5. add applet to your toolbar and there you go: mount cue images in gnome!

      more details: http://ubuntuforums.org/showthread.php?t=938030

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>