Add distros to WSL

Add unix distros without Microsoft store.

Microsoft Windows WSL is a very convinient tool to run various virtual Linux machine without much configuration of a hypervisor.

Most Linux distribution can be installed via the Microsoft store. Some are free, but most are charged for.

However it is easy to install an arbitary distribution from a docker container with afew steps.

Import a Linux rootfs

Prepare a folder for the distributions and create a rootfs tar.

mkdir images
mkdir wsl

docker run --name centos7 centos:7
docker export -o centos-7-rootfs.tar centos7

Now import the rootfs archive into WSL.

wsl --import centos7 .\wsl\centos7 .\images\centos-7-rootfs.tar

Run the Linux vm

Start the distro.

wsl -d centos7
Back

© 2014–2022 Claus Gerull. All rights reserved.