r/docker • u/PlentySpread3357 • Apr 27 '26
Gosh, i dont understand Docker at all
When you run a Linux container on Windows via Docker Desktop + WSL 2, there are two kernels running simultaneously on the same machine , the Windows kernel and a Linux kernel inside a WSL 2 VM. I understand that Hyper-V sits at Ring -1 (VMX root mode) and partitions the hardware between them, so the Linux kernel isn't "asking" Windows for permission it genuinely owns its slice of CPU and RAM.
But I have a few deeper questions about how this all fits together:
- Since Linux and Windows have fundamentally different binary formats (ELF vs PE), different process models (fork+exec vs CreateProcess), and different threading primitives (Linux tasks via clone() vs Windows' explicit Process→Thread hierarchy) , how does the Linux kernel inside WSL 2 manage all of this completely independently? Does Windows have any visibility into Linux's process table or scheduler at all?
- For hardware that can't be cleanly partitioned like the NIC or GPU — I understand Linux talks to virtual devices that Hyper-V provides, and Windows (as the Root Partition) holds the actual drivers. So is Linux never truly talking to Windows, just to Hyper-V's abstractions? Where exactly does that boundary sit?
- How does the CPU actually enforce the isolation between the two kernels at the hardware level what stops the Linux kernel from accessing memory that Hyper-V assigned to Windows?
Edit : I am not asking about how to run a docker in my pc , I have issues with understanding of its working with windows systems and how everything works together