57

When running docker desktop on Windows with Hyper-V I have a single VM called DockerDesktopVM where my Linux VM is running with it's containers inside.

DockerDesktopVM

However when I run docker desktop with the WSL engine I see that it creates 2 WSL distros.

  1. docker-desktop
  2. docker-desktop-data

enter image description here

I can shell into the docker-desktop distro like I would any other distro.

enter image description here

But trying to do the same to docker-desktop-data just bounces me out.

enter image description here

So my question is what is the docker-desktop-data distro for and why does it exist separately from the docker-desktop distro? Clearly the name implies data but what specific data and why can't I jump into the distro as I would any other?

3 Answers 3

52

The docker-desktop-data distro is used by the docker-desktop distro as the backing store for container images etc. When docker is run under Hyper-V the same result is achieved by mounting a VHD in the Hyper-V image but this isn't possible with WSL2.

To quote from the docker blog introducing the new wsl2 backend:

This will create 2 WSL distros for you:

Docker-desktop, which I’ll call the bootstrapping distro
Docker-desktop-data, which I’ll call the data store distro

From a high level perspective, the bootstrapping distro essentially replaces Hyper-V, while the data store distro replaces the VHD that we previously attached to the VM.

The bootstrapping distro creates a Linux namespace with its own root filesystem based on the same 2 iso files we mentioned earlier (not entirely true, but close enough), and use the data-store distro as the backing store for container images etc. instead of a VHD (WSL 2 does not allow us to attach additional VHD at the moment, so we leverage cross-distro mounts for that).

To prevent you from being able to wsl -d ubuntu-desktop-data the distro has a 0-byte /init.

The blog post is a great introduction to how docker on wsl works.

6
  • 2
    A related question: why is it always running? WSL distros are stopped when there are no processes running inside them. When there are no containers running, why keep these WSL2 distros running? They hog 2GB+ RAM for nothing.
    – Meteorhead
    Jun 4, 2020 at 11:08
  • 3
    They're running because Docker Desktop is running Jun 5, 2020 at 15:53
  • I was wondering, because I need not actually run VMs for Hyper-V to be able to tell me what VMs exist on my machine, that would be silly. If there are no Linux containers actually running, are these WSL2 instances really needed to run constantly?
    – Meteorhead
    Jun 8, 2020 at 9:44
  • 1
    With Hyper-V when you startup Docker Desktop it launches a VM with WSL it will launch the two WSL2 distros, so if you don't start docker the WSL2 instances won't start running. Jun 10, 2020 at 8:20
  • 1
    @OnurDemir, yes that's a known issue for WSL2, sometimes it doesn't return the memory. See the comment towards the end in the official Microsoft docs learn.microsoft.com/en-us/windows/wsl/…, and the GitHub issue they mention: github.com/microsoft/WSL/issues/4166.
    – Uyric
    May 18, 2021 at 21:28
2

Clearly the name implies data but what specific data and why can't I jump into the distro as I would any other?

I'm not sure why this hasn't been noted yet so I'm guessing it's just not known here maybe

If you go into your file browser, at least the built in explorer, but any should work, you can browse to all running WSL2 file systems by going to \\wsl.localhost or \\wsl$ from the same machine.

Because of how WSL2 works the VHDs aren't actually mounted, they're essentially created as network drives that are mounted in the WSL Distro... More or less.

The docker-desktop-data is where all the images & things are stored. \\wsl$\docker-desktop-data\data\docker\volumes\ is litteraly where all your volumes exist. You know how you need an agent to be able to browse volumes in Portainer? You can literally just go here & browse them like any windows folder. The images I believe are in the \\wsl$\docker-desktop-data\data\<<FOLDERS WITH containerd IN THE NAME>>\ folders as the size seems to match up, but sadly it's not really useful to browse & should be treated carefully.

While the accepted answer gives the "what is it" & "why does it exist separately" answers the "What data" & "why can't I get into it" were missing. I personally feel the volume browsing is the most useful thing you'll do there as it's a lot more convenient than any other access method, but the whole file structure is there however you wish to use it

-1

As I can see a '*' just before 'docker-desktop' means it is the head or main branch of it. So '-d' command will run on that only. Try switching it to 'docker-desktop-data' then you may be able to run the specific distribution.

DOCKER-DESKTOP-DATA: enter image description here

1
  • 4
    Actually, no - docker-desktop-data is a non-startable WSL "partition" of sorts, used just for data. It has a 0-byte /init (see here) that keeps you from being able to wsl -d ubuntu-desktop-data (or using it as the default). Dec 16, 2021 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.