-   Linux - Software (
-   -   CDemu returns error loading shared library (

rohedin 07-02-2010 01:40 PM

CDemu returns error loading shared library
I have downloaded CDemu from and installed it without errors. However when I go to /usr/local/bin and run ./cdemud it returns the following error,

ben@Scottie /usr/local/bin $ ./cdemud
./cdemud: error while loading shared libraries: cannot open shared object file: No such file or directory
I find this confusing as I have installed libmirage - - and I have found in /usr/local/lib.
Am I doing anything wrong? Does anyone know how I can fix it?
Thanx in advance for any help on this problem! :)

knudfl 07-03-2010 04:18 AM

Not very unusual : The executable 'cdemud'
may be hard coded to look in /usr/lib/ only.

Just create a symlink to /usr/lib/


rohedin 07-03-2010 01:05 PM

Thanx for the reply :)
I have done what you sugested but it comes up with a new error,

Scottie bin # ./cd*
Starting daemon in local mode with following parameters:
- num devices: 1
- ctl device: /dev/vhba_ctl
- audio driver: null
- bus type: system
cdemud: Daemon: failed to request name on system bus!
Daemon initialization failed: Name request on D-BUS failed.
Does anyone know how to fix this?

knudfl 07-04-2010 06:11 AM

.. Daemon initialization failed: Name request on D-BUS failed ..
> line 250. ( It's a good tutorial. Suggest: Read it all.)

Please try : sudo cdemud

Did you install the required vhba module ?
May be : sudo modprobe vhba

rohedin 07-05-2010 11:42 AM

Found something else :)
I actually found an other program, gmount-iso, that works ;)

Yiguro 09-02-2010 01:06 PM

How I compiled CDemu in fedora 13
1 Attachment(s)

EDIT: I've added info on how to run on session bus, something that I couldn't get to work until now.

I've tried this in fedora 13 64 bit, but it should also work for 32 bit. Everything installs to /usr/local, except gCDemu, which is installed to /usr.


  • libmirage


    Dependencies: yum install glib2-devel libsndfile-devel zlib-devel
    Install: ./configure && make && make install

  • vhba


    Install: make && make install
  • cdemu-daemon


    Dependencies: yum install dbus-devel dbus-glib-devel libao-devel libdaemon-devel

    Install: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --sysconfdir=/etc && make && make install

    PKG_CONFIG_PATH=/usr/local/lib/pkgconfig tells it to look for libmirage libraries in /usr/local/lib, not /usr/lib. The --sysconfdir=/etc is necessary, because according to the README file:


    ...due to the way autotools are used, /etc gets
    prefixed and therefore config file ends up installed into ${prefix}/etc/. To
    avoid this, you should pass --sysconfdir=/etc to configure, regardless of the
    prefix you are passing to configure.
    If you didn't do this, you would get your second error:


    'cdemud: cdemud_daemon_initialize: failed to get name on system bus!
    Daemon initialization failed: Name request on D-BUS failed.'

    Now, issue this commands (extracted from


    cd /etc/
    create file named usr-local-lib.conf (or whatever name you like) containing:

    and finally, run

    These commands avoid the first error you got:

    "./cdemud: error while loading shared libraries: cannot open shared object file: No such file or directory"
    NOTE: (my library is instead of because I'm using a newer version on CDemu). knudfl suggested to add a symbolic link in /usr/bin pointing to /usr/local/lib/ While that works, it's better to do what we've done here.

  • cdemu-client

    Dependencies: yum install intltool pygtk2-devel

    Install: ./configure && make && make install

    Add the following to your ~/.bash_profile:


    export PYTHONPATH=/usr/local/lib/python2.6/site-packages
    If you didn't do this, you would get another error:

    [root@power-sylvia cdemu-client-1.1.0]# cdemu
    Traceback (most recent call last):
    File "/usr/local/bin/cdemu", line 23, in <module>
    import cdemu, cdemu.cdemu
    ImportError: No module named cdemu

  • gcdemu

    Install: ./configure --prefix=/usr && make && make install
    The --prefix=/usr thing is because Gnome looks for its panel applets in /usr.
    Now, log out and log in
    Right click on menu, Add to panel... -> gCDEmu Applet (an applet for controlling cdemu devices). Right click on the gcdemu applet. If you check "Use system bus" gCDemu listens for cdemu-daemon on the system bus, otherwise, it listens on the session bus. In the next section "How to start CDemu at boot" there's more information about it.

How to start CDemu at boot:

  • Load vhba module at boot
    Create a file named /etc/sysconfig/modules/vhba.modules containing:


    modprobe vhba
    Now, you have to decide whether you want to run cdemu-daemon in system bus (daemonized) or session bus (executed as a regular command in a startup script). CDemu 1.3.0 recommends session bus because it's more secure.

    Procedure for system bus:

    • Add init script
      Create file /etc/rc.d/init.d/cdemud containing the file I've attached (remove the .txt extension)

      Add execute permissions to the file you just created:


      chmod ugo+x cdemud
      By the way, the start priority for this script is the lowest possible (99). This is because if its priority is very high, /etc/sysconfig/modules/vhba.modules gets loaded after it (should be before, it's a "race condition"), causing an error at the boot sequence:


      Starting CDemud: Failed to start daemon (1).
      If this happens, gCDemu applet will appear greyed out.

      However, with priority 99 everything starts fine:


      Starting CDemud: Daemon successfully started.

    • Make the script start at every boot. There are several options:
      • Using Fedora/Red Hat's chkconfig (recommended for Fedora):

        chkconfig --add cdemud
      • If you're not using Fedora, it would be a different command (e.g update-rc.d in Debian) and modify script startup # accordingly

      • Manually adding symbolic links to rcX.d. Add SXXcdemud and KXXcdemud symbolic links, where XX is any free number available, in my case I've used 41:


        cd /etc/rc.d/init.d
        ln -s cdemud ../rc0.d/K41cdemud
        ln -s cdemud ../rc1.d/K41cdemud
        ln -s cdemud ../rc2.d/S41cdemud
        ln -s cdemud ../rc3.d/S41cdemud
        ln -s cdemud ../rc4.d/S41cdemud
        ln -s cdemud ../rc5.d/S41cdemud
        ln -s cdemud ../rc6.d/K41cdemud

    Procedure for (the recommended) session bus:

    • First, create a file named /etc/udev/rules.d/99-vhba.rules containig:

      KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemud"
    • Add "cdemud" group. You can do it from Gnome's GUI or using command line:


      # groupadd cdemud
      # usermod -a -G cdemud your_username

    • Finally, add the following to your ~/.bash_profile:

      /usr/local/bin/cdemud --bus=session &

If gCDemu appears greyed out, check whether you're using system or session bus, then right click the gcdemu applet and check/unckeck "Use system bus" accordingly. If it's checked it'll use system bus, otherwise, it'll employ session bus.


If you arrived here finding info for this error:


[root@fedora standard]# cdemud --bus=session
Starting daemon in local mode with following parameters:
 - num devices: 1
 - ctl device: /dev/vhba_ctl
 - audio driver: null
 - bus type: session

cdemud: Daemon: failed to get session bus!
Daemon initialization failed: Failed to connect to D-BUS bus.

It happens because you are running cdemud session bus as root. You can only run as root when using system bus. Check mrok quote from


mrok said:
If you use session bus, you should run the daemon as the user
instead of root. Each user has their own session bus, which is inaccessible
by other users; therefore CDEmu instance ran on session bus as root won't
be accessible by other users...

All times are GMT -5. The time now is 04:01 PM.