[HowTo] Change the name of your device for Bluetooth pairing
-
Motivation
If you are using Bluetooth you might have noticed that there is something odd about the device name. It is set statically to "XY Ubuntu Edition" or "FP2" or whatever. On the Oneplus, its currently even wrong, indicating "FP2".So if you for example share a family car, and there are more UT users. how can they distinguish their phones in the carkit? And so on...
We are aware of this problem and will try to fix it in upcoming releases. Meanwhile you can apply the following fix. So, lets once more hack the system...
How
This time its really simple. You need to type those commands on your PC in a shell window, not on the phone itself:- Open an adb shell into your phone:
adb shell
- Gain root privileges by typing
sudo -i
and entering your unlock PIN or password - Remount the root file system writable:
mount -o remount,rw /
- edit the config file that is responsible:
nano /etc/machine-info
- Change the PRETTY_HOSTNAME field to whatever you like. I recommend though to not use special characters. Spaces are OK!
- Reboot the phone
Note: After rebooting the phone is set to readonly again, so in case you want to change the name later you need to follow the whole procedure again.
This should be all that is necessary to give you a rocking unique Bluetooth name!
- Open an adb shell into your phone:
-
@flohack good guide as always.
I have two suggestions (if you don't mind the insolence :-D) :
- Advanced users will want to use
vi
but for newbies is betternano
- It is not clear that after rebooting the phone, the system will be read-only again
- Advanced users will want to use
-
@advocatux Ok done
-
I believe this changes also the name displayed when connecting to a wifi TV...
-
@Flohack helping a user in the Welcome & Install group today, after a fresh UT install, he said the content of
/etc/machine-info
was onlyCHASSIS=handset
I told him to add the
PRETTY_HOSTNAME
line before that other line but I want to know if this is normal or not (to add it to this HowTo). Has anyone encountered the same issue?Edit to add that this user tells me now:
After installation i run the normal setup (language, location, wlan, name), setup a security code, enabled the developer mode, testet adb-onnection and have try to mount (MTP) the device for ssh-key transfer. After solving the usb-problem i follow your bluetooth howto.
So maybe one of those steps changed the
machine-info
file. -
@advocatux i tried it today on my OPO with (15.04 r3)
My machine-info has the PRETTY_HOSTNAME field
-
@nutzernam thank you for confirming it.
-
Is rebooting necessary for this to take effect?
-
@kugiigi yes I think
-
@flohack said in [HowTo] Change the name of your device for Bluetooth pairing:
We are aware of this problem and will try to fix it in upcoming releases.
@kugiigi said in [HowTo] Change the name of your device for Bluetooth pairing:
Is rebooting necessary for this to take effect?
@flohack said in [HowTo] Change the name of your device for Bluetooth pairing:
@kugiigi yes I think
So i guess it's not fixed yet ^^
One question though :
@flohack said in [HowTo] Change the name of your device for Bluetooth pairing:
You need to type those commands on your PC in a shell window, not on the phone itself:
Why can't it be done directly from the device using terminal?