Author Topic: Windows Sandbox and USB over Ethernet  (Read 10298 times)

0 Members and 1 Guest are viewing this topic.

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Windows Sandbox and USB over Ethernet
« on: July 27, 2019, 10:22:35 am »
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.
 
The following users thanked this post: ebclr

Offline aandrew

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: ca
Re: Windows Sandbox and USB over Ethernet
« Reply #1 on: July 27, 2019, 02:19:06 pm »
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.

I'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.
 

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Windows Sandbox and USB over Ethernet
« Reply #2 on: July 28, 2019, 09:53:23 am »
I'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.

Are 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.
 

Offline Againgly

  • Newbie
  • !
  • Posts: 8
  • Country: ca
Re: Windows Sandbox and USB over Ethernet
« Reply #3 on: August 05, 2019, 09:19:53 am »
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.
 

Offline aandrew

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: ca
Re: Windows Sandbox and USB over Ethernet
« Reply #4 on: August 05, 2019, 02:35:28 pm »
Are 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.

Pretty 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.
 

Offline Zucca

  • Supporter
  • ****
  • Posts: 4306
  • Country: it
  • EE meid in Itali
Re: Windows Sandbox and USB over Ethernet
« Reply #5 on: August 06, 2019, 06:16:57 am »
I love "Windows Sandbox" - a feature recently introduced in Windows 10 Pro build 1903.

Wait, 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.
« Last Edit: August 06, 2019, 06:18:28 am by zucca »
Can't know what you don't love. St. Augustine
Can't love what you don't know. Zucca
 

Offline Ampera

  • Super Contributor
  • ***
  • Posts: 2578
  • Country: us
    • Ampera's Forums
Re: Windows Sandbox and USB over Ethernet
« Reply #6 on: August 06, 2019, 07:13:22 pm »
So it's a VM.

Why not use a better hypervisor?
I forget who I am sometimes, but then I remember that it's probably not worth remembering.
EEVBlog IRC Admin - Join us on irc.austnet.org #eevblog
 

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Windows Sandbox and USB over Ethernet
« Reply #7 on: August 06, 2019, 07:34:46 pm »
So it's a VM.

Why not use a better hypervisor?

It 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.
« Last Edit: August 06, 2019, 07:40:24 pm by Zbig »
 

Offline Ampera

  • Super Contributor
  • ***
  • Posts: 2578
  • Country: us
    • Ampera's Forums
Re: Windows Sandbox and USB over Ethernet
« Reply #8 on: August 06, 2019, 07:45:56 pm »
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?
I forget who I am sometimes, but then I remember that it's probably not worth remembering.
EEVBlog IRC Admin - Join us on irc.austnet.org #eevblog
 

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Windows Sandbox and USB over Ethernet
« Reply #9 on: August 06, 2019, 07:58:27 pm »
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?

Yup, 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.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6761
  • Country: pl
Re: Windows Sandbox and USB over Ethernet
« Reply #10 on: August 07, 2019, 09:09:47 am »
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.
 

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Windows Sandbox and USB over Ethernet
« Reply #11 on: August 07, 2019, 12:38:35 pm »
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.

Yes, I know, thanks...
 

Offline Lord of nothing

  • Super Contributor
  • ***
  • Posts: 1581
  • Country: at
Re: Windows Sandbox and USB over Ethernet
« Reply #12 on: August 10, 2019, 08:02:45 pm »
Hi
I 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.
Made in Japan, destroyed in Sulz im Wienerwald.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf