Windows Sandbox and USB over Ethernet - Page 1
Forum section: electronics / general

author: Zbig
author_rank: Frequent Contributor
timestamp: July 27, 2019, 10:22:35 am
content: I'm a bit paranoid when it comes to installing random stuff on my PC. I hate it when I have to install some piece of software of dubious quality for a one-off job. Even after uninstalling it, I can often find it's left some dependencies behind or otherwise messed with my system in one minor way or another. That's why I love "Windows Sandbox" - a feature recently introduced in Windows 10 Pro build 1903. It relies on Hyper-V virtualization and basically is a clean, disposable Windows 10 installation within your main Windows 10 installation. You can launch it, install some dodgy software in it, play around with it for a bit. When you close your Sandbox windows, it nukes all the changes made to its underlying virtual disk and wipes itself clean.What I missed with this solution alone was inability to use physical USB devices within Windows Sandbox. Some other virtualization platforms like VirtualBox do offer USB pass-through but Windows Sandbox and its underlying Hyper-V hypervisor doesn't. The way to solve it is to use a third party "USB over IP" software solution. I noticed something called "VirtualHere" available for install on my Synology NAS. Tried it out and it's awesome. Now I can attach a USB device to my Synology's USB port, launch Windows Sandbox on my PC, install VirtualHere Client there and "attach" remote USB device there. Now the OS inside Sandbox behaves as if there was a physical USB device connected to its virtual USB hub exposed by the VirtualHere client. This completes my "throwaway", no-trace-left solution for one-off, disposable USB devices' software installations.I've already performed a HDD test using the vendor-provided, proprietary disk testing software that I was reluctant to install on my main "productive" OS. Also, as I write this, I'm updating a TomTom SatNav device. Their software installs a virtual network adapter (NDIS over USB) for talking to the SatNav device but after I'm done, I'll just close the Windows Sandbox and there'll be zero footprint left behind.I see a great potential in that, for instance when you have to use this dodgy piece of programmer software of dubious provenience for some obscure chip that you just need to use this one time.

author: aandrew
author_rank: Frequent Contributor
timestamp: July 27, 2019, 02:19:06 pm
content: Quote from: Zbig on July 27, 2019, 10:22:35 amI've tried damn near every "USB over Ethernet" scheme I've found. The problem isn't with the technology in this software, it's in the stupid USB driver writers who insist on microsecond timeouts before declaring the USB device non-responsive. Drives me up the fucking wall!VirtualHere, Nomachine's extender, various ipkvms... all mediocre at best for anything other than thumb drives.The best luck I've had to date is with a virtual machine running on ESXi and then using VMWare Fusion (Workstation should work as well) to attach a local USB device to the ESXi VM. This seems to work well over the (100M and 1G) LAN even with FPGA JTAG dongles and the Segger J-Links I usually have to connect to.

author: Zbig
author_rank: Frequent Contributor
timestamp: July 28, 2019, 09:53:23 am
content: Quote from: aandrew on July 27, 2019, 02:19:06 pmAre you sure that was caused by USB timeouts and not by the USB device in question re-enumerating as different things in quick succession and the USBoIP solution failing to "grab" each of its subsequent "incarnation" properly? I have learned that programmers/debuggers tend to do that where, e.g. during the debugging session, they first appear as a bootloader device to load appropriate firmware, then they switch to programmer mode, only to became a debugger a second later. The trick is to configure the USBoIP solution so it properly captures all of these, i.e. capturing one particular VID/PID could not be enough. You have to either capture the whole USB port, no matter what appears on it, or include all the VID/PID pairs.

author: Againgly
author_rank: Newbie
timestamp: August 05, 2019, 09:19:53 am
content: This is a really useful solution. Now a large amount of software is simply cluttering up a laptop and it takes a long time to get rid of it.

author: aandrew
author_rank: Frequent Contributor
timestamp: August 05, 2019, 02:35:28 pm
content: Quote from: Zbig on July 28, 2019, 09:53:23 amPretty sure; I know of a lot of those types of devices (usually involving an FX2LP). I can't speak for *all* devices but for devices where I had control over the timeouts (i.e. my own USB devices) USBoIP worked reasonably well, which led me to this conclusion.

author: Zucca
author_rank: Unknown
timestamp: August 06, 2019, 06:16:57 am
content: Quote from: Zbig on July 27, 2019, 10:22:35 amWait, something good in W10? What M$ was smoking when they decided to implement it?Remarkable.Since Win XP I gave up in this battle, every 1,5 years or so I "format c:" and perform a clean install.

author: Ampera
author_rank: Super Contributor
timestamp: August 06, 2019, 07:13:22 pm
content: So it's a VM.Why not use a better hypervisor?

author: Zbig
author_rank: Frequent Contributor
timestamp: August 06, 2019, 07:34:46 pm
content: Quote from: Ampera on August 06, 2019, 07:13:22 pmIt uses Hyper-V under the hood which very much is a proper hypervisor; can't see why I would need a "better" one. The thing is that Sandbox starts in seconds and is a throwaway affair - both of these features suit my use case perfectly.EDIT:Oh, by better you meant one with built-in USB pass-through? I like Hyper-V and use it for my other virtualization needs. That's why don't want to install another solution that would require me to turn Hyper-V off or use some compatibility mode like VirtualBox on Hyper-V.

author: Ampera
author_rank: Super Contributor
timestamp: August 06, 2019, 07:45:56 pm
content: You can't run Hyper-V and Virtualbox at the same time? That's weird.I'd consider a hypervisor that can't do something as basic as USB passthrough rather weak. Can you do PCIe passthrough of a USB controller instead?

author: Zbig
author_rank: Frequent Contributor
timestamp: August 06, 2019, 07:58:27 pm
content: Quote from: Ampera on August 06, 2019, 07:45:56 pmYup, you can't have multiple competing hypervisors running in parallel and the way Hyper-V works, even your main/host OS is running under it at all times (albeit in a privileged mode) when you have it enabled. VirtualBox since version 6.0 has a Hyper-V "fallback execution core" but I haven't tried that yet and I'm not really eager to investigate it now. Yes, the lack of USB pass-through seems like a bit of an oversight but I love how deeply Hyper-V is baked into the OS. It doesn't depend on any userland processes so e.g. I can (and I have had) configure it so it starts your VMs in the background even before any Windows user logs in. They just chug along in the background doing their thing, completely invisible when not needed.

author: magic
author_rank: Super Contributor
timestamp: August 07, 2019, 09:09:47 am
content: See "snapshots" and "copy on write images". All decent VMs support it, even qemu and AFAIK VirtualBox too. You can create one base image and then multiple derived images which only remember changes made to the base image. If you want to nuke a VM, you just delete the COW image and start anew.

author: Zbig
author_rank: Frequent Contributor
timestamp: August 07, 2019, 12:38:35 pm
content: Quote from: magic on August 07, 2019, 09:09:47 amYes, I know, thanks...

author: Lord of nothing
author_rank: Super Contributor
timestamp: August 10, 2019, 08:02:45 pm
content: HiI run a Pair of USB over Glasfiber Device from China. The work perfect for SDR stuff.The Antenna is on the Rooftop and the SDR inside directly under the Roof in a Cabinet.The Glasfiber Cable is route on the Wall direct into the Basement where my Laptop sit.That should be replaced with a dedicated Server for Amateur Radio Decoding.The good think that run isolated and not over LAN.