Score:1

Seeking up-to-date information on using Ubuntu computer with USB-C as “USB gadget”

it flag

Now that USB-C has been around a while I’m seeing many older but still functional computers with USB-C being largely unused, replaced by newer and faster just because they are newer and faster. I can certainly breathe more life into them by installing Ubuntu and some helpful utilities but I believe they can offer more.

Through some experimentation and investigation I find that many of these computers with USB-C ports show signs of being able to support B-mode, guest mode, bus slave mode, or whatever it is called. That is opposed to the usual behavior we expect from computers in being A-mode, host mode, bus master mode, or whatever term people prefer. This investigation lead me to “Linux USB Gadgets”, the software which enables and exploits this hardware to turn hosts into guests, masters into slaves, or whatever.

When seeking out information on "USB gadgets" for hardware new enough to have USB-C and USB 3.x capable USB controllers, but old enough that they are no longer the top of the line, I find only hints of how to make this work. I come up with plenty of results for older USB 2.0/USB-OTG controllers, the kind found on specialty PCIe add-in cards or built into single board project computers. With the common use of USB-C for laptop charging I find that nearly every one of these laptops contains a USB dual-mode controller, and these same controllers are also common in desktop computers even though they do not have the hardware to take on power.

I'm seeking documentation on USB gadget emulation with USB-C ports found on laptops and desktops using the much faster USB 3.x protocol. Again, there’s plenty to find for older USB 2.0 and USB-OTG but it’s difficult to sort the signal from the noise.

The "gadgets" of most interest are mouse, keyboard, and video (preferably something with high enough resolution to be useful as a primary computer display but even old composite video could help). The goal is to be able to turn a computer into a kind of multi-function dock to another computer. I can find some information on audio and network devices but nothing on how to actually drive the mouse and keyboard of one computer from another or set up a network connection.

One issue is separating the computers that support this mode of operation from those that do not. I can look at the PCI device descriptor but I’d need a list of supported devices. I search the internet and the top results are often 15 years old. I see things here and there showing there is still development, including a security issue from this past week, but nothing helpful on getting anything useful from the Linux USB gadget drivers.

Perhaps all I need is a few suggestions on search terms so I can better filter old USB 2.0 and OTG information from the new USB 3.x and USB-C information.

Edit to add:

I’m seeing in the comments suggestions to use network solutions instead of USB. This is missing the point as the goal is to use the USB connection to provide the network connection. USB-C connections would be faster than any commonly available wired or wireless network hardware. There is certainly professional/server grade stuff that is faster but the point is to make the most of currently owned consumer grade hardware, to save money rather than spend it. Perhaps it would be simplest to assume the USB-C connection is there to provide the network connection. Once I find the documentation on how to establish a network connection by USB-C then I can use things like file sharing and remote desktop software over that connection for the other desired functions. Even if I can get a network connection working it would be preferable to not need to install and configure network software, but instead have the Ubuntu computer behave like a stack of USB devices on a hub for greater convenience.

David avatar
cn flag
Sorry I do not see an on topic question here. What I do see is hardware shopping which is off topic.
muru avatar
us flag
It's still not clear to me what's being asked of here. Keyboard/mouse sharing can be done using software like Barrier, Synergy, etc. Hard disks can be shared over the internet using iSCSI. Which is required here?
it flag
By using USB gadgets the “dock computer” requires nothing from the host computer to work but a USB port and standard drivers. Drives appear as USB equivalents, keyboard and mouse are USB equivalents. The host doesn’t need configuration for iSCSI. The computer is a dock, not some kind of server. It “speaks” USB, not TCP/IP. With USB it can be audio, printers, webcams, maybe even video. With the old USB 2.0 things move slowly, if we can find the more resent work on this then we can add USB 3.2 and USB4 speeds. Maybe even Thunderbolt.
muru avatar
us flag
That's all good, but why do you need all that when the mentioned alternatives fulfill the requirements just as well? I've been using Barrier for years, and Synergy for years before that, and both work just fine for KVM switching from one system to another. USB *2* speeds are hardly relevant to that, let alone USB4. And for storage, the limiting factor will be the connection between the two, so not likely to be anywhere close to USB4 speeds.
it flag
Synergy does not meet the requirements because that requires software loaded on the “docked” computer to function. If the computer is not booting the OS, the computer is not compatible with the software, the user lacks permissions to add software, or some other limitation then it is not a solution. I am fully aware of various remote desktop solutions but the goal is to connect by USB as USB is universal, requires no settings, and is just plug-and-play. If the solution were that simple then I’d not be asking the question.
it flag
The speed difference between USB 2.0 and USB4 is considerable, and highly relevant if the goal is file sharing or video. I agree that this is not necessary for things like keyboard, mouse, or audio. The problem is that I can’t even find information on how to get a useful USB 2.0 connection with USB-C. I’m seeing people mention this working but I can’t find how they did it because old mentions of USB-OTG keep getting top results on any searches. I’m seeing people make it work and I’d like to know how they did it.
andrew.46 avatar
in flag
@MacGuffin As I mentioned previously: if you want to query why you question has been closed, and the general policies towards closing questions that are deemed to not have sufficient focus, you can write up a question here: https://meta.askubuntu.com/ From there the Community can debate / contribute...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.