thank you @puneetse for the reference, I saw it and wanted to answer after WSLConf
Please start here: [Tutorial] Clearlinux on WSL2
I will have to update it for showing how you can do the same from the Docker image.
If you have docker installed, here is a the commands (in a nutshell):
- docker run -it --name wslclear clearlinux
- [inside the container]
2.1 swupd update
2.2 useradd -m -s /bin/bash USERNAME # replace USERNAME by your own
2.3 vi /etc/wsl.conf # edit it to add your user to be the default
Windows Terminal
[automount]
enabled = true
options = “metadata,uid=1000,gid=1000,umask=22,fmask=11,case=off”
mountFsTab = true
crossDistro = true
[network]
generateHosts = false
generateResolvConf = true
[interop]
enabled = true
appendWindowsPath = true
[user]
default = USERNAME
2.4 swupd install sudo
2.5 usermod -aG wheelnopw
2.6 exit
- docker export -o wslcleartemp.tar wslclear
- mkdir wslcleartemp
- sudo tar -xf wslcleartemp.tar --same-owner -C wslcleartemp
- cd wslcleartemp
- sudo tar -cf …/wslclear.tar --same-owner --hard-dereference *
- cd …
- mkdir /mnt/c/wsldistros
- mv wslclear.tar /mnt/c/wsldistros/
- [start Powershell]
- wsl.exe --import wslclear c:\wsldistros\wslclear c:\wsldistros\wslclear.tar
The issue (currently) is that WSL does not handle the hard links in the TAR files, so we need to extract and re-tar the content with the “–harde-dereference”
Hope this helps, and I will monitor this thread in case you have further questions or encounter any issues (hopefully not eheh)