To puth into /etc/wsl.conf
If chmod or chown takes no effect on files disk should be mounted with metadata like this.
[automount]
options = "metadata"
Sometimes WSL decide to start the session as a root. Fix it with this snippet
[user]
default=alex
Let's sat you got windows host with docker desktop and free space on c: suddenly disappear.
Seeking lead you to %LOCALAPPDATA%/Docker/wsl where you see *.vhxd file of 32gb size. You can not find any relative
settings in docker-desktop GUI (this is because WSL support is enabled btw), but you want this file to be moved to
another disk, let's say e:
Open command prompt, and there do
wsl shutdown
wsl --export docker-desktop-data e:\dockerdesktop\docker-desktop-data.tar
wsl --unregister docker-desktop-data
wsl --import docker-desktop-data E:\dockerdesktop\data\ e:\dockerdesktop\docker-desktop-data.tar --version 2
Pay attention that no paths are starting or contain underscores or hyphens or dashes - wsl work really poorly with them and wsl's bash does even worse.
After all command completed, restart docker desktop, delete e:\dockerdesktop\docker-desktop-data.tar you no longer need it.
how: microsoft/WSL#4320 (comment) what: https://docs.docker.com/docker-for-windows/wsl/ why: https://docs.microsoft.com/en-us/windows/wsl/compare-versions#understanding-wsl-2-uses-a-vhd-and-what-to-do-if-you-reach-its-max-size