How Do I Get USB Tethering Working Between 15.10 and an Android Device?

13,184

Well, thanks bain for the start of the answer, you almost solved it :)

Doing exactly what you said, you still cannot surf nor do things like ping google.com, annoying.

BUT, everything looked ok (route, ifconfig, /etc/resolv.conf pointing to 127.0.1.1...). Just to be sure, I tried to ping a known ip from google (206.169.145.232), and it worked ! Damn it, I do not know why the DNS are b0rked too, but you can use the temporary workaround by editing /etc/resolv.conf, and replacing 127.0.1.1 by 8.8.8.8 (and even add a second line nameserver 8.8.4.4).

You are set and can surf the web again !

Now, it would be great if somebody could figure out why kubuntu 15.10 (which is also affected by this bug) cannot do that automatically, like before.

Enjoy.

Share:
13,184

Related videos on Youtube

CommonsWare
Author by

CommonsWare

Mark Murphy, founder of CommonsWare, writes a lot. Books From 2008 through 2021, Mark wrote a series of books on Android app development. These books are now available for free download from the CommonsWare site. His most recent books have been focused on second-generation Android app development (Kotlin and the Android Jetpack): Elements of Android Jetpack, a new introductory book on Android app development, focused on second-generation techniques. Exploring Android, a series of step-by-step tutorials for building an Android app from scratch. This book demonstrates app development using Kotlin, coroutines, and the Jetpack libraries. Elements of Android Room, to help you incorporate Google's reactive object wrapper around SQLite. Elements of Android R, to help you deal with the changes introduced by Android 11 (code-named "R"). It covers everything from scoped storage changes to data access auditing to sharing UIs between apps to bubbles. Elements of Kotlin, a guide to the Kotlin programming language, which is rapidly gaining in popularity for Android app development. Elements of Kotlin Coroutines, exploring Kotlin's new first-class reactive programming system. In the beginning, Android development was focused on Java and, partially, on the Android Support Library. Mark's earliest books share that focus: The Busy Coder's Guide to Android Development, the first and largest book on Android app programming Android's Architecture Components GraphQL and Android Things Other Than Books He runs the jetc.dev weekly newsletter for Jetpack Compose. Heck, he even has a blog. All code in Stack Overflow questions, answers, or comments written by Mark Murphy are hereby licensed under the Apache Software License 2.0, unless otherwise noted where that code appears on Stack Overflow.

Updated on September 18, 2022

Comments

  • CommonsWare
    CommonsWare over 1 year

    Environment: Ubuntu 15.10 on a Dell L502X

    I used to be able to use USB tethering between Ubuntu and an Android device without problems. Late last year, I applied a fresh install of Ubuntu (15.10) on the notebook. Now, with this combination, I cannot get USB tethering to work. I have tried a Nexus 4 (running Android 5.1, which used to work with the Ubuntu 15.04 that I used previously), a Nexus 5 (running Android 6.0.1), and a Nexus 5X (running Android 6.0.1).

    When I enable USB tethering, I get a new entry in ifconfig output:

    enx92c991095e89 Link encap:Ethernet  HWaddr 92:c9:91:09:5e:89  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:520 (520.0 B)  TX bytes:0 (0.0 B)
    

    Note that the hardware address changes with each tether, so turning USB tethering off, then back on, or switching to a different Nexus device, gives me a replacement entry:

    enx82fb7388a85c Link encap:Ethernet  HWaddr 82:fb:73:88:a8:5c  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:332 (332.0 B)  TX bytes:0 (0.0 B)
    

    I also get a corresponding Wired entry in the Network screen in System Settings, showing the hardware address matching the ifconfig stanza, and described as either "Disconnected" (for the current enabled USB tethering session) or "Unmanaged" (for a prior USB tethering session).

    Having GUFW enabled or disabled has no impact on the problem. Connecting directly or through a USB hub has no impact on the problem.

    My /etc/network/interfaces is standard:

    # interfaces(5) file used by ifup(8) and ifdown(8)
    auto lo
    iface lo inet loopback
    

    Is there anything else that I need to do on Ubuntu 15.10 to get Android USB tethering to work?

    UPDATE: Here are the logs requested by @bain:

    Jan 16 08:22:09 L502X kernel: [ 5377.812495] usb 1-1: new high-speed USB device number 3 using xhci_hcd
    Jan 16 08:22:09 L502X kernel: [ 5377.945753] usb 1-1: New USB device found, idVendor=18d1, idProduct=4ee2
    Jan 16 08:22:09 L502X kernel: [ 5377.945763] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Jan 16 08:22:09 L502X kernel: [ 5377.945768] usb 1-1: Product: Nexus 5X
    Jan 16 08:22:09 L502X kernel: [ 5377.945772] usb 1-1: Manufacturer: LGE
    Jan 16 08:22:09 L502X kernel: [ 5377.945776] usb 1-1: SerialNumber: 00f204f982a4b8b9
    Jan 16 08:22:10 L502X org.gtk.Private.GPhoto2VolumeMonitor[1780]: (process:2108): GVFS-GPhoto2-WARNING **: device (null) has no BUSNUM property, ignoring
    Jan 16 08:22:10 L502X kernel: [ 5378.080031] [UFW BLOCK] IN=enp6s0 OUT= MAC= SRC=fe80:0000:0000:0000:16fe:b5ff:febb:2732 DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=0 PROTO=UDP SPT=8612 DPT=8612 LEN=24 
    Jan 16 08:22:10 L502X kernel: [ 5378.080049] [UFW BLOCK] IN=enp6s0 OUT= MAC= SRC=fe80:0000:0000:0000:16fe:b5ff:febb:2732 DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=0 PROTO=UDP SPT=8612 DPT=8610 LEN=24 
    Jan 16 08:22:10 L502X kernel: [ 5378.090303] [UFW BLOCK] IN=enp6s0 OUT= MAC= SRC=fe80:0000:0000:0000:16fe:b5ff:febb:2732 DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=0 PROTO=UDP SPT=8612 DPT=8612 LEN=24 
    Jan 16 08:22:10 L502X kernel: [ 5378.090319] [UFW BLOCK] IN=enp6s0 OUT= MAC= SRC=fe80:0000:0000:0000:16fe:b5ff:febb:2732 DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=0 PROTO=UDP SPT=8612 DPT=8610 LEN=24 
    Jan 16 08:22:11 L502X org.gtk.Private.GPhoto2VolumeMonitor[1780]: (process:2108): GVFS-GPhoto2-WARNING **: device (null) has no BUSNUM property, ignoring
    Jan 16 08:22:11 L502X colord[1165]: (colord:1165): Cd-WARNING **: CdMain: failed to emit DeviceAdded: failed to register object: An object is already exported for the interface org.freedesktop.ColorManager.Device at /org/freedesktop/ColorManager/devices/sysfs__null_
    Jan 16 08:22:14 L502X colord-sane: io/hpmud/musb.c 2081: Invalid usb_open: Permission denied
    Jan 16 08:22:30 L502X kernel: [ 5398.876832] usb 1-1: USB disconnect, device number 3
    Jan 16 08:22:31 L502X kernel: [ 5399.213700] usb 1-1: new high-speed USB device number 4 using xhci_hcd
    Jan 16 08:22:31 L502X kernel: [ 5399.346845] usb 1-1: New USB device found, idVendor=18d1, idProduct=4ee4
    Jan 16 08:22:31 L502X kernel: [ 5399.346855] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Jan 16 08:22:31 L502X kernel: [ 5399.346860] usb 1-1: Product: Nexus 5X
    Jan 16 08:22:31 L502X kernel: [ 5399.346864] usb 1-1: Manufacturer: LGE
    Jan 16 08:22:31 L502X kernel: [ 5399.346868] usb 1-1: SerialNumber: 00f204f982a4b8b9
    Jan 16 08:22:31 L502X mtp-probe: checking bus 1, device 4: "/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb1/1-1"
    Jan 16 08:22:31 L502X mtp-probe: bus: 1, device: 4 was not an MTP device
    Jan 16 08:22:31 L502X kernel: [ 5399.385223] usbcore: registered new interface driver cdc_ether
    Jan 16 08:22:31 L502X kernel: [ 5399.392871] rndis_host 1-1:1.0 usb0: register 'rndis_host' at usb-0000:04:00.0-1, RNDIS device, 9a:ff:bd:ee:76:ea
    Jan 16 08:22:31 L502X kernel: [ 5399.392918] usbcore: registered new interface driver rndis_host
    Jan 16 08:22:31 L502X NetworkManager[1070]: <warn>  (usb0): failed to find device 4 'usb0' with udev
    Jan 16 08:22:31 L502X NetworkManager[1070]: <info>  (usb0): new Ethernet device (carrier: OFF, driver: 'rndis_host', ifindex: 4)
    Jan 16 08:22:31 L502X kernel: [ 5399.398467] rndis_host 1-1:1.0 enx9affbdee76ea: renamed from usb0
    Jan 16 08:22:31 L502X NetworkManager[1070]: <info>  (usb0): interface index 4 renamed iface from 'usb0' to 'enx9affbdee76ea'
    Jan 16 08:22:31 L502X NetworkManager[1070]: <info>  devices added (path: /sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb1/1-1/1-1:1.0/net/enx9affbdee76ea, iface: enx9affbdee76ea)
    Jan 16 08:22:31 L502X NetworkManager[1070]: <info>  device added (path: /sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb1/1-1/1-1:1.0/net/enx9affbdee76ea, iface: enx9affbdee76ea): no ifupdown configuration found.
    Jan 16 08:22:31 L502X NetworkManager[1070]: <info>  (enx9affbdee76ea): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
    Jan 16 08:22:31 L502X kernel: [ 5399.442941] IPv6: ADDRCONF(NETDEV_UP): enx9affbdee76ea: link is not ready
    Jan 16 08:22:31 L502X NetworkManager[1070]: <info>  (enx9affbdee76ea): link connected
    Jan 16 08:22:31 L502X NetworkManager[1070]: <info>  (enx9affbdee76ea): device state change: unavailable -> disconnected (reason 'none') [20 30 0]
    Jan 16 08:22:31 L502X NetworkManager[1070]: <info>  Device 'enx9affbdee76ea' has no connection; scheduling activate_check in 0 seconds.
    Jan 16 08:22:31 L502X kernel: [ 5399.458876] [UFW BLOCK] IN=enp6s0 OUT= MAC= SRC=fe80:0000:0000:0000:16fe:b5ff:febb:2732 DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=0 PROTO=UDP SPT=8612 DPT=8612 LEN=24 
    Jan 16 08:22:31 L502X kernel: [ 5399.458904] [UFW BLOCK] IN=enp6s0 OUT= MAC= SRC=fe80:0000:0000:0000:16fe:b5ff:febb:2732 DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=0 PROTO=UDP SPT=8612 DPT=8610 LEN=24 
    Jan 16 08:22:31 L502X kernel: [ 5399.469062] [UFW BLOCK] IN=enp6s0 OUT= MAC= SRC=fe80:0000:0000:0000:16fe:b5ff:febb:2732 DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=0 PROTO=UDP SPT=8612 DPT=8612 LEN=24 
    Jan 16 08:22:31 L502X kernel: [ 5399.469088] [UFW BLOCK] IN=enp6s0 OUT= MAC= SRC=fe80:0000:0000:0000:16fe:b5ff:febb:2732 DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=0 PROTO=UDP SPT=8612 DPT=8610 LEN=24 
    Jan 16 08:22:33 L502X ModemManager[1081]: <info>  Couldn't find support for device at '/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb1/1-1': not supported by any plugin
    Jan 16 08:22:35 L502X colord-sane: io/hpmud/musb.c 2081: Invalid usb_open: Permission denied
    

    UPDATE #2: Fresh syslog, after disabling the firewall via GUFW:

    Jan 16 09:33:23 L502X kernel: [ 9649.766835] usb 1-1: new high-speed USB device number 6 using xhci_hcd
    Jan 16 09:33:23 L502X kernel: [ 9649.900519] usb 1-1: New USB device found, idVendor=18d1, idProduct=4ee2
    Jan 16 09:33:23 L502X kernel: [ 9649.900529] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Jan 16 09:33:23 L502X kernel: [ 9649.900534] usb 1-1: Product: Nexus 5X
    Jan 16 09:33:23 L502X kernel: [ 9649.900538] usb 1-1: Manufacturer: LGE
    Jan 16 09:33:23 L502X kernel: [ 9649.900542] usb 1-1: SerialNumber: 00f204f982a4b8b9
    Jan 16 09:33:23 L502X org.gtk.Private.GPhoto2VolumeMonitor[1780]: (process:2108): GVFS-GPhoto2-WARNING **: device (null) has no BUSNUM property, ignoring
    Jan 16 09:33:24 L502X org.gtk.Private.GPhoto2VolumeMonitor[1780]: (process:2108): GVFS-GPhoto2-WARNING **: device (null) has no BUSNUM property, ignoring
    Jan 16 09:33:24 L502X colord[1165]: (colord:1165): Cd-WARNING **: CdMain: failed to emit DeviceAdded: failed to register object: An object is already exported for the interface org.freedesktop.ColorManager.Device at /org/freedesktop/ColorManager/devices/sysfs__null_
    Jan 16 09:33:26 L502X kernel: [ 9652.898664] usb 1-1: USB disconnect, device number 6
    Jan 16 09:33:26 L502X kernel: [ 9653.233755] usb 1-1: new high-speed USB device number 7 using xhci_hcd
    Jan 16 09:33:26 L502X kernel: [ 9653.367239] usb 1-1: New USB device found, idVendor=18d1, idProduct=4ee4
    Jan 16 09:33:26 L502X kernel: [ 9653.367249] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Jan 16 09:33:26 L502X kernel: [ 9653.367254] usb 1-1: Product: Nexus 5X
    Jan 16 09:33:26 L502X kernel: [ 9653.367258] usb 1-1: Manufacturer: LGE
    Jan 16 09:33:26 L502X kernel: [ 9653.367262] usb 1-1: SerialNumber: 00f204f982a4b8b9
    Jan 16 09:33:26 L502X kernel: [ 9653.375259] rndis_host 1-1:1.0 usb0: register 'rndis_host' at usb-0000:04:00.0-1, RNDIS device, 4e:8a:8f:3f:b7:cb
    Jan 16 09:33:26 L502X NetworkManager[1070]: <warn>  (usb0): failed to find device 5 'usb0' with udev
    Jan 16 09:33:26 L502X NetworkManager[1070]: <info>  (usb0): new Ethernet device (carrier: OFF, driver: 'rndis_host', ifindex: 5)
    Jan 16 09:33:26 L502X mtp-probe: checking bus 1, device 7: "/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb1/1-1"
    Jan 16 09:33:26 L502X mtp-probe: bus: 1, device: 7 was not an MTP device
    Jan 16 09:33:26 L502X kernel: [ 9653.420245] rndis_host 1-1:1.0 enx4e8a8f3fb7cb: renamed from usb0
    Jan 16 09:33:26 L502X NetworkManager[1070]: <info>  (usb0): interface index 5 renamed iface from 'usb0' to 'enx4e8a8f3fb7cb'
    Jan 16 09:33:26 L502X NetworkManager[1070]: <info>  devices added (path: /sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb1/1-1/1-1:1.0/net/enx4e8a8f3fb7cb, iface: enx4e8a8f3fb7cb)
    Jan 16 09:33:26 L502X NetworkManager[1070]: <info>  device added (path: /sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb1/1-1/1-1:1.0/net/enx4e8a8f3fb7cb, iface: enx4e8a8f3fb7cb): no ifupdown configuration found.
    Jan 16 09:33:26 L502X NetworkManager[1070]: <info>  (enx4e8a8f3fb7cb): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
    Jan 16 09:33:26 L502X NetworkManager[1070]: <info>  (enx4e8a8f3fb7cb): link connected
    Jan 16 09:33:26 L502X kernel: [ 9653.447746] IPv6: ADDRCONF(NETDEV_UP): enx4e8a8f3fb7cb: link is not ready
    Jan 16 09:33:26 L502X NetworkManager[1070]: <info>  (enx4e8a8f3fb7cb): device state change: unavailable -> disconnected (reason 'none') [20 30 0]
    Jan 16 09:33:26 L502X NetworkManager[1070]: <info>  Device 'enx4e8a8f3fb7cb' has no connection; scheduling activate_check in 0 seconds.
    Jan 16 09:33:27 L502X colord-sane: io/hpmud/musb.c 2081: Invalid usb_open: Permission denied
    Jan 16 09:33:28 L502X ModemManager[1081]: <info>  Couldn't find support for device at '/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb1/1-1': not supported by any plugin
    

    UPDATE #3: route -n with USB tethering enabled, after sudo dhclient ...:

    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 enx16d44e6a2773
    192.168.42.0    0.0.0.0         255.255.255.0   U     0      0        0 enx16d44e6a2773
    
    • bain
      bain over 8 years
      Network device is up and received some packets. Is there anything relevant in NetworkManager logs or syslog? Suggest downloading 15.04 iso, boot and verify tether works (you don't need to install, just test the desktop), then try same again with 15.10 iso. Compare the logs. You might have hit a bug.
    • bain
      bain over 8 years
      syslog is fine but I don't see any obvious errors. You could try shutting down NetworkManager then add the device to /etc/network/interfaces and ifup it. That should verify that the device is functional at least.
    • bain
      bain over 8 years
      [UFW BLOCK] - maybe you have ufw installed and are blocking packets from the phone? Try sudo ufw disable and plug the phone in again.
    • CommonsWare
      CommonsWare over 8 years
      @bain: "maybe you have ufw installed and are blocking packets from the phone?" -- I did for that first syslog, my apologies. An updated syslog is in the question. "You could try shutting down NetworkManager then add the device to /etc/network/interfaces and ifup it" -- that's beyond what I am in position to test right now, sorry.
    • bain
      bain over 8 years
      Try dhclient enx9affbdee76ea (or whatever the device is appearing as)
    • CommonsWare
      CommonsWare over 8 years
      @bain: OK, sudo dhclient ... gave me an IP address through tethering, and ifconfig shows traffic passing. However, ping and traceroute give me "Network is unreachable", for any IP address that I try, and Web browsers can't connect. Network Manager shows the connection as "Manual" (not DHCP) and has a gateway of 0.0.0.0 in the "IPv4 Settings"
    • bain
      bain over 8 years
      Is a default route set (route -n)? Can you ping the gateway IP?
    • CommonsWare
      CommonsWare over 8 years
      @bain: I added the route -n output above. The gateway IP is 0.0.0.0; attempts to ping it work but actually ping 127.0.0.1.
    • bain
      bain over 8 years
      Default route is missing. Two ideas. 1. systemctl stop NetworkManager; dhclient -d enx.. look for DHCPACK from 1.2.3.4 for IP 2. cat /var/lib/dhcp/dhclient.leases` - check for line option routers IP. Then add default route with route add default gw $IP I suspect for Android it might be route add default gw 192.168.42.129.
  • Ash
    Ash about 8 years
    Just had the same issue on a Dell Inspiron 15 with Kubuntu 15.10. For whatever reason I had to open the network connection editor and add a new wired connection. Everything worked after that.
  • Chai T. Rex
    Chai T. Rex over 6 years
    Why would it be the Android device when the Android device provided Internet just fine with a previous version of Ubuntu?
  • mmalzahrani
    mmalzahrani over 6 years
    I faced same problem on Windows 7 and I solved with same way.