Hi folks
this is now easily do-able but you need a Linux VM / Host system to initiate the process.
What you basically have to do is to create a .TAR image of the distro you want and then import it into the wsl.
so
1) on Linux VM / Host install docker -- e.g sudo pacman -S docker
2) get the distro docker image e.g for archLinux : docker pull archlinux
3) start a container - this will be the base volume for the WSL2 system : docker run -it --name archlinux-wsl archlinux
4) from the running container set up base user stuff you want e.g in the case of arch Linux get docker image up to date
pacman -Syu
and add user on the docker image to the sudoers group.
pacman -Sy sudo vi
export EDITOR=/usr/bin/vi
visudo
# in the editor, uncomment the line "%wheel ALL=(ALL) NOPASSWD: ALL"
useradd -G wheel,users -m username (User needs to be in the sudoers group if you don't want to run as root)
passwd 123456789f
# enter the password for the container user
pwconv
chmod 0744 /etc/shadow /etc/gshadow (optional only do it if you get "access denied")
exit
now we make the tar file :
5) docker export --output archlinux-image-files.tar archlinux-wsl
6) on the WINDOWS host run :wsl --import archlinux (a directory on your computer that will store the distribution files) .\archlinux-image-files.tar
7) wsl -d archlinux to start archlinux in wsl
and have fun -- note this is only the CLI version -- might be possible to install GNOME,MATE,KDE or whatever - will try that later.
Cheers
jimbo
this is now easily do-able but you need a Linux VM / Host system to initiate the process.
What you basically have to do is to create a .TAR image of the distro you want and then import it into the wsl.
so
1) on Linux VM / Host install docker -- e.g sudo pacman -S docker
2) get the distro docker image e.g for archLinux : docker pull archlinux
3) start a container - this will be the base volume for the WSL2 system : docker run -it --name archlinux-wsl archlinux
4) from the running container set up base user stuff you want e.g in the case of arch Linux get docker image up to date
pacman -Syu
and add user on the docker image to the sudoers group.
pacman -Sy sudo vi
export EDITOR=/usr/bin/vi
visudo
# in the editor, uncomment the line "%wheel ALL=(ALL) NOPASSWD: ALL"
useradd -G wheel,users -m username (User needs to be in the sudoers group if you don't want to run as root)
passwd 123456789f
# enter the password for the container user
pwconv
chmod 0744 /etc/shadow /etc/gshadow (optional only do it if you get "access denied")
exit
now we make the tar file :
5) docker export --output archlinux-image-files.tar archlinux-wsl
6) on the WINDOWS host run :wsl --import archlinux (a directory on your computer that will store the distribution files) .\archlinux-image-files.tar
7) wsl -d archlinux to start archlinux in wsl
and have fun -- note this is only the CLI version -- might be possible to install GNOME,MATE,KDE or whatever - will try that later.
Cheers
jimbo
My Computer
System One
-
- OS
- Windows XP,7,10,11 Linux Arch Linux
- Computer type
- PC/Desktop
- CPU
- 2 X Intel i7