DEV Community

Cover image for Using win-usbipd with several distros
Saúl Núñez
Saúl Núñez

Posted on

2 3

Using win-usbipd with several distros

Lately, I've been wanting to test postmarketOS, a project with the intention of giving smartphones a longer life, porting Linux to them and keep those devices supported with newer software for longer.

To install it to your device, you can either download a prebuilt image (easiest, only several devices with mostly complete/complete support) or building an image with pmbootstrap (slightly harder), this last one needs a Linux machine. Oh surprise, it also supports WSL! That day I also learnt that there's a tool to do USB over IP to WSL2, win-usbipd.

So I set it up following these instructions and when trying to attach my tablet to WSL from Windows. I ended with this error:

$ usbipd wsl attach --busid 4-2
usbipd: error: The specified WSL distribution cannot be reached via the WSL virtual switch; try restarting the WSL distribution.
Enter fullscreen mode Exit fullscreen mode

The reason for this error is that I also have Docker installed in this machine, and docker sets up it's own distro, which is set as default, not Ubuntu, the distro that I wanted to use. Also Docker seems to have a few networking gotchas.
Do note, I'm running these commands on prompt with administrator privileges.
Looking around with --help, I stumbled upon with the --distribution parameter:

$ usbipd wsl attach --busid 4-2 --distribution Ubuntu-20.04
Enter fullscreen mode Exit fullscreen mode

Note, you can find the name for all the installed linux distros with wsl --list.

Cover photo by Gabriel Heinzer on Unsplash

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay