Monday, 14 May 2012

How-to: Disable Bluetooth on Startup

Under Ubuntu 11.04 and 11.10, my netbook has a problem; the Bluetooth adapter persists in turning itself on regardless of what you try to do to turn it off. I never use Bluetooth. It's slow, insecure and wastes battery.

You can turn it off per session, but next time it's right back on. In System Settings, it shows as off. All the time. Clearly that control isn't effective. So let's delve a little deeper.

First, always backup your configuration files!


~$ sudo cp /etc/bluetooth/main.conf /etc/bluetooth/main.conf.OLD
will backup the configuration file so you can edit the original.

Then you need to edit the bluetooth configuration file:
~$ sudo gedit /etc/bluetooth/main.conf

Search for the entry:
InitiallyPowered = true

and change the value to:
InitiallyPowered = false

Next, look for:
# List of plugins that should not be loaded on bluetoothd startup
# DisablePlugins = network,input

and uncomment the DisablePlugins line

Next we're going to modify a file simply called bluetooth:
~$ sudo gedit /etc/default/bluetooth

Search for the start bluetooth section and edit the enabled value to 0 (zero) which is 'off':

# start bluetooth on boot?
# compatibility note: if this variable is _not_ found bluetooth will start
BLUETOOTH_ENABLED=0

Save the file and exit.

Reboot the machine. Bluetooth should stay off.

Black and Blue
It's possible that you may need to stop Bluetooth by blacklisting bluetooth so that key modules aren't loaded. This requires another configuration file edit:
~$ sudo gedit /etc/modprobe.d/blacklist-rare-network.conf

Adding this:
#Disable bluetooth
alias net-pf-31 off

to the file.

Friday 13th Part-99
In the unlikely event that Bluetooth comes back like JAson in a hockey mask, you can always remove all installed Bluetooth packages. Note there may be some related files you can't remove because of dependencies for other packages. You can do this from within Ubuntu Software Centre, but you will need to search on 'bluetooth' and inclue Technical Items categories.

If that doesn't work and Bluetooth still appears, I recommend contacting a priest and requesting an exorcism! RC

UPDATE: Since scheduling this post, the Ubuntu 12.04 install onto the netbook has fixed the problem!