Last active
March 9, 2021 03:58
-
-
Save lure/e529a2fe7d8d8c8619f695e36c7e017a to your computer and use it in GitHub Desktop.
Revisions
-
lure revised this gist
Mar 9, 2021 . 1 changed file with 14 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,17 @@ ## WSL default user and preserve file cetting( ~/.ssh) 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 ``` ## Docker-desktop on windows with WSL ### No free space on system drive -
lure renamed this gist
Dec 16, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
lure created this gist
Dec 16, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ ## Docker-desktop on windows with WSL ### No free space on system drive 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:` ### move VHDX file to another disk 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. ### Sources of dark knowledge: how: https://github.com/microsoft/WSL/issues/4320#issuecomment-571758494 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