I am trying to add access to WSL2 hosted on Windows Insider 11 with a USB serial FTDI cable connected to COM5.
There its a github procedure descrived here: www.github.com/microsoft/WSL/issues/5158.
When executing the:
$ sudo ./vhui64 in a terminal in WSL2 I am gettng the following message:
modprobe: FATAL: Module vhci-hcd not found in directory /lib/modules/18.104.22.168-microsoft-standard-WSL2
The whole idea of using your product is that WSL2 does not support USB devices connected to the hosting PC.
You will need to compile your own kernel with those drivers see the last question here https://www.virtualhere.com/client_configuration_faq
Please provide kernel rebuild for WSL2
The provided link is from 2014. It is thus irrelevant to the latest WSL2.
Could you provide clear kernel rebuild instructions to make a WSL2 kernel that would be compatible with your product ?
Those are the instructions, if you need more help you will need to use google
Here are some instructions:
Here are some instructions:
Passing the host webcam
I have successfully built a kernel with usb and vhci support and `$ sudo dmesg` shows the ports.
Is it possible to pass the windows host webcam to the wsl2 using your product ?
I also included FTDI support which is needed for my external development boards like NVIDIA Jetson and ESP32 boards.
Would the FTDI serial port be reflected in the WSL2 using your product?
Yes i think it would work. I think wsl2, has gui support now as of the past week or so? (https://docs.microsoft.com/en-us/windows/wsl/tutorials/gui-apps)
So just download and run https://www.virtualhere.com/usb_client_software the GUI linux client for x86_64
You can try the virtualhere server at the microsoft store https://www.microsoft.com/en-au/p/virtualhere-usb-server/9pk805v256r6
Then in the virtualhere client, right click USB Hubs->Specify Hubs and put in the IP address of the virtualhere server on the host.
(Its free for one device if you are using the GUI client)
then the devices should appear in the linux client, right click and select Use.
(I remembered this post and i checked the latest microsoft WSL2 kernel and they have added USBIP kernel modules by default now 8 days ago, so you dont actually need to compile your own kernel anymore https://github.com/microsoft/WSL2-Linux-Kernel/releases/tag/linux-msft-… if you have that kernel (or newer) then it will just work.
If you need to run the console linux client then that does require a license purchase. But try it with the GUI client if you can
I am using the nomachine.com gui which works pretty well.
But I would like to use the USB also in command line mode. on my windows 10 system.
On my windows 11 insider ver 22000.194 and wsl2 I do get:
$ uname -r
$ sudo dmesg | grep USB
[ 0.105619] ACPI: bus type USB registered
[ 0.293112] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 0.293140] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 0.293728] vhci_hcd vhci_hcd.0: USB/IP Virtual Host Controller
[ 0.293738] vhci_hcd vhci_hcd.0: new USB bus registered, assigned bus number 1
[ 0.293851] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[ 0.293854] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.293856] usb usb1: Product: USB/IP Virtual Host Controller
[ 0.294271] hub 1-0:1.0: USB hub found
[ 0.294492] vhci_hcd vhci_hcd.0: USB/IP Virtual Host Controller
[ 0.294498] vhci_hcd vhci_hcd.0: new USB bus registered, assigned bus number 2
[ 0.294896] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.10
[ 0.294898] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.294899] usb usb2: Product: USB/IP Virtual Host Controller
[ 0.295154] hub 2-0:1.0: USB hub found
[ 0.299095] usbhid: USB HID core driver
So I guess your software would work on the windows 11 GUI and 22.214.171.124-microsoft-standard-WSL2.
Yes i would think so, let me know if it does. Im going to upgrade my test machines to win11 very soon too
I tested it now on win11 with wsl2 and it works.
1. Just follow these instructions to setup wsl2 with gui support https://devblogs.microsoft.com/commandline/a-preview-of-wsl-in-the-micr…
sudo apt install libgtk2.0-0
chmod +x ./vhuit64
6. Download and install virtualhere server from the Microsoft Store https://www.microsoft.com/store/productId/9PK805V256R6
7. Run the server. The client and server will automatically find each other and just right click on the device you want to use and select Use
I tested on my webcam and also an ftdi serial adapter and both passed through and shown with
(Free for one device using the GUI, will need a license if you want to use the linux console client without gui)
WSl2 vidso pass
Onthe ubuntu side I am getting:
(vhuit64:24206): IBUS-WARNING **: 17:22:40.649: The owner of /home/mickey/.config/ibus/bus is not root!
I changed oowner to root and warning is not displayed.
In both cases, the only device sown is the usb hub and not the webcam connected to it.
At the windows host, the webcam is working fine. (when testing it was not being used at the host side)
OK sounds like your client is not seeing your host. If it just has "USB Hubs" and thats all then that is not right. Under USB Hubs it should show Windows Hub and the device attached to that.
So in the virtualhere client right click USB Hubs->Specify Hubs -> Add and put in the IP address of your host
WSl2 video pass
Thanks. webcan is now in "use by you".
But not accessible to applications in wsl2. for example, https://webcamtests.com/ does not detect it.
Do you have a Linux driver for your webcam? You need that of course, does it show anything in dmesg?
WSl2 video pass
I followed your procedure. it was not mentioned.
dmesg does not show a /dev/video device
" it was not mentioned."
It sounds like you dont know much about linux. This is not really a forum to learn about linux. You need to understand how to make sure a video camera works in linux. There are plenty of website that help you do that. VirtualHere will pass the camera and other usb devices into WSL but you need to install the appropriate drivers inside wsl2
WSL2 video pass
This link, using your product, says that you still need to rebuild the latest wsl2 in order to use the webcam. Otherwise /dev/video0 will not be created:
Oh cool i didn't know someone did a write up. Thanks for the link. I guess you need to still recompile for the latest kernel for wsl2 to use the webcam.
wsl2 usb webcam
I have recompiled the kernal for wsl2 on my windows 10 and the little bit more advanced wsl2 on my Windows 11 host.
usbip and v4l are properly added and I can communicate with my NVIDIA Jetson board over FTDI usb cable which is a good indication that usbip is there. (On the latets 126.96.36.199 on windows 11 it worked before rebuild as well).
Webcam is not working properly through vurtual here. I am getting distorted images.
So I tried the same on my Ubuntu 18.04 vm on Virtual box. Virtual box allows connection to the host's integrated webcam through USB device allocation of virtual box. This worls perfect. In this case I did not have to rebuild the kernel as it is the regular distribution of ubuntu 18.04 and not the wsl2 variants,
But, when I use virtualhere to use the integrated webcam, the image is distorted in the same way as the wsl2/win10 and wsl2/win11.
How can I sent you screenshot?
wsl2 and ubuntu 18.04 usb webcam
Please take a look here https://github.com/PINTO0309/wsl2_linux_kernel_usbcam_enable_conf/issue…
I uploaded the image.
wsl2 and ubuntu 18.04 usb webcam - flexihub works
I tried the flexxihub demo and it successfully shared both the Chicony Integrated webcam and the Logitech C270 webcam without a glitch. Test was done on my WSL2 18.04/win 10 with kernel rebuilt with usbip and v4l support.
This issue is not in virtualhere.
The VirtualHere Linux Client uses the usbip system *built-into the linux kernel* and it developed to only work with usbip client in the linux kernel. Under no circumstances will the client use an out of tree module.
(Looking at the flexhub product, they use a completely separate opensource software called https://sourceforge.net/projects/usb-vhci. Using out of tree modules is basically doomed because it has to be separately modified/maintained for each new kernel version)
If its not working its a bug in the linux kernel which will be fixed at some point by someone...
wsl2 and ubuntu 18.04 usb webcam
So, in short, webcam sharing is not working in 18.04 until usbip is fixed, which is unlikely to happen.
(You can quickly reproduce it with VirtualBox and 18,04 which is a native install. No need to go through the WSL2 route)
I would appreciate if you give it a final check.
Your comment explains why it works well for 20.04 https://zenn.dev/pinto0309/articles/0723ae46501beb
PS. was a considerable effort to reach this point :)
Actually the fix might get put into 18.04 at some point.
For example, I dont know your specific bug, but i fixed another bug in usbip just a few months ago (https://github.com/torvalds/linux/commit/66cce9e73ec61967ed1f97f30cee79…) I submitted it to the linux developers and with some effort it went into Linux Kernel 5.15. Because it was in mainline, the fix was also backported to 5.10, 4.19,4.14, etc automatically.
So if it does get fixed at some point, it will automatically go into the kernel that Ubuntu 18.04 uses
wsl2 and ubuntu 18.04 usb webcam - 18,04 not supported
I believe it would be just fair for the product to include a comment that Ubuntu 18.04 has a bug that may affect video sharing.
I am on this issue almost two months which could have been saved :)
OK but i didnt know either :)