Adding more stuff to the web

Bluetooth and VirtualBox on an OS X host

Tags: os x, tips

I’ve recently been playing around with the Crazyflie nano quadcopter, using the Ubuntu-based Bitcraze VM to run the radio and Python client. I’ve been using a PS3 controller attached via USB, but recently decided to connect via Bluetooth so I didn’t have to be tethered to my laptop while flying. Unfortunately, simply turning off Bluetooth in OS X doesn’t allow the guest machine to take control of the Bluetooth adapter.

Fortunately, this post gives the commands for unloading the Bluetooth daemon and kernel extensions which in turn allows the guest operating system to use the Bluetooth device. The only hiccup I found was with the last command - in Mountain Lion, the kextunload -b command didn’t work. Stealing the kextstat| grep -i bluet command from the next post down showed up the following extensions:

Considering how close the last line was to the one in the post, I took a guess and it worked! So, to enable Bluetooth on a guest OS with a Mountain Lion or Mavericks host (I’ve since upgraded, but the commands still work), you need to run:

sudo launchctl unload /System/Library/LaunchDaemons/
sudo kextunload -b
sudo kextunload -b

And then to re-enable Bluetooth within OS X:

sudo launchctl load /System/Library/LaunchDaemons/
sudo kextload -b
sudo kextload -b