Ask / Submit

Internet connection through USB

asked 2015-10-06 00:44:48 +0200

simoej gravatar image

I have recently updated to version and since then I cannot connect to internet through USB any more. I was used to connect as explained in

The problem is that now, when executing /usr/lib/connman/tools/connmanctl services, it cannot found the usb gadget (only the cellular is found). I have checked and the usb interface is not in the blacklist. On my PC (Ubuntu) nothing has changed (no upgrades, etc.), firewall is disabled and the file /etc/network/interfaces is modified as explained in the previous link.

Does anyone have a clue about what has been changed with the last update? Thanks

edit retag flag offensive close delete


I had the same problem and the normally route command like in the issue explaned are working. And on my phone it's the file /etc/connman/main.conf that is modified. I tried to modify the file like in the issue explaned, but it doesn't works.

yajo ( 2015-11-17 18:04:20 +0200 )edit

I have version and it doesn't work. I downloaded the latest version of the connman via the command 'devel-su git clone git:// connman' I tried to installed it and after a while, I was successful. I removed the actually connman via 'devel-su pkcon remove connman'. Then I installed it again, because it worked not good. I have to start the connman-service manual and he breaks often, so i renamed the connman.service into net.connman.service. I did the same with the vpn-service file. After this I did the command 'devel-su pkcon install connman'. So I have now two versions of connman parallel. I can start this one, who supports usb and bluetooth-tethering with 'devel-su systemctl start net.connman.service'. You have to configure it manually via 'connmanctl'. Sometimes I get an error and I have to start the connman again. The connman from Jolla works normally. If you try to do that, be careful. You can damage your complete Network-manager, so you have no possibility to connect to the Internet.

yajo ( 2016-01-16 15:27:26 +0200 )edit

@yajo thanks for the informations, compiling latest connman manually was the only solution to share the ethernet connection from my pc to my phone via USB for the mobile mail app. However I recommend using the latest release from instead of the latest Git version to avoid bugs. I also don't recommend removing the original connman version since it was unnecessary for me and it could uninstall several system applications as dependencies.

Any idea why USB is not supported in the original version even if USB is not blacklisted in /etc/connman/main.conf? With latest Sailfish OS version, /usr/lib/connman/tools/connmanctl does not exist anymore and pkcon install connman-tools says "Fatal error: connman-tools-1.24+git106-1.20.1.armv7hl requires connman = 1.24+git106-1.20.1, but this requirement cannot be provided", do you know why? Hopefully I still have the self-compiled version of connmanctl.

baptx ( 2018-01-03 15:50:31 +0200 )edit

@yajo did you manage to get an Internet connection from your computer USB connection that is working with the Aptoide Android store? I tried this solution but the Android app still says "no network connection" when I try to click on an featured app to see a description that was not previously cached:

baptx ( 2018-11-21 14:45:34 +0200 )edit

I'm sorry. I don't use it any more. I just tried to install the latest version now, but I could not figure out, how it works. If I remember correct, there was an android app to simulate an existing wifi connection. But I'm not quite sue how well this worked.

yajo ( 2018-11-21 16:39:40 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-08-07 14:15:02 +0200

baptx gravatar image

I still wonder why USB is not supported in the original connman version and we have to use a self-compiled version of connman.

Here is a reminder script ( based on previous answers that I created some times ago to share my Linux desktop Internet connection (connected with an Ethernet cable) to my Jolla smartphone (connected with an USB cable), it may be useful for others:

# ON laptop (tun0 instead of eth0 or eth1 for VPN):
#sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
#sudo iptables -t nat -A POSTROUTING -o tun0 -s -j MASQUERADE

# stop default connman without USB support and start self-compiled version
#sudo systemctl stop connman.service
#sudo systemctl start net.connman.service

# not needed with connman
#/sbin/route add default gw
#sudo sh -c 'echo "nameserver
#nameserver" > /etc/resolv.conf'

gadget=`$ctl services | grep gadget | cut -b 26- | tail -1`

# if mobile network is disabled by default in self-compiled version
#$ctl enable cellular

$ctl config $gadget --ipv4 manual --nameservers
$ctl connect $gadget

Note: for the initial setup, you first have to read the comments and do some commands manually to share Internet connection of your desktop computer and start the self-compiled connman version. Then, the script can be run directly with a command like "./" when you disconnect and reconnect the USB cable.

edit flag offensive delete publish link more



Is a recompiled connman still required on Sailfish OS 3? I cannot see "gadget" in my connman services results... I am now on an Xperia XZ, SF

One additional question : has anyone used it successfully on SF3 ? I wonder whether the iptables settings on need some tweaking. I have not yet analyzed them but failed to make the connection working the way I used to on SF 2.

Regards Dominique

ddelamarre ( 2019-01-24 18:50:07 +0200 )edit

@ddelamarre hi, yes a recompiled version of connman was still required the last time I tested with Sailfish OS 3 and it worked when I tested with the reminder script above (you should follow the comments of the script also). For information, the net.connman.service systemd service does not exist by default, you have to copy /lib/systemd/system/connman.service and rename it to something else like net.connman.service in /lib/systemd/system/, then you can edit the file to change the ExecStart path below [Service] to the recompiled version of connman, it will be something like ExecStart=/usr/local/sbin/connman -n --nobacktrace. I commented everything else since it was not needed.

baptx ( 2019-01-25 13:40:10 +0200 )edit
Login/Signup to Answer

Question tools



Asked: 2015-10-06 00:44:48 +0200

Seen: 1,235 times

Last updated: Aug 07 '18