I'm trying to understand what actually happens under the hood when Docker Desktop runs Linux containers on Windows using WSL 2. My understanding is that Windows and the WSL 2 Linux environment use separate kernels, with Hyper-V providing the virtualization layer and assigning each environment its own CPU and memory resources.
How do the Linux and Windows kernels operate independently despite having different executable formats, process models, and threading systems? Can Windows see or manage Linux processes and scheduling, or are those entirely controlled by the Linux kernel?
For hardware such as networking and GPUs, does Linux communicate only with virtual devices exposed through Hyper-V and WSL integration, while Windows owns the physical hardware and drivers? Where exactly is the boundary between the Linux guest, Hyper-V, and Windows?
Finally, what hardware mechanisms prevent the Linux kernel from accessing memory assigned to Windows or otherwise interfering with the host? I'm mainly asking about the architecture and isolation—not how to install or use Docker.
4 Answers
Docker is mostly a separate layer from this discussion. Inside the Linux environment, the Docker engine uses ordinary Linux features such as namespaces, cgroups, virtual networking, and layered filesystems. A container is not another full kernel or another Windows process model; it is a group of Linux processes isolated by the Linux kernel.
The broad stack is Windows and Hyper-V, then the WSL 2 Linux VM and its Linux kernel, then the Docker engine, and finally the containers. Docker sees Linux APIs. It generally does not care whether that Linux kernel is running on bare metal or inside a VM.
Memory isolation is enforced by the CPU’s virtualization features together with Hyper-V’s page-table management. The guest Linux kernel sees what appears to be a physical address space, but Hyper-V controls how those guest-physical addresses map to real machine memory, using mechanisms such as second-level address translation (EPT on Intel and NPT/RVI on AMD).
If Linux tries to access an address outside the memory assigned to its VM, the translation fails or causes a virtualization exception. Hyper-V controls the mappings and handles privileged operations, so a normal guest kernel cannot simply reprogram the hardware to access Windows memory. CPU privilege levels still exist inside the guest, but the hypervisor provides the additional layer of protection between guest and host.
Hyper-V presents the Linux environment with virtual hardware rather than direct ownership of most physical devices. Networking is typically exposed through a virtual NIC, and communication with the host can use mechanisms such as VMBus and host-side services. The Linux kernel loads drivers for those virtual devices, while Windows or the Hyper-V host handles the physical NIC and its actual hardware driver.
That is still communication with the host, but it happens through defined hypervisor interfaces and virtual-device protocols—not because the Linux kernel is directly calling Windows kernel APIs. Some features, such as file sharing, networking, graphics, and clipboard integration, add explicit host/guest cooperation on top of the basic VM boundary.
The key distinction is that WSL 2 is effectively a lightweight virtual machine. The Linux kernel runs Linux processes, uses Linux system calls, maintains its own process table, and schedules its own threads. Windows does not translate ELF binaries into PE files or emulate Linux’s process model.
Windows and Linux can exchange information through specific integration mechanisms, but they do not share one process table or one scheduler. Docker itself runs against the Linux kernel inside that environment; it does not need to know whether that kernel is running on physical hardware, in Hyper-V, or somewhere else.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures