You must be running Windows 10 version 2004 and higher (Build 19041 and higher)
If you are on an earlier version check https://learn.microsoft.com/en-us/windows/wsl/install-manual out.
-
Clone this repository somewhere in your
C:\
drive. For exampleC:\here\
-
Open a PowerShell terminal as administrator, navigate to the clone of this repository. Run the following script.
part1.bat
-
Reboot your machine.
Open a Powershell terminal as a regular user, navigate to the clone of this repository. Run the following script.
part2.bat
If you use Git with SSH you can skip this part.
If you authenticate with https on Git repositories then you need Part 3.
- Install Git Credential Manager on Windows.
- Launch a WSL2 terminal.
Start Menu->Ubuntu
From the WSL terminal run the following script.
$ /mnt/c/here/wsl2-install/part3.sh
-
Install usbipd-win. Open a Powershell terminal as a regular user, navigate to the clone of this repository. Run the following script.
usb-setup.bat
-
Reboot your machine.
-
Install usbip client.
From the WSL terminal execute the part3 script as follows:
$ /mnt/c/here/wsl2-install/usb-share-wsl.sh
Open a PowerShell terminal as administrator
usbipd list
Make a note of the BUSID
of the device you want access to from WSL. To bind
the device, use the following command replacing <busid>
for the bus ID of the
desired device.
usbipd bind --busid <busid>
Launch WSL
Open a new PowerShell terminal as a regular user.
usbipd attach --wsl --busid <busid>
On the WSL Linux terminal type
lsusb
The USB device should now be available on WSL
Check what graphics card you have and install the latest drivers for vGPU.
Device Manager -> Display adapters
Open a PowerShell windows and update WSL
wsl --update
Install the WSL extension on Windows Visual Code, then on your WSL2 terminal you can launch it by typing:
code .