Tag Archives: Ubuntu

VirtualBox USB Proxy Service on Ubuntu Gutsy Gibbon

When accessing the settings dialog in VirtualBox on Ubuntu/Kubuntu 7.10 Gusty Gibbon, I would get the error, “Could not load the Host USB Proxy Service (VERR_FILE_NOT_FOUND). The service might be not installed on the host computer.” I found a variety of fixes from different forums and blogs so here’s a consolidated guide to resolve the issue based on my installation of VirtualBox 1.5.6 on Kubuntu 7.10.

  1. Open the file /etc/init.d/mountdevsubfs.sh with your favorite text editor (be sure to use sudo or open as root so that you have write permission).
  2. Look for the following comment:# Magic to make /proc/bus/usb work
  3. Remove the hash mark, #, from the four commands (mkdir, domount, ln, mount) following that comment. The result should look like the following:#
    # Magic to make /proc/bus/usb work
    mkdir -p /dev/bus/usb/.usbfs
    domount usbfs “” /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
    ln -s .usbfs/devices /dev/bus/usb/devices
    mount –rbind /dev/bus/usb /proc/bus/usb
  4. Save the file and run it with sudo (or as root) appending the parameter “start” to the end:sudo /etc/init.d/mountdevsubfs.sh start
  5. Next, create a new user group called usbusers. On Kubuntu, you can do this with the User Management tool in the KDE Control Center.
  6. Add your username, and anyone else who uses VirtualBox on the computer, to the usbusers group. Save the changes.
  7. Open the file /etc/udev/rules.d/40-permissions.rules (again, using sudo or as root). 
  8. Change the following lines:# USB devices (usbfs replacement)
    SUBSYSTEM==”usb_device”, MODE=”0664″


    # USB devices (usbfs replacement)
    SUBSYSTEM==”usb_device”, GROUP=”usbusers”, MODE=”0664″

  9. Save the file.

Now it should work fine and you don’t even have to reboot.

Resume from Hibernate Failed on Ubuntu Gutsy Gibbon

For many years I’ve enjoyed the reliability of the Ubuntu/Kubuntu Linux hibernate functionality (just the opposite of Windows). However, today it actually failed. When I powered up the system, it didn’t resume from the swap file. Instead, it just booted up as if I had previously killed the power.

Upon checking into the problem, I noticed that the UUID for the swap partition had changed. I don’t know why. After much hunting and trial-and-error, I was able to reinitialize the swap partition, update the necessary config files and get the system to resume from hibernate once again.

1. First, you need to know the /dev path to your swap file (e.g. /dev/hda2). If you don’t know what it is, take a look inside the /etc/fstab file. In the recent versions of Ubuntu, there is a comment above each device’s UUID entry to tell you what path it points to. Look for a line with

UUID=a-bunch-of-letters-and-numbers none swap sw 0 0

On the line above it should be a comment that says what partition it is (e.g. # /dev/hda2)

Now, armed with that information, do the following:

2. sudo mkswap /dev/your-swap-partition
For /dev/your-swap-partition, fill in the swap partition path you found in the /etc/fstab file. This will reinitialize your swap partition and create a new UUID. Copy down the new UUID (e.g. copy it to the clipboard).

3. sudo gedit /etc/fstab
Look for the same UUID= line from step #1 (the one for your swap partition). Replace the existing UUID value with the new one that you copied in step #2. Then, save the file.

4. sudo gedit /etc/initramfs-tools/conf.d/resume
Replace the old UUID value that appears after RESUME=UUID= in the file with the new value from step #2. Save.

5. cd /dev/disk/by-uuid
This directory contains symlinks from UUIDs to actual partitions.

6. sudo rm your-old-UUID
Enter the old UUID for the swap partition in place of your-old-UUID. This will remove the old, incorrect symlink.

7. sudo ln -s ../../your-swap-partition your-new-UUID
Now, create a new symlink from your swap partition to the new UUID.

8. sudo swapon -va
This will mount the swap partition based on the UUID settings you entered. If it succeeds, you didn’t make any mistakes. If it fails, then you need to verify that you have the correct UUID and partitions in the steps above.

9. sudo update-initramfs -u
This will create a new initramfs image. When it’s done, you’ll be able to hibernate and resume again.

That was a really weird problem. Thanks to a combination of techniques from these two sources, I was able to get it back to normal:

Suddenly my swap drive was missing
Kubuntu Edgy: swap failed when awaken from hibernate

Pidgin Has No Sound In Ubuntu Gutsy Gibbon

For some reason, Pidgin, which is included in Ubuntu 7.10 Gutsy Gibbon, has no notification sounds even though other applications do play properly. Whether I selected Automatic or ALSA as the output method, no sounds would play. Here’s how I fixed it.

  1. In Pidgin, select Preferences from the Tools menu (or press Ctrl+P)
  2. Click on the Sounds tab
  3. In the Method drop down list, select Command
  4. In the Sound command text box, enter the following: aplay %s
  5. Select an event with an assigned sound from the Sound Events list
  6. Click the Test button. You should now hear the notification sound
  7. Click the Close button

Aplay is the command-line ALSA sound player. I tested it on the command line and it played audio files just fine. So, it also works in Pidgin.

Syntax Errors Running sh Scripts on Ubuntu

Normally, I install programs from the Ubuntu repositories but today I needed to install a VPN client from a tarball using a shell script. When I ran the included install.sh file, I got a couple syntax errors:

install.sh: 22: function: not found
install.sh: 24: Syntax error: “}” unexpected

Looking inside the script, I saw that it runs /bin/sh. Nothing unusual there. Well, it turns out that on Ubuntu, sh is a symlink to dash. Apparently, since the Edgy version of Ubuntu, sh has been pointing to dash and causing various compatibility problems with custom scripts meant for sh. I’m running Gutsy so my sh points to dash as well.

Two quick ways to fix the problem is to either change #!/bin/sh in the script file to #!/bin/bash (which I did) or change the symlink for /bin/sh to point to bash instead of dash. I may opt for the latter but the former worked just fine to get my VPN client installed.

Fix Compiz Fusion on Kubuntu 7.10 Gutsy Gibbon (Ubuntu + KDE)

Having trouble getting Compiz Fusion working on Kubuntu 7.10 (Gutsy Gibbon)? So did I and here’s how I fixed it.

I recently upgraded one of my Kubuntu Fiesty Fawn systems to Gutsy Gibbon (version 7.10). However, since it was a distro upgrade, not a new installation, the Compiz Fusion system wasn’t installed by default. Even after installing the compiz packages, things still weren’t quite right.

First, in addition to the compiz package, you have to select the compiz-kde package. For some reason, Adept doesn’t select it automatically with all the other compiz packages (even though this is Kubuntu, which uses KDE). Failure to install compiz-kde results in your windows not having any borders or widgets.

Second, install the compizconfig-settings-manager package. This is the configuration panel to access all the options for Compiz Fusion. Without this, some things just don’t behave quite right. For example, in the normal KDE desktop, I have focus follow the mouse. This doesn’t translate automatically to Compiz so you have to use the settings manager to adjust it. The tool also gives you access to all the Compiz plugins.

After all that’s done, restart X (Ctrl+Alt+Backspace) and log back in. Run the Compiz Settings Manager by going to the KMenu, Settings, Advanced Desktop Effects Settings. Adjust to your heart’s content.

There are still some quirks running Compiz on Kubuntu (such as the update manager icon sometimes appearing as a separate window rather than an icon in the notification area). But at least this gets it to be operational.

Have more tips? Post them in the comments.