Skip to content

Work with Local Repository, dev files in WSL2 #100

@Because789

Description

@Because789

Ok, I feel very, very stupid now, but after like 5h of trying I figured out my issue, so I'm gonna leave the solution here, if anyone else runs into the same thing.

The problem

I'm a hobbyist developer and I do my stuff in this environment:

  • Windows 11 Pro 23H2
  • WSL 2.0.14.0 with Ubuntu 22.04
  • Docker Engine 25.0.3 (no Docker Desktop)
  • VS Code on Windows with the Remote Development extensions
  • Edge on Windows for testing in Browser
  • Dev files are on the file system of the Ubuntu instance

I wanted to try the awesome Astro Starter template which uses Sveltia CMS. I cloned it to my dev folder on Ubuntu, set up a dev container and got it running on localhost:4321 in no time. When I went to localhost:4321/admin/index.html, I got the Work with Local Repository button as expected and described here, great!

But when I clicked on the button, unlike in the Windows Explorer:

ViewInExplorer

There was no Linux file system available:

ViewInFolderChooser

I figured, that was quite logical and it seemed to fit the note on WSL in the README.md.

The solution

Without getting in all the details on how I wasted my time the next hours (I even set up an Ubuntu bear metal server, where it worked beautifully), it turns out I'm just stupid and the WSL integration is just great and it works out of the box without changing anything, you just have to click the right dropdown:

DropdownOpen

After choosing Linux here, I was able to choose my astro-starter folder on the Ubuntu file system and I was able to edit files in Sveltia without issues. Hope that helps others to avoid headaches...

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