I gave a lightning talk at the Ubuntu Vancouver Local Committee July 9, 2009 on accessing the Internet from an Ubuntu computer through the iPhone.
- Use the instructions from the Ubuntu forums here. This other page gives the underlying commands used by the script from the Ubuntu forum. You may find it helpful if the script doesn't work for you.
- During installation, when you're asked to make the iPhone discoverable, go to Settings-> General-> Bluetooth and turn on Bluetooth.
- Part way through the instructions in the Ubuntu forum you're asked to "pair" your iPhone with the computer. To "pair" your iPhone with your computer:
- Click on the blue icon with white triangles that you'll find amount the other notification icons, typically in the upper-right corner of your screen.
- Select "Set up new device..."
- Click "Forward".
- Wait for your iPhone to appear in the list. If it doesn't, go back to Settings-> General-> Bluetooth on the iPhone and make sure Bluetooth is on. Also, make sure your iPhone is less than a 1/2 metre from your computer.
- Select your iPhone in the list and click "Forward".
- Ubuntu will show you a four-digit code and ask you to enter it on the device. The iPhone will have a keypad showing. Enter the code.
- Ubuntu will ask if you want to allow the connection. Select "Always allow" and click "OK".
- You're now paired.
- Before trying to tether your computer to the iPhone, go back to Settings-> General-> Bluetooth. Your computer's name with "-0" appended should appear below the on/off button. If it says "Not connected" beside your computer's name, click on the computer name and wait for it to change to "Connected".
- Using Network Manager, turn off other network connections you may have running before tethering.
- Finally, before running the script, don't forget to turn on Internet Tethering on the iPhone. Go to Settings-> General-> Network-> Internet Tethering and turn Internet Tethering on.
- Keep the iPhone with 1/2 metre of your computer. (You can try more, but I suspect that the flaky connection I sometimes experience may be associated with the distance between the phone and the computer.)
- After running the script, you still won't be able to browse the Internet. (You don't have any usable DNS servers defined on your computer.) Do the following in a terminal:
sudo cat >>/etc/resolv.conf <<-END nameserver 18.104.22.168 nameserver 22.214.171.124 END
- I put the above in my uit.sh script at the appropriate place.
- Remember to turn off Internet Tethering and Bluetooth on the iPhone when you're done.
- Disconnect tethering on your computer by running: sudo ./uit.sh -d
- Don't forget to reconnect your computer to your usual networks after you turn off tethering.
- My experience is that you have to do everything in exactly the right order. If something goes wrong, do the following and then start over:
- On the iPhone, go to Settings-> General-> Network-> Internet Tethering and turn Internet Tethering off.
- On the iPhone, go to Settings-> General-> Network-> Bluetooth and turn Bluetooth off
- On your computer, run the disconnect script: sudo ./uit.sh -d
- On your computer, restart Bluetooth: sudo /etc/init.d/bluetooth restart
- The Bluetooth connection seems to be unreliable. Sometimes I can browse a page or two and then it stops working. Sometimes it just doesn't connect at all. After two or three tries I usually get a reliable connection. Every time it fails, be sure to do all the steps in the above list.