Attach USB devices to WSL the EASY way


jimbo45

Well-known member
Pro User
VIP
Local time
7:12 AM
Posts
5,931
Location
Hafnarfjörður IS
OS
Windows XP,11 Linux Fedora Rawhide pre-release 46
Hi folks

Running RockyLinux 8 based on RHEL 8 (RockyLinux successor / alternative to CENTOS 8) and similar to FEDORA.

simple way : no special software needed

1) from Powershell on Windows : List disk type devices (including usb drives) and attach the one('s) you want using the DeviceID (\\.\xxxxxxx etc).

mount1.png

OK you notice there's an error here - but that is because WSL assumes file system is ext4 if non windows - on this disk it's actually xfs - so long as xfsprogs is installed on the disro no prob. The disk is now though actually attached to the wsl. It's the 1.8 TB drive as /dev/sdf.

mount2.png
now within the wsl I simply mount it with type auto (mount /dev/xxx -t auto -o rw /mnt/DV0)

read and write access now on external usb device. !! ls shows directories on it.

file system as stated is XFS

mount3.png


Now just two things to try

1) Samba share -- see if this HDD can be found via other machines on network

2) will try and install a Desktop GUI.

Seems WSL2 is getting really useful now - could obviate the need for Linux VM's !!. Quite impressed with performance too.

I'm liking this more and more-- note I'm also running this whole kybosh from an external ssd drive too.

Cheers
jimbo
 
Last edited:

My Computer My Computer

At a glance

Windows XP,11 Linux Fedora Rawhide pre-releas...2 X Intel i7
OS
Windows XP,11 Linux Fedora Rawhide pre-release 46
Computer type
PC/Desktop
CPU
2 X Intel i7
Screen Resolution
4KUHD X 2

Latest Support Threads

Back
Top Bottom