I cannot really point out the exact reason, but a lot of GNU/Linux distributions fail to keep the last saved status of my Bluetooth device. So even if I had turned it OFF in my previous desktop session, the next time I login, it will be turned ON. This is how it is with Ubuntu, and sadly, the same issue exists in Fedora 18 as well.
Most Laptop users don’t use their Bluetooth connection, and when not used, it should be turned OFF, as it draws a reasonable amount of power when running. And turning it OFF, will also prolong your battery life too (obviously).
In Ubuntu, one can easily fix it by tweaking a configuration setting, but doing the same thing in Fedora (talking about ’18’ here), is a bit difficult. So I thought of writing a simple ‘how to’ concerning this, would come in handy for all the new users out there. For that, please follow the below steps.
First of all, we are going to need a tool called ‘rfkill’. It is a command-line based utility that lets us control various types of wireless networking devices in GNU/Linux. Ubuntu comes it installed by default, but Fedora does not.
So, open your Terminal window and enter the below command to install it.
su -c 'yum install rfkill'
Now, we are going use ‘rfkill’, and make Fedora execute it while loading the desktop session (every time) thus, disabling the ‘Bluetooth’ connection, automatically. For that, we have to create a configuration file called ‘rc.local’ and put the appropriate ‘rfkill’ command in it.
You don’t actually have to know any of these details, but I just thought a little information wouldn’t go wasted :). Anyhow …
Open your Terminal window and enter the below command to create that configuration file.
su -c 'vi /etc/rc.d/rc.local'
This will create an empty file and open it using a command-line based editor called ‘vi’.
So, once opened, type ‘i’ key on your keyboard to start entering data into the newly created, empty file (otherwise ‘vi’ will not let you enter anything). And as soon as you type ‘i’, you should see a text field called ‘— INSERT —‘ appearing at the bottom of the editor window (shown below), denoting that ‘vi’ is waiting for your input.
Now simply copy and paste (or type them manually) the below text into the editor.
rfkill block bluetooth
Now, to save and exit the ‘vi’ editor, first press the ‘Esc’ key on your keyboard. Then type ‘:wq’ (shown below) and press Enter.
As soon as you do that, ‘vi’ will save the content to the newly created ‘rc.local’ and exit.
Now in this final step, we will give executable permissions to the ‘rc.local’ file (otherwise the OS won’t be able to run it). For that, simply enter the below command.
su -c 'chmod +x /etc/rc.d/rc.local'
Well that’s it.
Now just for testing, turn Bluetooth ON and reboot the computer. And the next time you login into the Desktop, it should be turned OFF. But bear in mind that, because this command is run when you login to the desktop, it might take few seconds before the Bluetooth icon changes into the OFF status (about 2-3 seconds in my Laptop). That’s it, I hope it was helpful.
20 thoughts on “How to Disable Bluetooth being Automatically Turned ON in Fedora 18”
thanx for this information.
You are welcome ‘frank’ :).
Very usefull to know, thank you for sharing this and greetings from Germany =)
You are welcome ‘Saskia’ :).
Thank’s for your post, but it doesn’t help me…
On my Asus laptop don’t works… 🙁
Hmm, that’s weird, if you’ve followed all the steps properly, then I cannot see what it shouldn’t work …
thank you, seems to stay off when turned off. thank you very much.
Thanks I couldn’t find how to do this elsewhere.
Stupid that it has to be a shell script.
You’re welcome Dan.
This process is also effective for Fedora 19
Excellent fix…works for Fedora 20!!! Why does this tweak have to be so labor intensive? Seems like it should be an easy fix for the programming gurus. Well, at least I learn a little more about the command line by doing it 🙂
Well, that’s one way of looking at it ;-).
A simpler way to do this is to disable the bluetooth service.
Using rfkill to kill the daemon after it starts works but it is better not to start it at all.
Use systemctl (on Fedora 19 and up) to stop en then disable the service:
sudo systemctl stop bluetooth
sudo systemctl disable bluetooth
For some reason the gnome-bluetooth app still shows the “active” icon but opening the gnome-bluetooth settings screen will show that it is disabled.
Thank you Bram. However, I wanted to not to completely disable the Bluetooth, but to make sure that it doesn’t get turned ON upon desktop login. But for someone that doesn’t really need Bluetooth, your method is ideal I suppose. Thanks again.
ps: from Brazil!
You’re welcome Emerson :).