Skip to content

Folder to wsl2 is mounted from windows filesystem #1886

Open
@ggjulio

Description

@ggjulio

Is your feature request related to a problem?

It seem that specifying a linux folder as Workspace source is bind mounted from the windows fs instead of linux. \\wsl.localhost\Ubuntu\home\user\repo-git

Which slow a lot operations on files, the workspace is unusable, waited +30min, but fleet/vscode did not ended the indexing and configuration the workspace, via vscode + devcontainer, it takes <2/3min max

Image

Which solution do you suggest?

When \\wsl.localhost\ is detected at the beginning of the path, we're on windows trying to bind mount a linux folder, usually using docker desktop.
In that case, when using the default docker provider, execution docker commands in the default wsl distro and triming the two first elements path would make sense to avoid the very slow IO issue.

trim path: \\wsl.localhost\Ubuntu\home\user\repo-git --> /home/user/repo-git

PS> docker run -v \\wsl.localhost\Ubuntu\home\user\repo-git:/workspaces/git-repo ubuntu bash

becomes:

PS> wsl.exe "docker run -v /home/user/git-repo:/workspaces/git-repo ubuntu bash"

It seem it's what vscode do, they run several commands in the user's wsl distro. Example logs:

[2023-09-19T10:31:09.924Z] Start: Resolving Remote
[2023-09-19T10:31:09.924Z] Dev Containers 0.309.0 in VS Code 1.82.2 (abd2f3db4bdb28f9e95536dfa84d8479f1eb312d).
[2023-09-19T10:31:09.989Z] Setting up container for folder or workspace: c:\Users\someone\projects\app1
[2023-09-19T10:31:09.992Z] Start: Run: wsl -l -v
[2023-09-19T10:31:10.560Z] Stop (568 ms): Run: wsl -l -v
[2023-09-19T10:31:10.562Z] Start: Run: wsl -d Ubuntu-20.04 -e /bin/sh -c echo ~
[2023-09-19T10:31:11.159Z] Stop (597 ms): Run: wsl -d Ubuntu-20.04 -e /bin/sh -c echo ~
[2023-09-19T10:31:11.166Z] Start: Run: wsl -d Ubuntu-20.04 -e /bin/sh -c cd '/home/someone' && /bin/sh
[2023-09-19T10:31:11.220Z] Start: Run in host: id -un

Which alternative solutions exist?

Maybe specifying the daemon injected into the wsl distro by docker desktop would work, relates to #1839.
Or maybe via ssh provider but require extra configuration on wsl2.

Additional context

  • Docker desktop with wsl2 backend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions