How do I share an internet connection through USB?
Solution 1
Without any deeper knowledge, I would suggest looking at the Linux USB Project, section USB Host-to-Host Cables, and possibly Easy Transfer Cable (although that seems to be mainly a Windows thingy). In any case you are likely to need additional hardware, because the cable probably is not "just wires".
Solution 2
This is impossible, unfortunately. All USB connections must be between a host device (e.g. a computer) and a normal USB device (mouse, etc.). Desktops and laptops are always hosts and therefore cannot connect to each other. Some newer mobile devices implement the USB On-The-Go standard, and can switch between being hosts and normal devices, but this won't be the case for your computers.
Solution 3
There is no such thing as a USB male-to-male cable, or at least, if some idiot made one it would explicitly violate the USB standard. The closest thing to it is something like a laplink cable, which is a USB device in the middle that has two male cables coming out of it. As far as I know, these use proprietary software to communicate with the device and ask it to relay to the other computer. As such, it won't work as a normal network interface in Linux.
Related videos on Youtube
Tim
Updated on September 18, 2022Comments
-
Tim over 1 year
I have two Linux boxes. One is running KNOPPIX and the other Ubuntu. I have only one wifi dongle between them, and only one of them has an Ethernet port. They both have free USB ports however. I need the box with the dongle to share the connection through a male-to-male USB cable.
I know it is possible to do a similar setup with a desktop and certain portable devices, but I need it between two normal computers. I cannot buy any additional hardware.
-
Renan over 10 yearsUSB doesn't work that way and can't be used to network 2 computers directly. Your best bet is to find an USB/Ethernet adapter, or another Wi-Fi dongle.
-
Lekensteyn almost 10 years@Gagan Your smartphone can act as both a host and device (USB OTG), your laptop doesn't. It's easier to insert an Ethernet cable in between.
-
BJM over 4 yearsNow that's USB-C is a thing, this question shines in a new light.
-
-
Tim over 10 yearsI was afraid of that. Thanks for your time though!