Attachext USB to WSL - easy way - no extra software needed


jimbo45

Well-known member
Pro User
VIP
Local time
2:47 AM
Posts
5,861
Location
Hafnarfjörður IS
OS
Windows XP,11 Linux Fedora Rawhide pre-release 45
Hi folks
Following on from my previous post of seamless integration of GUI apps with Windows one might for all sorts of reasons want to share Linux disks over your network and currently accessing the distro directly from anywhere outside the Host machine is well nigh impossible currently.

So easy "Dummies" way !!

1) ensure you've followed instructions in my previous post about running GUI apps on WSL and integrating to windows

2) start a powershell command (windows) in admin mode and enter as shown

Skjámynd 2021-12-21 131115.png

In this case ignore the error message -- that's because the file system on the disk is XFS whereas Windows wsl assumes ext4 -- doesn't matter.


3) simply from your desktop run a linux terminal --in my case konsole. No need tp start the wsl - ist time the console starts it will take a few seconds as behind the scenes the "VM" framework on windows is initialised - then it all works super fast.

4) run the lsblk and mount commands as shown -- I've created a user accessible mount point in /mnt/DV0 and chown -R userid /mnt/DV0 so user has r/w access to it.

Skjámynd 2021-12-21 131817.png


Now access from Windows : just file explorer : go to the linux directory

Skjámynd 2021-12-21 132017.png

This disk can be accessed also from remote NAS servers simply by browsing that directory on the Windows Machine !!! Caveat -- though ONLY BY RDP to the host Windows machine -- currently there's no way of accessing the WSL directly from outside it's HOST machine.

"Seemples" -- Best of both worlds -- Linux decent set of tools with decent streaming and file manager (I hate File explorer) and your favourite Windows applications --- no need for messing about with clunky VM's
 
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 45
Computer type
PC/Desktop
CPU
2 X Intel i7
Screen Resolution
4KUHD X 2
What is the read/write speed that can be achieved?
 

My Computers My Computers

  • At a glance

    Windows 11 ProIntel i9-13900K64GB DDR5-56004090
    OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    Corsair Vengeance i7400
    CPU
    Intel i9-13900K
    Motherboard
    MSI Pro Z690-A WiFi DDR5
    Memory
    64GB DDR5-5600
    Graphics Card(s)
    4090
    Monitor(s) Displays
    BenQ PD3200U
    Screen Resolution
    4K
    Hard Drives
    2TB SSD, 4TB SSD
    PSU
    Corsair 1000W 80+ Gold
    Cooling
    water cooled CPU and air cooled GPU
    Internet Speed
    600 Mbps down and 100 Mbps up
    Antivirus
    Windows Defender
  • At a glance

    Windows 11 ProIntel i9-13900H64GBNvidia 4070 mobile
    Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    ASUS ROG Zephyrus M16
    CPU
    Intel i9-13900H
    Memory
    64GB
    Graphics card(s)
    Nvidia 4070 mobile
    Hard Drives
    1TB SSD
What is the read/write speed that can be achieved?
Who can possibly answer this as it depends on lots of factors e.g. drive type, pc speed etc.
 

My Computer My Computer

At a glance

Windows 11 Pro + Win11 Canary VM.I9 13th gen i9-13900H 2.60 GHZ16 GB solderedIntegrated Intel Iris XE
OS
Windows 11 Pro + Win11 Canary VM.
Computer type
Laptop
Manufacturer/Model
ASUS Zenbook 14
CPU
I9 13th gen i9-13900H 2.60 GHZ
Motherboard
Yep, Laptop has one.
Memory
16 GB soldered
Graphics Card(s)
Integrated Intel Iris XE
Sound Card
Realtek built in
Monitor(s) Displays
laptop OLED screen
Screen Resolution
2880x1800 touchscreen
Hard Drives
1 TB NVME SSD (only weakness is only one slot)
PSU
Internal + 65W thunderbolt USB4 charger
Case
Yep, got one
Cooling
Stella Artois (UK pint cans - 568 ml) - extra cost.
Keyboard
Built in UK keybd
Mouse
Bluetooth , wireless dongled, wired
Internet Speed
900 mbs (ethernet), wifi 6 typical 350-450 mb/s both up and down
Browser
Edge
Antivirus
Defender
Other Info
TPM 2.0, 2xUSB4 thunderbolt, 1xUsb3 (usb a), 1xUsb-c, hdmi out, 3.5 mm audio out/in combo, ASUS backlit trackpad (inc. switchable number pad)

Macrium Reflect Home V8
Office 365 Family (6 users each 1TB onedrive space)
Hyper-V (a vm runs almost as fast as my older laptop)
Who can possibly answer this as it depends on lots of factors e.g. drive type, pc speed etc.

One way to answer the question is using relative speed. For example, one can publish two sets of read/write speeds: one for Windows and one for WSL2.

I run tensorflow on WSL2 with Ubuntu 20.04 LTS. My desktop PC has 2 TB of SSD storage. I am trying to figure out how I should handle large datasets. WSL2 documentation states that it does not support USB drives. If OP can make it work, more power to him.
 

My Computers My Computers

  • At a glance

    Windows 11 ProIntel i9-13900K64GB DDR5-56004090
    OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    Corsair Vengeance i7400
    CPU
    Intel i9-13900K
    Motherboard
    MSI Pro Z690-A WiFi DDR5
    Memory
    64GB DDR5-5600
    Graphics Card(s)
    4090
    Monitor(s) Displays
    BenQ PD3200U
    Screen Resolution
    4K
    Hard Drives
    2TB SSD, 4TB SSD
    PSU
    Corsair 1000W 80+ Gold
    Cooling
    water cooled CPU and air cooled GPU
    Internet Speed
    600 Mbps down and 100 Mbps up
    Antivirus
    Windows Defender
  • At a glance

    Windows 11 ProIntel i9-13900H64GBNvidia 4070 mobile
    Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    ASUS ROG Zephyrus M16
    CPU
    Intel i9-13900H
    Memory
    64GB
    Graphics card(s)
    Nvidia 4070 mobile
    Hard Drives
    1TB SSD
Hi there
The external USB 3 drive seems to perform more than adeqately -- I haven't measured it but I'd assume you'd probably use this in cases where you want to attach Linux formatted drives.

Note the main caveat so far with the WSL is that you can't access either it or any drives connected to it from OUTSIDE its host unless you logon to the Windows Host itself probably via RDP so this rather limits the usefulness of using a command line version of WSL for things like file serving

The problem is that the virtual WSL machine has a NAT address e.g 172.x.x.x while for proper network connectivity on your lan you need bridged mode with addresses 192.x.x.x for example. Note also that the VLAN doesn't support IPV6 although for a home network that shouldn't matter.

So probably Ms needs to improve this feature a bit more -- but this might be a false hope as if it becomes too good then it will be competing with its own HYPER-V system which still could do with a tweak or two for running non Windows VM's or pre win 7 OS'es.

Cheers
jimbo
 

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 45
Computer type
PC/Desktop
CPU
2 X Intel i7
Screen Resolution
4KUHD X 2
.....

So probably Ms needs to improve this feature a bit more -- but this might be a false hope as if it becomes too good then it will be competing with its own HYPER-V system which still could do with a tweak or two for running non Windows VM's or pre win 7 OS'es.

Cheers
jimbo

WSL is a top feature that made me drop my Mac Pro after being 10+ years of Mac user. If Microsoft can further improve the feature, I'd imagine more people will switch over. My main use of this Windows 11 desktop is CUDA accelerated deep learning (e.g., Google's tensorflow stack) and machine learning. I need to have large store space for image files to train my ML models.

Microsoft is in an unique position for it. Hopefully, they don't screw it up.
 

My Computers My Computers

  • At a glance

    Windows 11 ProIntel i9-13900K64GB DDR5-56004090
    OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    Corsair Vengeance i7400
    CPU
    Intel i9-13900K
    Motherboard
    MSI Pro Z690-A WiFi DDR5
    Memory
    64GB DDR5-5600
    Graphics Card(s)
    4090
    Monitor(s) Displays
    BenQ PD3200U
    Screen Resolution
    4K
    Hard Drives
    2TB SSD, 4TB SSD
    PSU
    Corsair 1000W 80+ Gold
    Cooling
    water cooled CPU and air cooled GPU
    Internet Speed
    600 Mbps down and 100 Mbps up
    Antivirus
    Windows Defender
  • At a glance

    Windows 11 ProIntel i9-13900H64GBNvidia 4070 mobile
    Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    ASUS ROG Zephyrus M16
    CPU
    Intel i9-13900H
    Memory
    64GB
    Graphics card(s)
    Nvidia 4070 mobile
    Hard Drives
    1TB SSD
Back
Top Bottom