Mount Windows paths into WSL2

Hello,

I’m facing a small problem and I don’t really understand how it works.

I’m running a simple node app into a container with nodemon to get a “hot reload” whenever I make a change in local.

But my change are not reflected in the container, so nodemon doesn’t refresh my app.
After some research, I found i can use the legacy mode but also found that this problem is related to the fact i’m using Windows folder, that is mapped to my container, and this, bypass the linux Kernel. So I learn we can mount our drive into the Linux filesystem and it can solve the problem.

with PowerSheel started in admin mode, I try to did it :
with “wsl --mount ‘myDriverID’”
But It say “Process can’t be executed, because it used by another proccess”.

In my Windows explorer I can go to the Linux filesystem, I Created a folder into the root folder, copy my project into, and run VSCode but I can’t use docker

How can I place my project into this filesystem and use Docker ?

I hope someone can help me, thanks a lot.

Just run "docker --version to make sure docker is accessible on your WSL. If not, start Docker Desktop go to settings and make sure to enable docker to your wsl environnement.

Have you actually tried what it recommends you to do in the screenshot you shared?

Hint: if you would, you should have stumbled across this section on that particular page https://docs.docker.com/go/wsl2/#enabling-docker-support-in-wsl-2-distros

hey, thanks for your reply.

I solve the problem. I have accessed to the filesystem via my explorer and into Ubuntu/home/user/docker i put my project.

I opened it with VS code and WSL extension installed on it and simply build and run my image/container from there.

The problem from the screen was because on Docker Desktop, “Enable integration with my default WSL distro” option was not enabled.

Don’t really know if it’s ok to do it this way but now all work fine and I got the hot refresh from nodemon.

Yep that was my point… I was on my smartphone so it was not possible at that time to be more precise.

1 Like