Hacker News new | past | comments | ask | show | jobs | submit login

> Using Docker with WSL is a breeze

Have there been some updates recently? About a year ago we were trying to use Docker on a windows host at work, and dealing with things like file system paths was a nightmare




Several months ago. A year is a long time for the microsoft bleeding edge these days. You can come back to something a year later and it is completely revised in many respects. Bugs gone, new ones created and discovered, whole subsystems rewritten etc...


enable WSL2, install Docker Desktop in windows and it just works. you dont even need to install docker in WSL, its done automatically and kept updated by docker-desktop.


You might also need to update some settings in your BIOS to enable the hypervisor, but once you get it working it's a breeze to use.

WSL is really remarkable.


WSL is Linux. They run the unmodified Linux kernel in a pico-process an docker runs on top of that.

Technically there shouldn’t be file system issues right?


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.

https://blog.simos.info/how-to-run-lxd-containers-in-wsl2/


What makes you think WSL2 isn’t able to run LXC?


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...


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.


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.


It's not an unmodified kernel.


Can you explain what modifications you believe it has that typical installations of Linux don't?


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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: