Apple OSX: Mute startup sound / ‘chime’ in OSX 10.7 Lion and others

Acid got a working solution for OSX Lion which disables the startup sound without affecting your sound volume after logging in again. This was posted as a comment at the official Apple Forum originally. Thanks to Acid for this!

1. Login as administrator and open a terminal window

2. Create scriptfile for muting

sudo nano /path/to/mute-on.sh

3. Enter this as content, when done press control+O to save and control+X to exit:

#!/bin/bash

osascript -e 'set volume with output muted'

4. Create scriptfile for unmuting

sudo nano /path/to/mute-off.sh

5. Enter this as content, when done press control+O to save and control+X to exit:

#!/bin/bash

osascript -e 'set volume without output muted'

6. Make both files executable:

sudo chmod u+x /path/to/mute-on.sh

sudo chmod u+x /path/to/mute-off.sh

7. Check if any hooks already exist (these will be overwritten, so make sure it is OK for you)

sudo defaults read com.apple.loginwindow LoginHook

sudo defaults read com.apple.loginwindow LogoutHook

8. Add hooks for muting

sudo defaults write com.apple.loginwindow LogoutHook /path/to/mute-on.sh

sudo defaults write com.apple.loginwindow LoginHook /path/to/mute-off.sh

Notes:

– /path/to/ is the location of the scripts, I used /Library/Scripts/

– you can skip the unmuting loginhook (i.e. each logout will silence your machine), but I like it this way because I always have sound available exactly at the volume level I set last time

– root has to be the owner of the script files – running an editor from command line with sudo is the easiest way to achieve that (otherwise you need to chown)

– to delete the hooks, use the following:

sudo defaults delete com.apple.loginwindow LoginHook

sudo defaults delete com.apple.loginwindow LogoutHook

72 thoughts on “Apple OSX: Mute startup sound / ‘chime’ in OSX 10.7 Lion and others

  1. yjune writes:Thank you so much.I wanna turn up my Mac with silence.But after this update (Lion), it's always make sound.So I'm so nervous when I go to library,but now it's OK and work very good.Thank you once more.-From Korean Mac user-

  2. Nina_bm writes:Hey! I followed the instructions precisely (Lion) and it didn't work! I changed the order and tried some other ways and in the end I deleted the LoginHook:sudo defaults delete com.apple.loginwindow LoginHookIt works perfectly now and I even have sound since the very beginning! (:

  3. Originally posted by anonymous:

    /path/to/

    Did you replace "/path/to/" with an existing folder? This could be the problem if it didn't work ..

  4. Anonymous writes:AHH… At last, a solution that works (so far)! It's a shame that you have to go through all this on a Mac (not to mention all the tools from acrana and several others) just to mute the annoying startup sound.

  5. Anonymous writes:Nice!!! you use be the first, here's another i like kiosk mode from the app docker, to autohide menubar

  6. Anonym writes:Thank you so much for the instructions! My system would always startup on mute after installing Lion, so I had to unmute every time I started my computer. Using only the 'mute-off'-bit of your tutorial, I could finally fix the problem! Thanks a lot!

  7. "/path/to/" is a placeholder. You must replace it with an existing folder. I use a folder inside my home folder which contains several scripts. You can create a folder in Finder or with "mkdir YourFolder" in the Terminal. This example would create a folder named YourFolder inside the root of your home folder.

  8. Anonymous writes:when i type control+O to save it, i press enter and i get "[ Error writing /path/to/mute-on.sh: No such file or directory ]"can you help me fix this? thanks

  9. Some Dude writes:I've gone through these steps about 15x on two Macs but can't get any results.My /path/to situation is set to /Library/Scripts/.I'm hitting ctrl + o to write out, pressing Return, then ctrl + xI've checked that the hooks are actually there after creating them and can't find any issues when I troubleshoot. It looks like it should work just fine. I tried replacing the apostrophes with quotes as suggested on a comment to these instructions on another website (e.g., "set volume with output muted") – but that didn't help anything.Why is this working for everyone but me?? (Lion 10.7.1)

  10. Dennis writes:Would someone please put these instructions into really easy-peasy layman's terms?I've done a bit of poking around in my new MBA and copied some scripts into Terminal a few times before on my iBook but the window that opens after the "sudo nano /path/to/mute-on.sh" entry is all new to me (i.e. scary because I'm worried about what damage I can do in this deeper level of operations) and I don't know what is meant by 'hooks', 'chown' , checking if hooks exist, etc. but I really want to know how to be free of that fracking annoying start-up chime.

  11. Dennis writes:Would someone please put these instructions into really easy-peasy layman's terms?I've done a bit of poking around in my new MBA and copied some scripts into Terminal a few times before on my iBook but the window that opens after the "sudo nano /path/to/mute-on.sh" entry is all new to me (i.e. scary because I'm worried about what damage I can do in this deeper level of operations) and I don't know what is meant by 'hooks', 'chown' , checking if hooks exist, etc. but I really want to know how to be free of that fracking annoying start-up chime.

  12. @Dennis: Maybe you know somebody who has used the terminal before who can help you with this? You really need some basic knowledge, otherwise you can break your Mac while working as super-user (which you do when executing something with the prefix "sudo"). And you need to read the instructions very careful. There it is written that you must replace "/path/to" with an existing folder on your mac. You can create a folder "mute" in your home folder (not Documents) in Finder and then replace the "/path/to" with "/Users/YourUserName/mute". All without quotes and replace "YourUserName" with your user name. If you don't know your user name execute "whoami" in terminal.

  13. @some Dude: Maybe you didn't set the appropriate access rights? mine are:-rwxr-xr-x owner: rootgroup: wheelyou can check this in terminal with "ls -la" without quotes.You must create these files as root (with sudo).

  14. Dennis writes:@MerehThanks…I'll ask around. Unfortunately, in my circle I'm the one everyone comes to when they're having computer problems! I think the '/path/to/' part was the thing that was throwing me most- and I wanted to be very sure about it before entering that bit as a command-and the appearance of a new box I'd never seen before (despite having used Terminal to enter code I've copied from forums before) after entering 'sudo nano /path/to/mute-on.sh'. Next on my list is finding out how to get around the region coding on these new MBAs & their super drives.

  15. Anonymous writes:- root has to be the owner of the script files – running an editor from command line with sudo is the easiest way to achieve that (otherwise you need to chown)How do I do this?????? please give the code to paste in Terminal

  16. Anonymous writes:Thanks, this works.You must also make sure that the parent folder has the same permissions that Pereh outlined above, otherwise it won't work.

  17. Some Dude Replying writes:Mereh, could you write out the sudo commands you are describing as they would be entered in Terminal? I'm only comfortable working in Terminal with a good set of instructions. Sorry for the late response. Thanks for the help! I checked "ls -la" and saw a bunch of permissions but didn't really know what I was looking at or how to proceed. *****************************-rwxr-xr-xowner: rootgroup: wheelyou can check this in terminal with "ls -la" without quotes.You must create these files as root (with sudo).

  18. Some Dude writes:I followed the instructions above to the letter and did create the files with sudo, so I'm not sure why my permissions would be wrong. – But I did run "sudo chown root:wheel /Library/Scripts/mute-on.sh" and the same thing for "mute-off.sh" as suggested, and then re-added the hooks for muting (step 8), but still nothing. Did I execute those correctly? Any more ideas? :/

  19. Dennis writes:Hi again, Mereh.Sorry to bother you with this. I think I've followed the instructions correctly but I can't get past step 6.I placed a folder called 'mute' in my user folder so the path to that folder was /Users/MyName/muteI followed steps 1-5. When I entered "Control+X" to exit at steps 3 & 5 I heard an error beep so I had to close terminal to get back in again to follow the next step.When I checked the scripts that were written to the 'mute' folder using TextEdit I found their content was the same as the content entered at steps 3 & 5:"#!/bin/bashosascript -e 'set volume with output muted'"&"#!/bin/bashosascript -e 'set volume without output muted'"but the files were named "mute-on.sh.save" and "mute-off.sh.save".When I tried to do step 6 Terminal said "No such file or directory", I assume because of the ".save" prefixes. Do you have any advice? Cheers,Dennis

  20. Anonymous writes:P.S.You say "you can skip the unmuting loginhook (i.e. each logout will silence your machine), but I like it this way because I always have sound available exactly at the volume level I set last time".Does this mean that if I always want my Mac to start silently I shouldn't enter any of the "mute-off" instructions?Cheers, Dennis

  21. Hi Dennis..Steps 3&5, edit save: did you enter ctrl+x or cmd+x? its important that you use "ctrl". "you can skip the unmuting loginhook" means that your mac will be always muted when you start up, anyway what level the volume was set when you logged out. Yes you can ignore the mute-off stuff if that is OK for you.

  22. Dennis writes:Hi MerehThanks for getting back to me on this. I'm definitely using 'CTRL+X'. Happy to report that I got it to work by deleting '.save' from the file's prefix so it would be recognised by Terminal when I went through steps 6, 7 & 8.:)

  23. Dennis writes:D'oh!I said 'prefix' in my last post and in one before that when I should have said 'suffix'. So…the file was being created with the name 'mute-on.sh.save' but when I removed the '.save' suffix Terminal could recognise it when going through steps 6, 7 & 8.

  24. Dennis writes:Ah, so maybe if I'd confirmed with 'y' the '.save' suffix would have been unappended or wouldn't have been added in the first place and I could have proceeded with steps 6-8. Still, it's working now. Thanks a lot for this information & for helping answer my questions, Mereh. I'm keeping a copy to keep a copy of this webpage for reference.

  25. fuzzi writes:maybe because i installed startupsound.prefpane but i uninstalled it with rightklick in systempref. was that wrong?

  26. fuzzi writes:gone through step by step but didn't work on my mbp late 08. i've done a clean lion install.wondering because files own to root are executable and are correctly in login/out hooks…

  27. When I installed startupsound.prefpane on Lion it had no effect..anyway I could successfully mute it later with the instructions above..You can test the scripts by just executing them without hooks. This could help you to find the problem.sh mute-on.shor./mute-on.shInside the folder where you placed the scripts. Your sound should be muted after.

  28. Anonymous writes:Can you please post this on youtube. I'm such nube and I can't understand what the hell those instructions are saying….SorryPlease post it on the youtube so some of people like me big time nube can just watch and follow.thank you!

  29. Dennis writes:Hi again, Mereh.Thought you might be interested to know that on two occasions since installing the mute-on scripts I've heard the start up sound when starting the computer. First time I went through all the instructions again and reinstalled the script. Second time I noticed that Powerpoint and Word were open on starting up (because they were open at shutdown) so I tried to duplicate the result but it didn't work. That was a week ago. Haven't heard it since. Any ideas why it wouldn't always work?Cheers,Dennis

  30. For me it works very well. I am also using Word & Powerpoint (2011) almost every day. Do you use multiple user accounts on your Mac? Maybe thats the problem..? Just an idea.. Or maybe there are other "hooks" that cause conflict?@Anonymous user asking for youtube..anybody here who can do this? 😉

  31. Eric Stone writes:mereh, Acid First, thanks for this. It's not exactly what I was working on, but it's close enough that I got it done quickly!Everyone who is still lost – would it help if I created a script to do everything for you and a single line of code to copy/paste into the terminal to run it? If so, drop by and let me know at StoneAgeMods.wordpress.com

  32. AJ writes:Thanks, works great.Didn't work initially because you have to use abolute pathname to add the hooks (in my case /Users/home/aj/scripts/mute-on.sh, not just mute-on.sh), I tried relative pathnames, that did not work. 🙂

  33. Design Decisions writes:This worked great. All the downloads I'd tried failed on my iMac.It's odd that the much vaunted 'zen' clean design of Apple products doesn't extend to this awful Windows-like startup sound, jarring in the extreme!Presumably their psychologists have told them it helps lock in brand loyalty or some such nonsense.

  34. Anonymous writes:Has anyone got this to work on a 2011 iMac? startup.prefpane doesn't work, startup ninja doesn't work and I can't get this to work either…

  35. ljamm writes:I have already used loginhook to disable mac reopening windows when starting. Is there a way to get both tweaks working?Thanks.

  36. pyro writes:It didn't work for me (Late 2009 i7 iMac)I tested the scripts with sh /Library/Scripts/mute-on.sh and YES, it muted the output (I played a music in iTunes), but the startup sound is still present and with FULL volume. I don't understand. And if I manually mute the volume before restart – It didn't help at all.I fed up with this sound 🙂 I work sometimes at night and if I have to restart, everyone wakes up… 🙂

  37. Névtelen writes:It didn't work for me (Late 2009 i7 iMac)I tested the scripts with sh /Library/Scripts/mute-on.sh and YES, it muted the output (I played a music in iTunes), but the startup sound is still present and with FULL volume. I don't understand. And if I manually mute the volume before restart – It didn't help at all.I fed up with this sound 🙂 I work sometimes at night and if I have to restart, everyone wakes up… 🙂

  38. vic writes:Hi mereh,This worked great! But… it works when I have the headphones unplugged, do you know which hook I would have to add for it to work when something is plugged into the 3.5mm?Thanks,

  39. Originally posted by anonymous:

    Anonymous writes:Doesn't work for i7 Lion!

    I have have an i7 Macbook Pro with OS X Lion 10.7.3 an it works..

  40. Originally posted by anonymous:

    vic writes:Hi mereh,This worked great! But… it works when I have the headphones unplugged, do you know which hook I would have to add for it to work when something is plugged into the 3.5mm?Thanks,

    I experience the same problem: To have the startup sound muted, it is necessary to unplug the headphones before logging out or have them still plugged in when starting up..I tried to find a solution but didn't find any..I think you need some more google research and/or the help of someone who is experienced with applescript..

  41. Salvatore writes:Hello Mareh,Many thanks for the instructions! I succeeded in muting the obnoxious startup sound :o)I just have two issues: 1) I cannot un-mute anymore! not that this is important, but just to know if everything works perfectly…2) I must have sone something wrong, because now every time I open Terminal, I get-bash: /Users/Salvatore/.profile: line 1: unexpected EOF while looking for matching `"'-bash: /Users/Salvatore/.profile: line 4: syntax error: unexpected end of fileI know the .profile file is very important, and I hope I did not make a disaster somewhere!!Could you please help?Thank you so much,Salvatore

  42. Anonymous writes:Could you tell me how to modify the script to just turn the volume way down maybe to 20% instead of fully muting it?

  43. Anonymous writes:Figured it out, changed script to:osascript -e 'set Volume 3.5'now the startup sound is nice and quiet and still exsists incase I need it.

  44. Alexander writes:Hello,My problem is that I can't make those 2 files executablesudo chmod u+x /path/to/mute-on.shsudo chmod u+x /path/to/mute-off.shAfter these commands have been carried out, the files remain being just a plain text, so eventually nothing works and sound is on.I tried to save those files without .sh extension so it becomes executable but nothing works eventually as well.Could you tell me where I went wrong, please?

  45. Originally posted by anonymous:

    Alexander writes:Hello,My problem is that I can't make those 2 files executablesudo chmod u+x /path/to/mute-on.shsudo chmod u+x /path/to/mute-off.shAfter these commands have been carried out, the files remain being just a plain text, so eventually nothing works and sound is on.I tried to save those files without .sh extension so it becomes executable but nothing works eventually as well.Could you tell me where I went wrong, please?

    Hi Alexander, you must replace /path/to with an existing folder, its just a placeholder..

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.