Share USB Devices to WSL on Windows Hyper-V
In this article
Yes, you can share USB devices from your Windows host to a WSL (Windows Subsystem for Linux) environment running on Hyper-V, but it requires manual setup because WSL does not natively support direct USB passthrough. The solution involves using Windows' built-in virtual machine tools to access the USB device inside a Linux distribution by exposing it through a virtual COM port or leveraging third-party tools that bridge USB access into the WSL environment. This guide walks you through the exact steps, prerequisites, and common pitfalls.
What You'll Need
- A Windows 10 or Windows 11 PC with Hyper-V and WSL2 enabled
- A USB device you want to share (e.g., Arduino, serial adapter, USB-to-TTL converter)
- Administrative access to Windows
- A Linux distribution installed via WSL (e.g., Ubuntu, Debian)
- USB Redirector software or virtual COM port tools (optional but recommended)
- Device Manager access in Windows
Step-by-Step
- Ensure WSL2 is set as the default version. Open PowerShell as Administrator and run:
wsl --set-default-version 2. This ensures your Linux distribution runs on the Hyper-V backend, which supports better device integration. - Install your preferred Linux distribution from the Microsoft Store (e.g., Ubuntu). Once installed, launch it to complete setup.
- Connect your USB device to your Windows host. Wait for Windows to recognize it. Then open Device Manager (press Win + X and select Device Manager).
- In Device Manager, locate your USB device under “Ports (COM & LPT)” or “Universal Serial Bus controllers.” Note the assigned COM port (e.g., COM4). If it’s not listed under COM ports, it may not be a serial device and may require different handling.
- Enable the Windows Hypervisor Platform and Hyper-V if not already enabled. Go to Settings > Apps > Optional Features > More Windows Features. Check “Hyper-V” and “Windows Hypervisor Platform,” then restart your PC.
- Use a tool like com0com (free, open-source null-modem emulator) or USB Redirector (paid, reliable) to share the physical COM port as a virtual one accessible to WSL. Install and configure the tool to bridge your physical COM port (e.g., COM4) to a virtual COM port (e.g., COM5).
- In WSL, install
screenorminicomto access serial ports:sudo apt update && sudo apt install screen minicom. - Access the virtual COM port from WSL by mapping it. Since WSL does not directly expose Windows COM ports, you must use Windows’ \.\\
path via a network serial bridge or use a tool like ser2netto forward the port over TCP. - Set up
ser2neton Windows (using Windows Subsystem for Linux or a Windows-native build). Configure it to forward the physical COM port (e.g., COM4) to a local port like 6000. Example config line:6000:raw:0:COM4:9600. - From WSL, connect to the forwarded port using
nc localhost 6000orscreen /dev/tcp/localhost/6000. This gives you access to the USB serial device. - For non-serial USB devices (e.g., storage, HID), WSL cannot directly access them. Instead, use Windows file sharing: plug in the USB drive, copy files to a folder, and access that folder via
/mnt/c/in WSL. - To automate access, create a startup script in WSL that connects to the serial service when WSL launches.
Common Mistakes
- Assuming WSL supports USB passthrough natively — it does not. Manual bridging is required.
- Not checking if the USB device appears as a COM port in Device Manager — many devices need drivers to show up correctly.
- Running WSL1 instead of WSL2 — WSL2 is required for full virtualization features.
- Forgetting to run PowerShell as Administrator when enabling Hyper-V features.
- Using incorrect COM port names or permissions in WSL — ensure correct syntax when accessing TCP or virtual devices.
Tips
- Use
ls /mnt/in WSL to quickly check mounted Windows drives for USB storage. - Label your virtual COM ports clearly when using com0com to avoid confusion.
- Test the serial connection on Windows first using PuTTY or Tera Term before attempting WSL access.
- Keep WSL and Windows fully updated to avoid compatibility issues with virtualization.
- Use
wsl --shutdownto restart WSL completely if connections fail — this clears stale sessions.
Troubleshooting
If the USB device is not accessible in WSL:
- First, restart WSL with
wsl --shutdownand relaunch your Linux distro. - Verify the USB device is working in Windows by testing it in a native Windows application.
- Check Device Manager to confirm the COM port assignment hasn’t changed after reboot.
- Ensure no other application (e.g., Arduino IDE) is holding the COM port open.
- Reinstall or reconfigure the virtual COM bridge tool if the virtual port fails to appear.
- Check Windows Firewall — it may block
ser2netor TCP forwarding. Allow the application through the firewall. - If using
screenover TCP fails, trync(netcat) as a simpler alternative to test connectivity.
Frequently Asked Questions
Can WSL2 directly access USB devices?
No, WSL2 does not support direct USB passthrough. You must use COM port bridging or file sharing for access.
Why doesn’t my USB device show up in WSL?
WSL does not expose Windows COM ports by default. You need to forward the port via tools like ser2net or USB Redirector.
Do I need Hyper-V enabled for this to work?
Yes, WSL2 relies on Hyper-V for virtualization. Without it, WSL runs in a limited mode without full device support.
Can I use this method for USB storage devices?
Yes, but not via passthrough. Instead, access the drive through /mnt/c/ after Windows mounts it.
Is there a GUI tool to simplify USB sharing with WSL?
Tools like USB Redirector offer GUI-based forwarding, making setup easier than command-line methods.
Does this work on all Windows editions?
Only Windows 10/11 Pro, Enterprise, or Education support Hyper-V. Home editions require workarounds to enable it.