How to Mount USB Drives in WSL
You mount USB drives in WSL by using either the wsl --mount command for storage devices or the usbipd-win tool for general USB devices.
The Windows Subsystem for Linux (WSL) allows you to run Linux environments directly on Windows. While WSL 2 automatically integrates your Windows C: drive, you’ll need these specific methods to access external USB devices like flash drives or keyboards.
For example, if you’re using WSL 2 on Windows 11 and need to access a USB flash drive, you might use wsl --mount \\.\PHYSICALDRIVE1 --partition 2 to connect it.
Mount USB storage drives in WSL using `wsl –mount \\.\PHYSICALDRIVE` in PowerShell. For other USB devices, install and use `usbipd-win` to bind and attach the device to WSL. Both methods require administrative privileges.
Why mount a USB in WSL?
Mounting your drive lets you move files between your Windows folders and your Linux apps, which can make working on projects much faster. You can also access raw disk data or specific USB hardware directly within your Linux distribution.
What happens when done?
After you follow these steps, your USB drive will appear as a folder inside your Linux environment, letting you read and write files just like any other folder.
Understanding WSL 2 Disk Mounting vs. USBIPD
It’s important to know the difference between mounting a disk in WSL 2 and using USBIPD.
Method 1Mounting Storage Drives with wsl –mount
Note: Keep in mind that you’ll need to run these commands in PowerShell with administrative privileges.
- Open PowerShell as Administrator.
- Identify your disk path by running:
wsl --list --disk - Mount the disk using the path found (e.g., \\.\PHYSICALDRIVE1):
wsl --mount \\.\PHYSICALDRIVE1 --partition 1
Method 2Using USBIPD for USB Passthrough
For devices that aren’t storage, like cameras or security keys, you’ll need to use USBIPD for USB passthrough in WSL.
- Install the usbipd-win installer on Windows.
- In PowerShell, list devices:
usbipd list - Bind the device:
usbipd bind --busid 1-1(Requires Admin) - Attach to WSL:
usbipd attach --wsl --busid 1-1
Troubleshooting and Permissions
If your drive does not appear, ensure you are running Windows 11 build 22000 or higher. Always check that your user account has permission to access the mount point. If you receive a permission error, try using sudo before your mount commands.
Can I mount a USB drive in WSL 1?
No, the wsl --mount feature is exclusive to WSL 2. WSL 1 does not support physical disk mounting or USB passthrough because it does not use a real Linux kernel. You must upgrade your distribution to WSL 2 to use these advanced hardware features.
Why does my USB drive show up in Windows but not in WSL?
WSL does not automatically mount external drives to prevent conflicts with Windows. You must manually attach the disk using the wsl --mount command or the usbipd utility. If the drive is currently in use by Windows, you may need to eject it from Windows first.
How do I safely detach a USB drive from WSL?
To safely remove a drive, first unmount it inside Linux using sudo umount /mnt/f. Then, run wsl --unmount \\.\PHYSICALDRIVE1 in PowerShell. If you used USBIPD, run usbipd detach --busid 1-1 in PowerShell to release the device back to Windows control.
Summary
- Use
wsl --mountfor storage drives like USB sticks. - Use
usbipd-winfor non-storage USB devices like cameras. - Always unmount or detach devices before physically unplugging them to prevent data corruption.
- WSL 2 is required for all hardware passthrough features.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!