[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...

    This time its really simple. You need to type those commands on your PC in a shell window, not on the phone itself:

    1. Open an adb shell into your phone: adb shell
    2. Gain root privileges by typing sudo -i and entering your unlock PIN or password
    3. Remount the root file system writable: mount -o remount,rw /
    4. edit the config file that is responsible: nano /etc/machine-info
    5. Change the PRETTY_HOSTNAME field to whatever you like. I recommend though to not use special characters. Spaces are OK!
    6. 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!

  • @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 better nano
    • It is not clear that after rebooting the phone, the system will be read-only again

  • @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 only CHASSIS=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.

Log in to reply