Containers Disappeared After Resetting Docker Desktop to Factory Settings: Is It Possible to Recover Them?

Hello, I’m new to Docker and currently facing a beginner’s issue. Recently, Docker Desktop wouldn’t start and prompted me to reset it to factory settings. Unfortunately, at one point I clicked “Yes,” and although Docker Desktop did start afterward, all of my containers had disappeared.

Before resetting to factory defaults, I made a backup of the C:\ProgramData\DockerDesktop folder, which includes the file C:\ProgramData\DockerDesktop\vm-data\DockerDesktop.vhdx. I’ve tried restoring this file, but my containers still aren’t showing up.

Is there any way to recover them, or is it impossible after a factory reset? I haven’t found anything helpful in the forums. I’m using Windows 10 and Docker Desktop v4.37.0.

Thank you all very much for your help!

Unless you made a backup of the entire state of Docker Desktop, not just the disk, I don’t know how it can be restored. If you had all the required files then I don’t know what it was not successful. I never tried this. My guess is that even if you restored the disk, the WSL distribution (if you used th WSL2 backend) was not restored.

Data should not be stored on container filesystem so I assume you want to restore som anonymous or named volumes. If you can somehow mount the vhdx file in a WSL2 distribution, you could find the content of /var/lib/docker/volumes whch you could try to carefully backup with the original permissions, install a new Docker Desktop and restore the content later by copying it from the WSl2 distribution to a Docker volume.

You can search for articles like this:

First of all, I’d like to thank you for taking the time to try and help me. Although I didn’t follow your method in the article exactly, it did guide me to mount my VHDX file and examine its contents. Essentially, I used qemu-img to convert the image to VDI format and then mounted it in a Linux virtual machine. Unfortunately, I’m afraid the news isn’t good, since the recovered files don’t appear to allow me to restore my containers.

Still, I’m uploading the image here because I’m new to this and I could be mistaken, but it seems like I’ll have to start from scratch. Once again, thank you very much for your help.

Also docker\volumes\metadata.db