It's even mode magical than that : the docker containers run inside a Linux kernel that is not the one running your WSL2 environment, but the two are in cahoots such that the filesystem is shared and hence container mounts are as fast as they would be on a bare metal Linux box (e.g. -v $PWD:/workdir).
WSL1 used a syscall translation layer in a "pico process", WSL2 simply uses Hyper-V
WSL2 is now just a regular VM
There are some differences in the software thought.
True, but it uses a Linux kernel over hyper-v rather than a wrapper over the win32 api like WSL1 (from what I understand!)
Yes, but it is a slightly modified distro which causes some issues
And not all are minor. Not being be able to run LXC is a deal breaker for me.
You could with a little work in June 2019, not sure what the picture is like now but it might be possible. I've used nix quite a bit on WSL2 which was surprisingly good.
What makes you think WSL2 isn’t able to run LXC?
Re:Docker for Mac M1 RC
by imwillofficial on Friday March 19, 2021 @01:51PM
(#26516304)
WSL2 is a custom Microsoft kernel
If you can't do what you want in it, please open a ticket on https://github.com/Microsoft/WSL - there is also a repo for the kernel, but AFAIK technical feedback is best sent through this one.
(disclaimer: not directly involved with WSL, just trying to help)
How does it work with local directories? Is there a separate file system for WSL, or does the linux kernel translate windows fs paths or something?
It's a separate filesystem, but from WSL you can access Windows files in mounted drives via the `/mnt/<drive letter>` directory.
And vice versa: linux home dir is at something like \\wsl$\ubuntu\home\username
Yes, there is a separate filesystem for WSL, but you can still traverse the Windows filesystem as well, including mounting external drives. You can also browse the linux filesystem from windows explorer as expectded.
https://docs.microsoft.com/en-us/windows/wsl/compare-version...
https://devblogs.microsoft.com/commandline/access-linux-file...
https://community.openbiox.org/d/72-windows-subsystem-for-li...
Re:Docker for Mac M1 RC
by radicalbyte on Friday March 19, 2021 @08:39AM
(#26512576)
It's the same filesystem with some kind of translation/adapter. I love it because it makes supporting our multi-platform OSS projects easy.
You do have the occasional issues regards line endings; that's the only negative I've had so far.
EDIT: H12 is more accurate. The Linux OS is separate, but the Windows FS is mounted to a logical place and "just works".
Yes line endings for configuration files was one of the issues we ran into
I do have locking issues with some sqlite files. I guess it has to do with the fact that the filesystems are shared. I wish I had time to investigate more.
Re:Docker for Mac M1 RC
by imwillofficial on Friday March 19, 2021 @01:50PM
(#26516294)
It’s not an unmodified kernel.
It is basically an unmodified kernel. Like in any purpose-built usage of Linux, it is compiled with specific options and patches for the environment it is made to run in, but you can replace it with your own kernel image if you want.
Re:Docker for Mac M1 RC
by imwillofficial on Saturday March 20, 2021 @11:10PM
(#26527829)
It's not an unmodified kernel.
Can you explain what modifications you believe it has that typical installations of Linux don't?
Re:Docker for Mac M1 RC
by imwillofficial on Monday March 22, 2021 @03:23PM
(#26545491)
Don’t try to rephrase what I said to put words in my mouth.
I stated a fact, which you can verify here if you please.
https://github.com/microsoft/WSL2-Linux-Kernel
Please let us know what you find.
I am not putting words in your mouth. I am trying to understand what your concern is. Every major vendor of Linux distributions maintains their own source tree with patches specific to their usage. That is the way Linux is normally used. So what?
I don't see how it's useful to say that it's a "modified kernel" due to it being packaged for a specific application in a way that is necessary to use it.
Technically there shouldn’t be file system issues right?