Replies: 45 comments 37 replies
-
You need to be using
|
Beta Was this translation helpful? Give feedback.
-
thanks @mscraigloewen I already root user. anyway previous BIG font has # prompt |
Beta Was this translation helpful? Give feedback.
-
There were no takers on the question and no repro to form a WSL actionable. Might get more eyeballs over at Superuser. If you post be sure to include more specifics; I (personally) couldn't follow the ask on this one. |
Beta Was this translation helpful? Give feedback.
-
@craigloewen-msft Your answer is incorrect. sudo does not solve the problem because it is not caused by lack of permissions. That path does not exist. |
Beta Was this translation helpful? Give feedback.
-
@david-sackstein you're totally correct! From my answer, it seems that I wasn't able to repro the error, which means it could be something specific to your setup. I agree with @therealkenc , as of right now it's hard for us to try and repro this so superuser might be your best choice, or posting more repro steps here for us to try. Thanks! |
Beta Was this translation helpful? Give feedback.
-
With Docker Desktop 2.1.7.0 and WSL 2 (Ubuntu), I can see the volumes at /mnt/wsl/docker-desktop-data/data/docker/volumes. Access requires elevated permissions, so you could do |
Beta Was this translation helpful? Give feedback.
-
@kerams Thanks. From linux: |
Beta Was this translation helpful? Give feedback.
-
@mahmoud-samy Thanks for this info. |
Beta Was this translation helpful? Give feedback.
-
@haimat, it might be in in a VHDX file in |
Beta Was this translation helpful? Give feedback.
-
@kerams Ohh yes, that's it, thanks a lot! |
Beta Was this translation helpful? Give feedback.
-
Thanks @mahmoud-samy So what those paths really mean if they're not referring to host machine? (excerpt from Docker Dashboard, same as CLI's docker volume inspect) |
Beta Was this translation helpful? Give feedback.
-
The key seems to be the "virtual" wsl distro named See https://dev.to/kimcuonthenet/move-docker-desktop-data-distro-out-of-system-drive-4cg2 for solution |
Beta Was this translation helpful? Give feedback.
-
@haimat @thejacket Sorry for the late reply AFAIK, when you use WSL integration, two distros will be created for you (docker-desktop & docker-desktop-data) To reach their file system, you need to access it over network
|
Beta Was this translation helpful? Give feedback.
-
This is... not simple. I don't know why it's this hard. I found what I was looking for after dropping into wsl session, and using the find /mnt/host/wsl/docker-desktop-data/data/ -name 'jekyll' |
Beta Was this translation helpful? Give feedback.
-
I found my volume here: |
Beta Was this translation helpful? Give feedback.
-
I've read this thread but found no answer. In my porteiner UI I have this for volume. But when I login to WSL2 it does not has this volume. This path does not exists. I've looked in suggested pass. My main concern is DB. I have mysql docker image and if I have to reinstall OS I want this volume to be saved with windows file history feature. Or NAS backup. That is why I am looking where actual data is. |
Beta Was this translation helpful? Give feedback.
-
Can anyone from the product team reply to our questions?
|
Beta Was this translation helpful? Give feedback.
-
Maybe in WSL2 way, data only exists in Windows systems. |
Beta Was this translation helpful? Give feedback.
-
It's been almost 2 years with no clear answer on this issue. Can someone from Microsoft please respond? |
Beta Was this translation helpful? Give feedback.
-
Hello everyone, this is a Docker response. There are several correct answers above about where the files are stored, and you can read them there. However, that is not an official interface, so we don't guarantee it in future. The recommended way to backup volumes is by mounting them into another container as described in our documentation: https://docs.docker.com/storage/volumes/#backup-restore-or-migrate-data-volumes. We are also considering building some volume manipulation functionality into the Docker Desktop GUI, but we don't have it yet. |
Beta Was this translation helpful? Give feedback.
-
A buddy above talked about how to mount docker's volumes directory into ubuntu so that you can read the contents of these volumes directly in ubuntu. But it's not very clear, so I'll recap what I did.
Where, please replace
Then you can manipulate docker's volume in the |
Beta Was this translation helpful? Give feedback.
-
Follow this git https://github.com/DamionGans/ubuntu-wsl2-systemd-script Steve |
Beta Was this translation helpful? Give feedback.
-
Please check answer at #4176 (reply in thread) |
Beta Was this translation helpful? Give feedback.
-
Hi guys! I have the same problem here and i solved it trying this: I use Ubuntu 20.04 as a subsystem on WSL 2; Then i ran It has started docker again and i created a new volume to located on his path, now located on the referenced on the "docker volume inpect" located in: I hope i can help some of you guys! |
Beta Was this translation helpful? Give feedback.
-
I have found my volumes in |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! I am using WLS 2 (Ubuntu-18.04, Docker version 20.10.20) and I also encountered this problem. I found that there are two ways to locate the volume file: If you save your volume as follows But if you save your volume with "/" before your volume path, e.g. I hope this was helpful. |
Beta Was this translation helpful? Give feedback.
-
\wsl$\docker-desktop-data\data\docker\volumes |
Beta Was this translation helpful? Give feedback.
-
I find the volumes mount path is '\wsl.localhost\docker-desktop-data\data\docker\volumes', with Docker Desktop 4.18.0 |
Beta Was this translation helpful? Give feedback.
-
To make Docker volumes accessible in WSL2 just like in a default Ubuntu installation, these steps work for me:
sudo mkdir -p /var/lib/docker
sudo mount -t drvfs '\\wsl.localhost\docker-desktop-data\data\docker' /var/lib/docker Note: This path is verified with Docker Desktop 4.34.3 (Engine 27.2.0). Older versions might use a different path.
You should see your Docker volumes listed in both outputs. |
Beta Was this translation helpful? Give feedback.
-
as of Docker v4.36 the new location of the volumes can be be mounted thus:
|
Beta Was this translation helpful? Give feedback.
-
ver
at a Windows Command Prompt)Microsoft Windows [Version 10.0.18362.175]
Docker version 18.09.6, build 481bc77
I installed ubuntu-16.04 at WSL2, and also install docker.
I maked volume by docker command.
docker volume create doc_vol
docker volume ls
DRIVER VOLUME NAME
local doc_vol
I looking for the mounted location so I execute command next follow
docker volume inspect doc_vol
[
{
"CreatedAt": "2019-06-18T02:11:35Z",
"Driver": "local",
"Labels": {},
"Mountpoint": "/var/lib/docker/volumes/doc_vol/_data",
"Name": "doc_vol",
"Options": {},
"Scope": "local"
}
]
and then checked the location, It's strange result.
ls -l /var/lib/docker/volumes/doc_vol/_data
ls: cannot access '/var/lib/docker/volumes/doc_vol/_data': No such file or directory
I checked the '/var/lib/docker/volumes/' only one file exist.
ls -l /var/lib/docker/volumes/
total 32
-rw------- 1 root root 32768 Jun 18 11:08 metadata.db
where is mounted doc_vol?
Beta Was this translation helpful? Give feedback.
All reactions