We recently purchased a new MacMini Server which came with Lion Server pre-installed. You no longer receive media, as we know – Lion is a media-less release. So I hit a snag when I wanted to restore the MacMini back to a clean install – at work our internet connection goes through a proxy server – as per the Apple documentation, Lion Recovery HD (CMD+R) doesn’t support the use of Proxies!
Imagine my dismay! How could Apple not allow such a basic function?! Fear not, you are a few simple Terminal commands away from using the Lion Recovery HD feature from behind your proxy.
Fire up the machine holding down the Option key (or using CMD+R). Select your Lion Recovery HD and wait a few seconds. You will be presented with your restore options. If at this point you go ahead and select the Reinstall option, it will fail to contact the Apple Servers and suggest you contact Apple Care.
Nonsense I thought – I’m simply missing the proxy information on my connection to the internet! Only there’s no place you can enter the information via GUI. Even if you open up Safari, the Proxies button in Preferences > Advanced does nothing. I wasn’t prepared to accept that there was no way around this.
Open up Terminal and you can configure the proxy that way using ‘networksetup’. You can assign the proxy to whichever method you are using to connect to the internet (in this example I’m using the Wi-Fi connection):
networksetup -setautoproxyurl Wi-Fi http://your.proxy.url/proxy.pac
What do you know, it then works!
There are a host of other options you can use too. For example, if your enterprise does not use a proxy.pac then you can specify the web proxy alone. For example:
networksetup -setwebproxy Wi-Fi proxy.domain.url 80 off
This sets just the http proxy for the Wi-Fi connection. The proxy url and port number used, and sets the authentication as ‘off’ as our proxy doesn’t use authentication.
For all of the man pages, use:
man networksetup
To see all of the names used for the network service, use:
networksetup -listallnetworkservices



