That’s right Darren. The short answer is “containers are Linux”.  The longer answer is you need two key elements: a Kernel name-spacing facility, and second a user-land ecosystem. On the former MacOS doesn’t have something comparable. The closest is App Sandbox, but that is primarily a syscall/ permission filtering mechanism (something also important for containers, but only part of the problem). On the latter, this is what we know of as containers, the user-land is the OS without the kernel, and as such is very much tied to the kernel implementation. Darwin libraries and apps use a different ABI and syscall interface than Linux, so basically every container you use today would be incompatible even if there was kernel support. 

This is the situation with Windows containers (not to be confused with using Podman on Windows or other container envs that run Linux containers). Windows containers have kernel support and a win32 user-land, so to produce them you have to port everything in the image to be native windows code. They are useful but not anywhere near as predominant, since a big part of the value is the portability a Linux container brings. 

In contrast, WSL2 does run a Linux kernel in a shared VM, and internally it is using Linux namespaces itself, with all distributions of a user sharing the same Kernel. They ultimately abandoned the previous syscall emulation approach since the NT kernel and Linux are just too different and the behaviors don’t map cleanly. We leverage WSL2 for the Podman on Windows implementation. 

On Sep 7, 2023, at 11:51 AM, Darren Dupre <darren.dupre@gmail.com> wrote:


OS X has a Mach kernel and a BSD user land. Don’t think Apple is interested in adding containers framework to that. I guess someone could write a kernel extension but it’s a niche use case. 

WSL 2 uses a real Linux kernel doesn’t it? But it’s still a VM inside of Hyper V so I don’t think the performance is any different. WSL 1 is a posix emulation with binary compatibility but no container support under the hood. 

Correct me if I'm wrong about that. 

- Darren 

On Thu, Sep 7, 2023 at 11:19 Mehdi Haghgoo via Podman <podman@lists.podman.io> wrote:
The container experience with podman machine on Windows and mac is not optimal because the containers are slow. 
Mac is a Linux-based OS. So, why can't we create native containers on it as we do on Linux?

That applies to WSL. It's kind of Linux. Why cannot we create native Linux containers on it without resorting to Podman machine and podman clients?


_______________________________________________
Podman mailing list -- podman@lists.podman.io
To unsubscribe send an email to podman-leave@lists.podman.io
_______________________________________________
Podman mailing list -- podman@lists.podman.io
To unsubscribe send an email to podman-leave@lists.podman.io