Sunday, 25 January 2009

Enable Guest USB Access on VirtualBox

Although I have been using Linux exclusively for a long time now, there are still occasions where some pesky applications demand a Windows environment. For those rare moments, I have Windows XP installed as a guest OS on VirtualBox. VirtualBox is an absolutely wonderful virtualization tool that provides almost every function I need from a Windows box.

Recently however, I had to plug in a USB device to the Guest OS and I found out that the USB device menu is grayed out, preventing me from switching the device over from the host to the guest. I tried messing with the settings but none seemed to have an effect. A quick search of the internet revealed this article which worked like a charm!

First create a new group and add yourself to it
sudo groupadd usb
sudo usermod -G usb `whoami`

Find out the gid of the new group by running the following command
MYGID=`cat /etc/group | grep usb | awk -F ":" '{print $3}'`
Create a new entry in fstab
sudo echo "none /sys/bus/usb/drivers usbfs devgid=$MYGID,devmode=664 0 0" >> /etc/fstab
Restart the computer
sudo reboot

Now when you start VirtualBox, the USB devices can be freely assigned to the guest OS.

Monday, 19 January 2009

Mobile Phone Management With Wammu

I recently needed to backup the contents of my Sony Ericsson K750i. Since the utilities provided with the phone only work on Windows, I had to hunt for a similar application for Linux.

Wammu is a GUI application that can be used to manage a vast number of mobile phones. It uses the Gammu utilities in the back-end and provides a nice GUI front-end to control every aspect of the mobile phone such as the Address book, Calendar, Task list, Call lists, Messages etc. A large number of mobile phones are supported by this tool, a comprehensive list can be found here. Phones can be connected either via USB, IrDA or Bluetooth.

The setup was straightforward.
sudo yum install wammu pybluez

The pybluez package is only required if you want to connect to the phone via bluetooth.

The GUI is quite easy to navigate through. Therefore I am not going to go in to specifics. A screenshot is more than enough to see how intuitive the interface is.

Thursday, 1 January 2009

Fixing Bluetooth and PackageKit problems in Fedora 10

I began to suspect that something was wrong with the D-BUS permissions on my Fedora 10 system when I started getting the following error at the end of a Yum session:
ERROR:dbus.proxies:Introspect error on :1.46:/org/freedesktop/PackageKit: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: A security policy in place prevents this sender from sending this message to this recipient, see message bus configuration file (rejected message had interface "org.freedesktop.DBus.Introspectable" member "Introspect" error name "(unset)" destination ":1.46")

This seemed to have affected the Bluetooth daemon as well. No matter how I tried, I could not get bluetooth-properties to remember my preferences. My computer was not visible to other Bluetooth enabled devices and I could not browse my phone via Bluetooth. (It used to work flawlessly in Fedora 9). I diagnosed that the problem is with D-Bus by running the following command:
sudo bluetoothd -n -d
bluetoothd always terminated with the error:
Unable to get on D-BUS

I tried mucking around with D-Bus policy settings in /etc/dbus-1/system.d/ but had no luck until I came across this helpful post at FedoraForums.

After editing /etc/dbus-1/system.conf as mentioned, I restarted the computer and voila ! Bluetooth started working and yum stopped complaining !!

For completeness, this is the interesting bit from my new /etc/dbus-1/system.conf
<!-- allow sending valid replies -->
<!-- commented out part
<allow send_requested_reply="true" send_type="method_return"/>
<allow send_requested_reply="true" send_type="error"/>
<!-- Newly added line to fix permission problems -->
<allow send_requested_reply="true" />

Kudos to all the helpful people at Fedora Forums !