January 10, 2010 · General, Networking · Email This Post

Sponsored Link
If you're like me you have an iPhone and a portable computer running Ubuntu and you would like to have mobile internet without paying for an extra data plan from your carrier. Thanks to a few devoted individuals tethering the iPhone to Ubuntu is simple. The only prerequisite is that you must have an iPhone 3G or 3GS running OS 3.0 or higher. If you're running 3.0 then you can do this without jail breaking your phone by installing a modified carrier profile. However, if you're on OS 3.1+ then you will need to jail break your phone to install the modified carrier profile.

This tutorial is written for those who are not familiar with Ubuntu/Linux and is very detailed. If you are experienced feel free to just grab what you need from it.

Update: I've updated the tutorial to fix some errors that came up due to a change in the libiphone package.

Update (1/27/10): I've updated the tutorial with a new PPA and set of packages needed for tethering via USB to work. This should iron out all other problems with the tutorial.

Tethering the iPhone via Bluetooth is as simple as pairing the two devices and ensuring that Internet Tethering is turned on on your iPhone. To pair the devices you will need to install a new Bluetooth manager aptly named "blueman" from the Blueman Project PPA repository. To do this you will need to execute the following commands in a new Terminal window:

sudo add-apt-repository ppa:blueman/ppa
sudo apt-get update

After it finishes updating your repositories you can install Blueman by executing

sudo apt-get install blueman

Once everything stops working and you're back at a blank command prompt you can then close Terminal and open the "Bluetooth Manager" which can be found in the "System>Preferences" menu. (Note: A reboot may be needed for it to open) To pair the devices you will need to turn on Bluetooh on your iPhone and computer. To turn it on on your iPhone open the Settings application from your springboard, when the settings screen appears press the "General" button near the bottom, from here press the "Bluetooth" button, and then press the switch to turn it on. Once on you should see a list of devices as well as a message near the bottom saying that it is "Now Discoverable". In the "Bluetooth Manager" program press the "search" button and the list should be populated with nearby discoverable Bluetooth devices. Locate your iPhone 3G(S) from the list, select it, and press the "Keys" (pair) button above it. At this time Bluetooth Manager will attempt to pair the two devices. On both the iPhone and your computer you should see a prompt asking you if you want to pair the two. Press "Pair" on your iPhone and "Yes" on your computer. Once paired, press the diamond on Bluetooth Manager to trust your iPhone.

Now that everything is set up, you can go back into the "General" tab on your iPhone's settings and select "Network"  near the bottom you should see "Internet Tethering" (if you don't then you need to install the proper carrier profile to enable it) press on it and turn it on. Lastly, go back to the Bluetooth Manager program on your computer, right click on your iPhone and select "Network Access Point" from the option "Connect to:" it will work and hopefully give you a "Connection Established" message. Your iPhone should now have a blue banner with "Internet Tethering" on it. If all went well, you should now be able to access the internet through your iPhone's data connection.

Thanks to Sergey Stadnik Bluetooth tethering on 10.4 (Lucid) now works. According to him: "... right-click on the Blueman icon, select Plugins. Enable NMPANSupport plugin, press Ok."

Tether via USB:

Tethering your iPhone via USB uses a iPhone Ethernet driver written by Diego Giagio. Paul McEnery has set up a PPA repository with the driver and it's dependencies so there is no longer the need to compile both ‘libiphone' and ‘ipheth'. The first step is to add the PPA repository to your Synaptic repositories. To do so, open a new Terminal window and execute the following command:

sudo add-apt-repository ppa:pmcenery/ppa
sudo apt-get update

Once it finishes updating you can continue by downloading and installing the driver and the needed dependency:

sudo apt-get install gvfs ipheth-utils

When it finishes plug in your iPhone via USB, if internet tethering is enabled you should see a new interface pop up and a blue banner on your iPhone along with a dialog on your computer notifying you about a new ethernet connect. If not, check to see if tethering is enabled by opening the Settings application on your iPhone and navigating to "General>Network", near the bottom you should see "Internet Tethering" (if you don't then you will need to download and install the proper carrier profile) press on it and turn it on. Open up a browser and enjoy your mobile internet.

Hopefully, you ran into no errors with this tutorial. If you did let me know, or let me know if you ran into any error with anything else pertaining to it.

 

Incoming search terms:

Related posts

175 Comments to “iPhone Tethering on Ubuntu 9.10 (Karmic)”

  1. LonelyTV says:

    Doug: I found that starting fresh fixed my issue. Delete the libiphone directory, as well as removing anything “iphone” related in Synaptic. Essentially, search for “iphone” and then remove everything that is installed. After that download a fresh copy of libiphone and the packages needed and try again.

    [Reply]

  2. Doug Saylor says:

    SUCCESS! Thanks for all the effort made to get this right. I’m now able to hook up via USB or Bluetooth.

    [Reply]

  3. Dimitar says:

    Tried the new updated tutorial. This is what I get in the step right before last one.

    root@dimitar-laptop:/home/dimitar/ipheth/ipheth-driver# sudo make installmake -C /lib/modules/2.6.31-16-generic/build M= modules_install
    make[1]: Entering directory `/usr/src/linux-headers-2.6.31-16-generic’
    cp: cannot stat `/usr/src/linux-headers-2.6.31-16-generic/modules.order’: No such file or directory
    make[1]: *** [_modinst_] Error 1
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-16-generic’
    make: *** [install] Error 2

    *&*&*&*&*&*
    Now the network wizard is trying to connect via iphone eth2 but it drops the trying in few seconds. I can tether on windows with no problem. I dont have carrier limitations.

    [Reply]

  4. Eduardo Garcia-Prieto says:

    Using Ubuntu 9.10 Netbook Remix I get the following error right after the last make:

    eduardo@EGP-HP-Mini:~/ipheth/ipheth-pair$ make
    gcc -Wall -O2 ipheth-pair.c -o ipheth-pair -liphone
    ipheth-pair.c: In function ‘main’:
    ipheth-pair.c:84: error: too few arguments to function ‘lockdownd_client_new’
    ipheth-pair.c:105: error: too few arguments to function ‘lockdownd_client_new’
    ipheth-pair.c:115: warning: passing argument 2 of ‘lockdownd_pair’ from incompatible pointer type
    /usr/local/include/libiphone/lockdown.h:81: note: expected ‘lockdownd_pair_record_t’ but argument is of type ‘char *’
    ipheth-pair.c:123: warning: passing argument 2 of ‘lockdownd_validate_pair’ from incompatible pointer type
    /usr/local/include/libiphone/lockdown.h:82: note: expected ‘lockdownd_pair_record_t’ but argument is of type ‘char *’
    make: *** [all] Error 1

    [Reply]

  5. LonelyTV says:

    Eduardo Garcia-Prieto: This error is due to a change in the libiphone package. The library was updated and broke the compile of ipheth. I’ve written an e-mail to Diego, the author of ipheth, calling attention to the change. Hopefully he will fix it.

    [Reply]

  6. Dimitar says:

    @LonelyTV Sorry to spam, but I got the tethering to work and now I cant get any usb device except the iphone on usb. Any device, any port.
    Mouse, flash drive, bluetooth, webcam. Nothing.
    They work fine on the virtual machine (XP, as guest). Do you have any Idea how to fix the problem?

    [Reply]

  7. Jim says:

    When I make in ipeth-pair, the make fails as it says there are too few arguments in function lockdown_client_new

    [Reply]

  8. Eduardo Garcia-Prieto says:

    Jim: That seems to be the same issue that I have.

    LonelyTV: any news?

    [Reply]

  9. LonelyTV says:

    Sadly, No new news. The author has yet to write me and I lost the old iPhone libraries before the update. If anyone has successfully compiled libiphone and still has the folder with the source please let me know. Thanks.

    [Reply]

  10. LonelyTV says:

    Eduardo & Jim: Just wanted to let you two know that I have updated the tutorial with a new link to the libiphone archive that will allow ipheth to compile correctly. I still have no heard back from ipheth’s author, but for the time being this older commit of libiphone should work.

    [Reply]

  11. Diego says:

    I have the same problem as Eduardo after updated

    [Reply]

  12. Doug Saylor says:

    Success! Thank you again!

    [Reply]

  13. LonelyTV says:

    Diego: I’m updated the tutorial AGAIN. It now works, and hopefully this edit will be the last for a while.

    [Reply]

  14. Diego says:

    After restart, now I cant use the mouse…
    What can I do?
    How can Uninstall all? If is posible

    [Reply]

  15. Doug Saylor says:

    OY! I lost all access to the internet, TWICE. The 1st time I didn’t think it had to do with tethering via USB, but it was the only change I made after doing a fresh install. Now it happened again.

    [Reply]

  16. Doug Saylor says:

    Trying to get Bluetooth working… hitting the “keys” icon yields a request for a password. WHAT password? About ready to give up! (Shit like this is why ultimately, MS & Mac rule)

    [Reply]

  17. William Sutton says:

    For what its worth, the first github clone command is spelled wrong and is case sensitive. it should be “git clone git://github.com/MattColyer/libiphone.git”

    Also, this is amazing how fast workarounds have been coming through. Im on a conference for school and not having internet other than over the iphone has been killing me.

    [Reply]

  18. William Sutton says:

    Also, for some reason I am still getting the same error as far as the compilation goes. :/

    [Reply]

  19. Paul McEnery says:

    This patch should fix the compilation issue with libiphone 0.9.6

    ====================================
    — a/ipheth-pair/ipheth-pair.c
    +++ b/ipheth-pair/ipheth-pair.c
    @@ -81,7 +81,7 @@
    char *device_name = NULL;
    rv = iphone_device_new(&device, devices[i]);
    if (rv == 0) {
    - rv = lockdownd_client_new(device, &client);
    + rv = lockdownd_client_new(device, &client, “ipheth-pair”);
    if (rv == 0) {
    rv = lockdownd_get_device_name(client, &device_name);
    lockdownd_client_free(client);
    @@ -102,7 +102,7 @@
    fprintf(stderr, “%s: cannot get %s device\n”, argv[0], uuid ? uuid : “default”);
    return -1;
    }
    - rv = lockdownd_client_new(device, &client);
    + rv = lockdownd_client_new(device, &client, “ipheth-pair”);
    if (rv) {
    fprintf(stderr, “%s: cannot get lockdown\n”, argv[0]);
    iphone_device_free(device);
    ====================================

    I’ve submitted it to the author already, and binaries for karmic are in my ppa:

    https://launchpad.net/~pmcenery/+archive/ppa

    [Reply]

  20. mr communicative says:

    how do we apply that patch? I’ve added your repos and it tells me that the packages don’t exist. Am I missing something?

    [Reply]

  21. mr communicative says:

    Nevermind they’re awaiting building. Will it now work with USB?

    [Reply]

  22. Eduardo Garcia-Prieto says:

    Well I did get the iPhone tethering on USB to work, but sadly my WIFI adapter stopped working after a reboot.

    Pardon my ignorance here, I am a Linux noob… but how do I uninstall the iphone tethering driver?

    [Reply]

  23. madcap says:

    Eduardo, did you compile from source or did you download the deb binaries?

    Also, the binary debs won’t install on my system. Anyone else having this problem?

    [Reply]

  24. Eduardo Garcia-Prieto says:

    madcap,

    I compiled from source code as per the earlier revision of the tutorial. I will try the new tutorial (once I reinstall Ubuntu) and post the results.

    [Reply]

  25. Trhusty says:

    LonelyTV: according to your howto I got the connection between the iPhone and Ubuntu out 9:10. Via Bluetooh. Too bad that the USB connection does not go.
    Now I have posted a link to your howto in a german board.
    http://forum.ubuntuusers.de/topic/iphone-tethering-hilfe/
    I want to ask if this is okay?

    [Reply]

  26. Paul McEnery says:

    Not that I would like to detract in any way from the article, as it gives insight into what is required to compile this stuff…

    A standard installation of Ubuntu karmic with my PPA enabled (plus and apt-get update && apt-get dist-upgrade), should pull in the following packages from the repository (including their deps):

    * libiphone-0.9.6 (with patches to fix some bugs)
    * libgpod (with patches for 3.x firmware)
    * ipheth – with DKMS dynamic compiling module

    I will admit its not extensively tested, but Its what I run on my own laptop. I dont tend to do source compiles, as they are quite messy.

    Regards,
    Paul.

    https://launchpad.net/~pmcenery/+archive/ppa

    [Reply]

  27. Paul McEnery says:

    Sorry.

    ipheth-utils will need to manually be apt-get installed.

    And gvfs is also automatically upgraded with the rest.

    Paul.

    [Reply]

  28. Ultner says:

    I have a problem with the package, the error is always
    E: Konnte Paket ipheth nicht finden
    (Cannot find the package ipheth)

    thank you for some advices!!

    [Reply]

  29. alimac says:

    hey, nice utility, have it working fine over bluetooth but for some reason the usb port is not forcing the phone to start tethering. phone works fine if i plug it into my mac.

    any guesses?

    cheers

    al

    [Reply]

  30. alimac says:

    ignore that. i just had to update libiphone and libgpod.

    all working fine now.

    cheers

    al

    [Reply]

Leave a Reply