Hacker News new | past | comments | ask | show | jobs | submit login
usbredir: A protocol for sending USB device traffic over a network connection (spice-space.org)
234 points by sipofwater 9 months ago | hide | past | favorite | 111 comments



There was a thing that was around 10 or 11 years ago called "Wireless USB", and it was actually kind of cool. It did exactly what it sounds like, you could plug in two different arbitrary USB devices into hubs or a computer that supported wireless USB, and the computer would just recognize it as a vanilla USB device. I don't actually know why it never caught on, I thought it was neat, and it seemed to work fine. I guess due to the popularity and ubiquity of bluetooth?

https://en.wikipedia.org/wiki/Wireless_USB

EDIT: Looks like it was more than 10 years ago, circa 2009 or so. Time has no meaning.


First time I heard about Wireless USB was just the other day, in a video looking at a luggable computer from 2006.

https://youtu.be/OO5hYhdxIuk

Video is worth a watch although it also doesn’t give an answer for why Wireless USB actually disappeared.

I was wondering after watching that video, if it could be due to security concerns? Like, is the Wireless USB protocol encrypted? And if so, does it use sufficiently strong encryption?

I did find a document that talks a bit about Wireless USB encryption.

https://cdn.teledynelecroy.com/files/appnotes/wireless_usb_e...


I actually saw that video, but I had heard of Wireless USB for awhile. My manager at my first job after dropping out of college the first time got it for his computer and he was super excited.

At least according to Wikipedia, it was encrypted.


There's "encrypted", and there's encrypted. WEP for wifi was encryption, but cracking it was so trivial that for some years it was practical to crack yourself access to wifi wherever you were on a casual whim.

Still, even if the encryption was very weak, wireless wifi sounds appealing to me, at least for my old trusty wired mouse. Somebody snooping on or spoofing my mouse seems like an academic threat.


> Somebody snooping on or spoofing my mouse seems like an academic threat.

You're not concerned that anyone within a 100 ft radius of you can inject arbitrary keystrokes/mouse movements to your PC?


No, definitely not. The intersection of people who would think to do that, have the skill for it, and the inclination to view me personally as their target is probably zero.


Not to mention that I don't think anyone but a few niche enthusiasts even have the hardware to do it even if they had the skills and inclination. Who's going to walk around with a 15 year old laptop brute-forcing wireless USB encryption, or find some obscure hub and do it on a modern laptop?

I'm not going to say the likelihood is "zero", but I am going to say it's so close to zero that it's really not worth even considering.


Might be possible to do with SDR rather than needing the original hardware. Not that this makes it super more likely.


Anyone within a 100 ft radius of my PC is in my house and could just come over and poke at the mouse.


Or in the apartment or condominium above or below you across any of a few floors, depending on shielding. For those not living in standalone houses.


That's somehow both a much less elaborate and significantly more invasive approach to pranking wfh coworkers.


> wfh coworkers

I usually call her my girlfriend, but I suppose that’s another way to refer to one’s significant other :p


I inadvertently pranked myself like this. For a while my laptop got super haunted, occasionally the cursor would jiggle slightly even when I wasn’t touching the mouse. Eventually I realised that the Bluetooth mouse in my bag which I’d totally forgotten about was getting bumped and turning on.


Imagine someone driving around neighborhoods with a laptop and a very good antenna.

1. Detect vulnerable networks in computers

2. Pretend to be a USB keyboard.

3. Trigger blind key combos that will visit a website, confirm downloading a file, execute that file, and "OK" privilege escalation prompts.

4. Move on to the next block or cul-de-sac, while the malware finishes unpacking and reporting home for further use.


That doesn't need wireless USB, we already have CVE-2023-45866 https://news.ycombinator.com/item?id=38661182 for "bluetooth stack more than 6 months old"


Yeah, that has been a thing since the last millenium. https://en.wikipedia.org/wiki/Wardriving


It was a very limited implementation of wireless USB. You could only plug in two USB devices and only particular devices worked, if I remember correctly. My suspicion is that the reason it went off the market was because it used UWB and the government put a lot of restrictions on its use so that it couldn't be repurposed for use in military applications. It's very difficult to intercept an encrypted UWB communication link, or to even know it is present. It essentially just looks like a slight raising of the noise floor across a wide band of frequencies. UWB was required to get the necessary bandwidth, doing USB across WiFi would probably cause timing errors in devices because it would be so slow (at least using 802.11b which was in wide use at the time). I think hardware makers really hated the idea also because a successful wireless USB system would allow sharing hardware between many computers instead of buying a device per computer (consumer NAS was expensive back then). It was also very expensive, about $400 I think, which was a lot at the time for something that had limited functionality. I remember thinking about buying one and decided it wasn't worth it.


I remember actually testing that stuff out when it came out. I was working as an intern at Philips Semiconductors in their Wi-Fi chip division. Speaking of time has no meaning... :)

I think there were a couple of consumer products that got released - Linksys and netgear perhaps? They consisted of a USB Hub + Dongle.

They actually worked ok, but the speed would drop off quickly with distance. Across the room, and you'd be at 50% of the rated speed, at best.

The technology was interesting. Basically they were transmitting over a whole slew of spectrum simultaneously (from like 2.5GHz to 5.5GHz), but they kept the transmit power low enough that it didn't exceed some FCC threshold.


Wireless USB was also the format used by the Xbox 360 controllers.


Does that mean they’ll work with any wireless USB adapter? I have a 360 controller but haven’t been able to source a USB dongle to use it with my computer.


Interesting that you can't find one. I got one a few years ago when I built a little emulator system out of a Pi. Works fine. I can't remember where I got it, though. I thought eBay, but I don't see it in my purchase history.



AFAICT those are almost all for later Xbox controllers which are built on Bluetooth.


No, they work on whatever their custom wireless protocol is. I use one all the time.


There isn't one custom protocol.

360 used wireless USB. Xbox One on uses Bluetooth.


Huh. I had a 360 controller and a wireless adapter for my pc. It died a few years back though.


I recently found out that a manufacturer (TI, NXP, murata, infineon?) was demonstrating a USB2 live camera capture using a UWB (Ultra-Wide-Band) short range wireless transmission. But I can't found the source again.


When Mac first took out the DVD drive, there was also a away to mount remote DVD drive. I guess the push was to get everyone on the network. So stuff like that just didn't take off.


I've been saying this should be a thing for decades. Not sure why I never heard of this.


Most USB devices either rely on the connection to provide power or are too clunky to move around, so having a wire doesn't really matter.


I'm running virtualhere on thousands of raspberry pi's sharing various USB devices to cloud machines over vpn. It's been working without issues for years now. Seems to be a solo developer in Australia that's been working on it for a really long time. https://www.virtualhere.com/


Correct, i am a solo developer working on it since 2010 :)


I love your website. It's clear and to the point. I immediately knew what your product did; thank you.


Thanks for your work. I tried using it to use the official Gamecube Controller USB Adapter through Steam Link, but there was some spiking noise that killed playability. Nevertheless, I think it is amazing stuff.


This sounds like a cool use case for my observatory control box. Do you ever have issues with latency pushing the bounds of the USB spec wrt latency? Can I use this with my camera?


I have a lot of astro users. But you need to use Ethernet for the connection between VirtualHere server and client and not wifi. A pi5 is very good for this.


Yep. I have a hard line from my skyshed to the house lan. It would be over cat8 or whatever I have.


$49 and a byzantine per-server-cannot-be-transferred license is not palatable to me. I hate hardware-bound licensing.


Oh, knock it off.

The reality is that licenses must be restricted because people cheat, steal and pirate. Hate them instead. Besides $49 is dirt-cheap for what it is, especially considering it covers all future versions.


Would you rather like a monthly subscription per client?


They didn't say anything about monthly subscriptions.


>>> I'm running virtualhere on thousands of raspberry pi's

Offtopic.

Mind sharing what are you doing with thousands of pi's ? Thanks


What possible use case is this for


> This USB server solution is perfect for allowing USB devices to be used remotely over a LAN network, over the Internet, or in the Cloud without the USB device needing to be physically attached to remote client machine.


Well, speaking for myself, I was curious why someone would need "thousands", and what the devices are.


it is probably printers the horror


clickbot farm?


VDI?


> thousands of raspberry pi's

so you've spent 1000s * $49 for the license?


Why not?


Possibly because a developer hired to write something around usbip would cost a lot less. https://usbip.sourceforge.net/


> Possibly because a developer hired to write something around usbip would cost a lot less. https://usbip.sourceforge.net/

Would it? For the sake of discussion, I'll assume "thousands of raspberry pi's" = 2,000 RBpis, or something around $10,000 in license fees.

I don't know anything about either project beyond the links shared by you and the root comment, but based on the information at each link and the assumption of $10,000 spend:

I would choose the one time cost of VirtualHere's purpetual update license and release cadence over a some short dev for hire contract to write some unmaintained wrapper code around a sourceforge library that hasn't been been touched in over a decade.


$49 times 2,000 is $98,000, not around $10,000. Yet your argument still holds. There are many reasons for that.

1. You are paying a developer that works 100% on that, year after year, and not a hire that won't be there when something goes wrong in the future after an OS update, new hardware, anything. This is basically your argument. Let me add:

2. In some parts of the world far away from SV but still in the West, $100k are about two years of gross developer salary, not what the developer actually gets at the end of the month. Point 1 still holds. Where it's 10 years of salary maybe companies could be tempted by a custom solution.

3. You are giving $49 per server to that developer but you are probably getting more per server from your customers. If you have thousands of servers you probably have a viable business, so that's just yet another cost of doing business.


Hah, yes I definitely fumbled on the math there. Thanks for re-articulating what I was trying to get across much better than I did!


usbip has made me angry for 5 years now, there is supposedly an open source windows client, but you have to put windows into some unsafe bullshit mode to be able to use unsigned drivers?? So you have to compromise your entire system to use one program


I mean you could sign it yourself. Or donate to a maintainer so they can sign it. Open source or other community windows drivers usually aren’t signed unless they have donors paying for it, certs aren’t free :)

If anything it’s on windows for not having a way to allow just one unsigned driver.


The one hack I keep hoping <someoneelse> will do the actual work for is -

redirecting my steamdeck control via usb to my linux gaming rig and expose it as a usb device(s) for steaminput.

It seems like a natural and perhaps even "straightforward" hack but I've seen no evidence of one so far, perhaps there is something in usb that limits the ability to proxy it correctly.


To clarify: You want the Steam Deck to run USB gadget mode and use that to expose its input devices to the other machine?

If so... while searching to see if the SD supports gadget mode (answer: yes) I happened across https://github.com/Frederic98/GadgetDeck - have you tried that?


This looks closer then anything I've seen so far, thanks!

From what I can discern its missing important bits of the controller and doesn't have any steaminput profile etc so it's clunky still.

Worth poking at though.

edit - to clarify, ideally steaminput would be tricked on the host to think that it "was" a steamdeck so all the mapping features would be available. I don't really need another usb game controller its more the steamdeck touchpad etc.



That's over wifi not usb.

Even a bluetooth mouse has too much latency for many games.



I didn't watch those youtube videos, but the text links either agree with the opinion that bluetooth is worse, or don't refute it.

That rtings graph shows that bluetooth is pretty clearly worse in the majority of cases from wired or wireless (which is distinct from bluetooth).

"Bluetooth" doesn't appear anywhere on that Reddit thread.

And from the second rtings:

> The mouse's connection type affects the click latency. Generally, wired mice have the lowest latency, and Bluetooth mice have the highest latency. A Bluetooth connection isn't recommended for gaming, but it's still good for office use, and most people won't notice any delay unless the latency is extremely high.


If you look at the graph again, not all of them are worse, which means it's obviously possible to make it on par or close to it. But regardless, the complaint was "too much latency for many games", which is not the same as "worse". And I don't think this amount of latency is too much for the vast majority of games.


Few/none of the wireless gaming mice are using bluetooth, its proprietary radio protocols and usb dongles.

Click latency is not too useful vs swipe latency.

Bluetooth has a pretty low polling rate iirc and that kills the swipe latency.

More generally and responsive to what we were talking about, proprietary radios are not bluetooth and they are not WiFi which is the latency we are actually talking about (which is usable but not for me to play elden ring by direct experience).


VirtualHere will run over any network connection, that user just happened to use wifi.

All the mice I am aware of that use Bluetooth are travel mice and the like. Even cheap gaming mice use RF dongles that do not have the Bluetooth polling limitations.

You can tell your friends in Fortnite you died because of mouse latency, but lets keep HN discussions grounded in reality please.


Maybe allow mounting of the the steamdeck input devices in steamdeck:/dev over network on your linux box so it is exposed as an additional device? Something like plan9 does.


I don't own a steamdeck. But searching around the web a bit I found out that raw-gadget^1 was merged into the linux kernel in 5.7.

And AFAIU that would enable proxying of USB devices.

[1] https://github.com/xairy/raw-gadget


Sounds like something Valve should make. Kinda weird they haven't so far.


Valve's "remote play" allows one to play games on another host computer via your Steam Deck as though you are plugged straight. If you don't need the video streaming, you can lower the settings.

edit; oh nm, user wants a direct wired connection to work.


it may not be practical given the possible high latency.


over USB. what might introduce high latency?


Oh, oh, I get what you're saying. You want the steamdeck to expose its controls as a hotpluggable USB device on another machine.

That would depend on the USB hardware on the device, I think.


Yet another reason I wish FireWire had won. It always supported 2-way instead of a host-client model.


Sounds a bit like USB/IP (https://wiki.archlinux.org/title/USB/IP).

Is this a new thing?


Both projects seem to be >10 years old at this point… might be a case of "convergent evolution"?


I'm on my phone so I can only do so much digging, but from the usbip sourceforge page that's linked above, it says that development has moved into the Linux kernel:

  For Linux, the source code of usbip was merged into the staging tree, and finally has been moved to the mainline since Linux-3.17. Development is ongoing in the kernel community, not here. Linux distributions will provide binary packages of usbip.*


Probably... I thought of passing my iPod Nano 7g through USB/IP to my Proxmox Windows iTunes VM, but I never had the urge to do it. Although it'd probably work and would be great in combinaton with Wireguard on vacation, I did not want to setup a "risky" driver / kernel module on my main proxmox server :-) USB passthrough always was enough.


It may not be well known that VMWare Fusion supports this.

I run Windows on a Mac Mini functioning as an ESXi server.

From my Macbook Pro, I can connect to it with Fusion Pro and attach USB devices to the Windows VM. I use this to program ham radios and troubleshoot my vehicle with Toyota Techstream + USB OBD2 adapter.


On Plan 9 I just rimport the remote machines /dev/usb. Since this is all over 9P it can go over any 2-way pipe, even rs232.


And, the linux kernel has plan 9 FS drivers. [0]

[0] https://www.kernel.org/doc/html/latest/filesystems/9p.html


Is Plan 9 alive and kicking?


Plan 9 is like BSD; the original is no longer developed, but its forks ( https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs#Derivati... ) are healthy enough.


Depends. There are still many enthusiasts (even new ports to random chipsets), but there is also a bit of a schism between the 9front folk and… let’s say our current timeline. The good news is that there are interesting things going on, fortunately none of which related to current tech trends.


> but there is also a bit of a schism between the 9front folk and… let’s say our current timeline.

As a 9front user who attended IWP9 the past two years (just was in Philly this past weekend) this really isn't the case anymore.



I'd like to get a VDI infrastructure setup for me and my partner -- something that enables both of us to run our computers with a single big machine, and not have cables running everywhere through the house, while being able to sit wherever we want and use our infra from any given place.

At the moment, I've brainstormed:

- A main server that runs some type 1 hypervisor (Xen or Proxmox, will need to see which is more adequate)

- Light "client" devices (laptop, for example), that may either be connected in a wired manner to the server (e.g. separate desks), or remoting into it through Wireguard. Each desk will feature a KVM-style setup with a docking station that offers screens, keyboard, and a range of USB ports.

- Individual VMs for running our respective OSes to our preference, some flavor of linux distro. Inputs from the client device (e.g. USB, Keyboard, Screen) should be forwarded / matched to the VM.

- A windows VM for gaming, running two sessions for each of us: GPU passthrough is a must. I would like to make use of Looking Glass somehow, if possible either through the Linux VM on the same server, or on the client machine. The latter would probably be better for performance, I suppose, given you don't have to forward input devices twice... but I'm also worried about whether the buffer-copy mechanisms from Looking Glass would work with such a setup.

So far, I'm looking into Moonlight/Sunshine as a general desktop redirection setup: my hope is that I can pass something close to direct framebuffers on an ethernet connection while at home, and switch to compression while I'm away, hoping to achieve as little latency as possible in all cases (so giving absolute priority on the host to the streaming process, if possible, kind of like an RT system). One notable thing is that Sunshine by itself doesn't support generic USB redirection. Has anyone tried using usbredir for this purpose?

In general, it's hard to find relevant information for this kind of home hypervisor setup with a focus on gaming/latency and general transparency all around... would appreciate tips if anyone's attempted something similar before. Thanks!


Does this offer anything over USB/IP?


I think just that it's plugged in at the SPICE level. So I guess you could redirect a USB device into a guest that isn't running Linux and can't run usb/ip? But also, this is how usb redirection works with virt-viewer/virt-manager, I'm fairly sure.


USB/IP works fine on Windows and MacOS, though MacOS has no ability to use devices shared by USB/IP; it can only share devices to others.

What is this “SPICE level” you mentioned?



Imagine you had a qemu/libvirt guest that understands USB, but doesn't have support for USB/IP in "kernel/userspace".

usbredir gets your device to qemu, looking like it's a USB device attached to the VM, without cooperation from the guest.


“Without cooperation from the guest” is the bit of info I was missing.

Thank you.


Now I'm wondering whether someone has built support for this in rust-vmm...


Remember Remote Disc from Mac OS X? https://support.apple.com/en-us/101323


This would have been great for me to have around 25 years ago, when I wanted to mount a USB web cam in my bedroom window on the second floor and connect it to a computer in my basement. I was a dumb middle school kid and just spliced the usb wires onto Ethernet cable ends, and plugged them into the existing Ethernet run. That’s when I learned about maximum USB lengths the hard way, by frying some perfectly good hardware.


I would not expect this hack to fry hardware - at worst, voltage drop, interference, signal distortion, and impedance mismatch will simply cause the device to not work. But I've successfully run USB 2.0 over 30ft cables despite it being illegal per spec, so your idea wasn't radically wrongheaded. "Fried" is an extreme result - are you sure you didn't just connect V+ and V- backwards or something?


It being 25 years ago, I’m not sure of anything. But glad to know I’m not too far off or alone.


Yeah, probably just jerry-rigged an extension and plugged V+ into a data line or something like that. Properly wired, it just wouldn't detect the device.


There is also USB-IP. https://usbip.sourceforge.net/


https://www.usb-over-network.com/usb-over-network-download.h...

I have used this software for adb debugging in rdp window10, it's really cool, but it don't meet all cases.


I used this the other day with some of my proxmox VMs and it worked amazingly well. Pretty nice to be able to pass my usb via spice instead if needing to plug it into the server.


Funny how yesterday I was using Winding Sandbox to test a software and wanted to connect an iPhone to it, problem was that there’s not interface like a fully fledged VM and had to use VMware instead, maybe this will do the trick?


USB/IP works fine on Windows, and there are a couple of good open source packages for it. It works well.


What’s input latency and throughput on this like? Would it support near native keyboard / mouse, webcam or display output? What about mass storage devices?


Doesn't WSL2 use something very similar for forwarding usb devices from Windows to the Linux VM? Through "usbipd"


Yes, Microsoft has documentation on how to set up USB/IP for connecting USB devices to the WSL2 VM. It works quite well, in my experience.


A software based Tibbo for usb, awesome!

https://tibbo.com/


So basically this a USB device server but you can BYO hardware. Use cases for USB device servers (according to https://www.seh-technology.com/products/usb-deviceserver.htm...):

external disks

dongles

card readers

telephone systems

barcode scanners

medical devices

mobile gauges

output devices

audio/video streaming devices

scanners etc.

...connecting a computer to a USB device that is further away than what USB is physically limited to (distance wise).


usbip is a thing, is even a Debian package...


[flagged]


Nice bot account.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: