Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Automatically start Internet Sharing via LaunchDaemon Network
In the past, people have submitted hints on how to get their Macs to start internet sharing automatically at boot. All of them are either editing files in hidden directories or creating a StartupItem to do the task. Most people may not want to edit files that are for the system, and Leopard and later versions of OS X use LaunchDaemons, not StartupItems to run scripts or executables at boot.

I created a LaunchDaemon plist based on the composition of the iStat Server's LaunchDaemon plist to run the InternetSharing executable automatically at boot. Here's what it looks like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Disabled</key>
	<false/>
	<key>GroupName</key>
	<string>wheel</string>
	<key>UserName</key>
	<string>root</string>
	<key>KeepAlive</key>
	<true/>
	<key>Label</key>
	<string>InternetSharing</string>
	<key>OnDemand</key>
	<false/>
	<key>Program</key>
	<string>/usr/libexec/InternetSharing</string>
	<key>RunAtLoad</key>
	<true/>
	<key>StartOnMount</key>
	<false/>
</dict>
</plist>
Save the above as net.tenseg.autointernetsharing.plist; alternatively, you can download the plist file (4KB) from my web site.

To install it, just copy the plist file into /Library/LaunchDaemons. The next time you reboot, the Internet Sharing option should already be turned on (once you're fully logged into a user account). The end result is identical to the older hints, but uses the new LaunchDaemon implementation rather than editing system files or installing a StartupItem.
    •    
  • Currently 2.70 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (10 votes cast)
 
[1,711 views]  

Automatically start Internet Sharing via LaunchDaemon | 9 comments | Create New Account
Click here to return to the 'Automatically start Internet Sharing via LaunchDaemon' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Automatically start Internet Sharing via LaunchDaemon
Authored by: club60.org on Wed, Nov 11 2009 at 8:34AM PST
Hm... What am I doing wrong? I just enable internet sharing in sharing preference pane and it stays enabled no matter how many times I restart my iMac.

[ Reply to This | # ]
Automatically start Internet Sharing via LaunchDaemon
Authored by: everkleer80 on Wed, Nov 11 2009 at 9:02AM PST
Then isn't the question what are you doing right? =D

I too am pretty sure that connection sharing has stayed on through a reboot for me, although I haven't used it in a while.

[ Reply to This | # ]
Automatically start Internet Sharing via LaunchDaemon
Authored by: leamanc on Wed, Nov 11 2009 at 9:29AM PST
Yeah, I have a 12" PowerBook G4 that I use regularly to share Internet to my Dell laptop running Ubuntu (the wireless card support was great in 8.10, dropped the connection a lot in 9.04, and now kernel-panics me in 9.10). I swear that the Internet Sharing preference sticks through reboot, although I'm not 100% sure. I usually just put the PowerBook to sleep. Will test later and post back the results.

[ Reply to This | # ]
Automatically start Internet Sharing via LaunchDaemon
Authored by: leamanc on Thu, Nov 12 2009 at 5:48PM PST
Tested with restart, and Internet Sharing persisted through the reboot.

PowerBook G4 12", 1.33 GHz, 1 GB RAM, 60 GB HDD, 10.5.8 with all the latest updates.

[ Reply to This | # ]
Automatically start Internet Sharing via LaunchDaemon
Authored by: Stormchild on Wed, Nov 11 2009 at 10:12AM PST
This "hint" makes no sense. Like all the other Sharing types, Internet Sharing can simply be turned on and left on. There should be no need to do anything to make it start at boot -- it already does that.

[ Reply to This | # ]
Automatically start Internet Sharing via LaunchDaemon
Authored by: hobbster on Wed, Nov 11 2009 at 2:51PM PST
Presumably, Internet Sharing should indeed remain enabled through restarts. But the reality is that for some people it doesn't. I've read a few reports of the issue, and I've experienced it intermittently (but often) for years on numerous G4 and G5 iMacs running Tiger and Leopard. Works properly on all my Intel iMacs though.

[ Reply to This | # ]
Automatically start Internet Sharing via LaunchDaemon
Authored by: ThomPatterson on Wed, Nov 11 2009 at 4:20PM PST
Internet Sharing does persist through reboot. However, after upgrading to Snow Leopard on my Mac Pro it's happened a few times where although the service is listed as "On", it wouldn't work until I turned it off and then on again.

[ Reply to This | # ]
Thank you
Authored by: Geobunny on Thu, Nov 12 2009 at 1:24AM PST
I've not managed to get Internet Sharing to persist across reboots since 10.4, so this hint is very welcome indeed! Thank you.

[ Reply to This | # ]
Automatically start Internet Sharing via LaunchDaemon
Authored by: Matti Niemelä on Sat, Nov 14 2009 at 4:34AM PST
No luck with 10.6.2 and Mac Mini e09.

Sharing wasn't persisted without or with this hint.

[ Reply to This | # ]