3

I am following the tutorial here: https://docs.microsoft.com/en-us/windows/wsl/wsl2-mount-disk

I can get the listing of my drives by running: GET-CimInstance -query "SELECT * from Win32_DiskDrive" which produces the following output:

PS C:\WINDOWS\system32> GET-CimInstance -query "SELECT * from Win32_DiskDrive"

DeviceID           Caption                           Partitions Size         Model
--------           -------                           ---------- ----         -----
\\.\PHYSICALDRIVE0 SK hynix SC311 SATA 512GB         3          512105932800 SK hynix SC311 SATA 512GB
\\.\PHYSICALDRIVE1 Generic STORAGE DEVICE USB Device 0                       Generic STORAGE DEVICE USB Device
\\.\PHYSICALDRIVE2 Generic STORAGE DEVICE USB Device 3          127861977600 Generic STORAGE DEVICE USB Device
\\.\PHYSICALDRIVE3 Generic STORAGE DEVICE USB Device 0                       Generic STORAGE DEVICE USB Device

I think the drive I am trying to mount is \\.\PHYSICALDRIVE2 as it is a 128gb sd card I am trying to mount.

However when I try to run this command: wsl --mount \\.\PHYSICALDRIVE2 I get the follow error stating there is no --mount option:

Invalid command line option: --mount
Copyright (c) Microsoft Corporation. All rights reserved.

Usage: wsl.exe [Argument] [Options...] [CommandLine]

Arguments for running Linux binaries:

    If no command line is provided, wsl.exe launches the default shell.

    --exec, -e <CommandLine>
        Execute the specified command without using the default Linux shell.

    --
        Pass the remaining command line as is.

Options:
    --cd <Directory>
        Sets the specified directory as the current working directory.
        If ~ is used the Linux user's home path will be used. If the path begins
        with a / character, it will be interpreted as an absolute Linux path.
        Otherwise, the value must be an absolute Windows path.

    --distribution, -d <Distro>
        Run the specified distribution.

    --user, -u <UserName>
        Run as the specified user.

Arguments for managing Windows Subsystem for Linux:

    --help
        Display usage information.

    --install [Options]
        Install additional Windows Subsystem for Linux distributions.
        For a list of valid distributions, use 'wsl --list --online'.

        Options:
            --distribution, -d [Argument]
                Downloads and installs a distribution by name.

                Arguments:
                    A valid distribution name (not case sensitive).

                Examples:
                    wsl --install -d Ubuntu
                    wsl --install --distribution Debian

    --set-default-version <Version>
        Changes the default install version for new distributions.

    --shutdown
        Immediately terminates all running distributions and the WSL 2
        lightweight utility virtual machine.

    --status
        Show the status of Windows Subsystem for Linux.

    --update [Options]
        If no options are specified, the WSL 2 kernel will be updated
        to the latest version.

        Options:
            --rollback
                Revert to the previous version of the WSL 2 kernel.

Arguments for managing distributions in Windows Subsystem for Linux:

    --export <Distro> <FileName>
        Exports the distribution to a tar file.
        The filename can be - for standard output.

    --import <Distro> <InstallLocation> <FileName> [Options]
        Imports the specified tar file as a new distribution.
        The filename can be - for standard input.

        Options:
            --version <Version>
                Specifies the version to use for the new distribution.

    --list, -l [Options]
        Lists distributions.

        Options:
            --all
                List all distributions, including distributions that are
                currently being installed or uninstalled.

            --running
                List only distributions that are currently running.

            --quiet, -q
                Only show distribution names.

            --verbose, -v
                Show detailed information about all distributions.

            --online, -o
                Displays a list of available distributions for install with 'wsl --install'.

    --set-default, -s <Distro>
        Sets the distribution as the default.

    --set-version <Distro> <Version>
        Changes the version of the specified distribution.

    --terminate, -t <Distro>
        Terminates the specified distribution.

    --unregister <Distro>
        Unregisters the distribution and deletes the root filesystem.

The version of WSL am using:

PS C:\WINDOWS\system32> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Stopped         2

How do I mount the drive properly with wsl?

Dick
  • 33
  • 1
  • 1
  • 4
  • Is this WSL1 or WSL2? What is the filesystem on the volume you are attempting to mount? BTW, WSL2 is NOT BETTER than WSL1. It is different and offers things WSL1 didn't support. I myself prefer WSL1.. just sayin' – Señor CMasMas Mar 07 '22 at 15:40
  • @SeñorCMasMas WSL2. As per Daniel's answer below, you need to be running Windows 11 Build 22000 or higher. – Dick Mar 07 '22 at 16:01
  • My question via comment had nothing to do with that. There are other ways around the problem depending on the answers to the questions I asked. Although he is not wrong for your specific question, your problem remains a problem. – Señor CMasMas Mar 07 '22 at 17:19
  • 1
    @SeñorCMasMas Absolutely! having a "Windows Subsystem for Linux" that is unable to mount linux filesystems is bizarre. I guess Microsoft is still in no hurry to enable connectivity to other filesystems. Also thanks for your comment on wsl1. I haven't tried to use it yet. I am familiar with virtual box, so will go that route as have used it many times before. – Dick Mar 07 '22 at 17:53
  • @Dick As noted in the answer below, Microsoft has enabled this feature in WSL2 in Windows 11, so it's a bit confusing that you say that "Microsoft is in no hurry" when they've already released it. – NotTheDr01ds Mar 07 '22 at 21:55
  • 1
    @NotTheDr01ds That is fine if you have windows 11. Most of the corporate world is still on Windows 10, and a good portion of the hardware in the wild today cannot upgrade to windows 11 without using workarounds. So yes, I still stand by my comment that Microsoft is not in a hurry. – Dick Apr 11 '22 at 17:53
  • @Dick It sounds like you are saying that Microsoft is in no hurry to *backport* this new feature to an older Windows release. And sure, that would be accurate. Microsoft has released thousands of features over the years that are only available on newer Windows releases. Since WSL is a part of Windows, it's entirely possible we will never see this feature released on the older Windows version. This goes for lots of features that those in corporate environments (or with hardware that doesn't support Windows 11) will just have to wait for until they upgrade, unfortunately. – NotTheDr01ds Apr 11 '22 at 23:05

1 Answers1

1

You don’t. As per Microsoft page:

Prerequisites

You will need to be on Windows 11 Build 22000 or higher to access this feature. You can join the Windows Insiders Program to get the latest preview builds.

Until then, use a “real” VM. Because Hyper-V is also very insufficient in this regard, I suggest looking into VirtualBox and VMware Player (or Workstation, if you have too much money).

Daniel B
  • 60,360
  • 9
  • 122
  • 163
  • 3
    Just a heads-up that the Microsoft doc is a little misleading on this particular topic. Build 22000 was the first generally-available (*not* preview) Windows 11 release. So any *released* version of Win 11 has this feature. Preview/Insider builds are no longer needed. – NotTheDr01ds Mar 07 '22 at 19:36
  • 1
    This result came up when I was trying to figure out how to mount a Windows external drive. I found the answer to that here: https://superuser.com/a/1209698/89165 – Daniel Kaplan Jul 29 '22 at 00:58