How to Enable and Change the Login Sound in Ubuntu 12.04+
The login sound is disabled by default in Ubuntu 12.04+. The only sound that plays by default when an Ubuntu machine boots up is the drum beat sound that plays when the login screen loads. The sound that plays when the user logs in is disabled by default, but it is possible to enable and change it to anything you want. You can also disable the drum beat sound, if you would like to. See this Ask Ubuntu post for instructions on how to disable it.
To enable and change the Ubuntu login sound, you won’t need any extra tools aside from a terminal window and your own custom sound in .ogg format.
First, you will need to unhide and enable Ubuntu’s login sound startup process. Open up a terminal window, copy/paste this line of code, and run it.
sudo gedit /usr/share/gnome/autostart/libcanberra-login-sound.desktop
This will open up the file
libcanberra-login-sound.desktop in Gedit with root privileges so that you can edit it. You should see this script open in Gedit:
Edit the last line in the file and change
Once you’ve done that, save and close the file and open the Startup Applications dialogue. The option GNOME Login Sound should now be visible.
Check the box next to it. Now, the default Ubuntu login sound should play when you log in to your account.
Now you can change the default sound. To do this, you will need to replace the default sound file with one of your choosing. However, to edit the login sound file, you must access it with root privileges. You can do this through a terminal session or by opening Nautilus, the file manager, with root privileges.
Method One: Terminal Session
Convert your custom sound file to .ogg format, name it
desktop-login.ogg, and move it to the Downloads folder.
Then, open a terminal window and run this command:
This will open the directory containing the login file in the terminal window.
You will need to replace the file
desktop-login.ogg with one of your own. You can back up the original file and then replace it with your own all inside the terminal window by running these commands:
sudo cp desktop-login.ogg desktop-login.ogg.old sudo cp ~/Downloads/desktop-login.ogg
The first command renames the original
desktop-login.ogg file to
desktop-login.ogg.old. The file will remain untouched in its original directory, but Ubuntu will ignore it and use any custom
desktop-login.ogg that you add to the directory.
The second command imports your custom
desktop-login.ogg file to the system sounds directory. Done!
Log out and log back in to test your new login sound.
Method Two: Open Nautilus as Root
This method uses the file manager’s GUI to perform the sound file switch.
Open a terminal window and run this command:
This will open Nautilus with root privileges so that you can edit the login sound file. Browse to
/usr/share/sounds/ubuntu/stereo and click on
desktop-login.ogg. Press F2 and rename the file to
desktop-login.ogg.old. This is the backup of the original file. The file will remain untouched, but Ubuntu will ignore it and use any .ogg file with the name
desktop-login that you add to the directory.
Now, open a new window and browse to the location that your custom sound file is stored. It must also be named
desktop-login.ogg, but it can be any file you want. Copy/paste your custom file into the root window we were just using. Done!
Log out and log back in to test out your new login sound.