Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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.54 / 5
  You rated: 3 / 5 (24 votes cast)
 
[9,948 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 whoever posted them. This site is not responsible for what they say.
Automatically start Internet Sharing via LaunchDaemon
Authored by: club60.org on Nov 11, '09 08:34:16AM

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 Nov 11, '09 09:02:07AM

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 Nov 11, '09 09:29:59AM

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 Nov 12, '09 05:48:33PM

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 Nov 11, '09 10:12:49AM

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 Nov 11, '09 02:51:53PM

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 Nov 11, '09 04:20:12PM

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 Nov 12, '09 01:24:43AM

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 Nov 14, '09 04:34:48AM

No luck with 10.6.2 and Mac Mini e09.

Sharing wasn't persisted without or with this hint.



[ Reply to This | # ]