USB support in WSL2 – now with a GUI!

Almost two years ago I wrote a guide on how to interface with USB devices from WSL2 because many of our users were developing on Windows but wanted to use Linux-native tools for projects like Zephyr. I’ve heard from countless devs thanking me for the guide but with one wish – a Graphical User Interface (GUI) to simplify the process of managing USB devices. The most common alternative to running Linux tools on Windows is usually a full blown VM like VirtualBox, which has a nice UI. usbipd-win is certainly no GUI.

USB Settings in VirtualBox

I recently had to set up a new Windows machine and decided to see if there’s been any enhancements to the USB support in WSL2. I was pleasantly surprised to find not one but two GUIs! The rest of this post will walk you through the two options but will assume you have read the original blog.

WSL USB Manager

The first tool I found is a nice Python-based desktop GUI hosted over on GitLab. Installation is a breeze thanks to the MSI installer included in official releases. It delivers on the fundamentals of being a USB manager – list, view state, attach/detach – but it also adds some niceties.

screenshot of wsl-usb-gui
Source: https://gitlab.com/alelec/wsl-usb-gui

For example, usbipd-win added an auto-attach feature since my original article, which can be very handy when your embedded device reboots and needs to be re-attached. However, it can be tricky to set up from the commandline. WSL USB Manager allows you to define a profile right from the UI that handles auto-attach more smoothly. Another neat thing it does is automatically create the correct UDEV rule for you so you have one less permission issue to deal with.

USBIP Connect for VS Code

Given the popularity of Visual Studio Code, it’s no surprise someone created USBIP Connect. Setup is simple but there’s a few important details to get it working correctly.

First, you need to install the official WSL extension and connect to WSL. Install USBIP Connect from the marketplace only after connected, otherwise things won’t work. You’ll know if you’ve done the setup correctly if you see USBIP Connect listed under the “WSL: UBUNTU” list of extensions, not “LOCAL.”

USBIP Connect for VS Code installed in WSL

The extension adds a simple “Attach” and “Detach” button to the status bar and corresponding commands to the Command Palette. Simplicity is the name of the game, which is a plus for a VS Code extension.

The only issue is that permissions are not automated like in WSL USB Manager, so you’ll get an error the first time you try to Attach a device.

USBIP Connect permission error

You’ll either need to use a terminal with Administrator privileges or WSL USB Manager, which is what I did while writing this post.

USB all the things, again!

So there you have it, two different GUIs for managing USB devices with WSL2. Hopefully they help the remaining Windows devs who prefer something graphical over using the commandline to get work done with a little less frustration. But if you run into any issues, please post in our forum.

Jonathan Beri
Jonathan Berihttps://golioth.io
Jonathan Beri is the founder and CEO of Golioth, a straightforward commercial IoT development platform built for scale. Jonathan has spent more than a decade building IoT solutions at companies like Google, Nest, Particle & WeWork. If you really want to get him going, ask him how he would build a real holodeck.

Post Comments

No comments yet! Start the discussion at forum.golioth.io

More from this author

Related posts

spot_img

Latest posts

Useful Zephyr Shells for IoT Development

The Zephyr shell subsystem will help you directly interact with and troubleshoot your IoT hardware. This post details our most commonly used commands, as well as a listing of all Zephyr shell modules that we could extract from a recent project.

Guide to Securely Store Credentials on an nRF91 Modem

The Nordic nRF91 modems include secure storage for TLS credentials. This may be used to authenticate with Golioth. The assets are stored separately from the firmware, and once written, they cannot be read back from the device. This guide shows the process of storing and using credentials.

Adding sound to the Aludel Elixir based Reference Designs

This post highlights moving code from one Zephyr project to another and all the considerations for code portability.

Want to stay up to date with the latest news?

Subscribe to our newsletter and get updates every 2 weeks. Follow the latest blogs and industry trends.