Fedora in Windows Subsystem for Linux (WSL)
This guide is a result of me wanting to run Fedora Linux in Windows Subsystem for Linux and not seeing it in the Microsoft Store like how Ubuntu is available there.
I found that Windows Subsystem for Linux can run any Linux distro, it just takes a little bit of work to get it going.
This is me documenting how I did it for my future-self who may want to do this on a different machine. If this doc helps someone else too, that’s a win!
You’ll need to have Windows Subsystem for Linux installed. So follow these instructions first.
In order to get Fedora installed, we will need the rootfs for Fedora. To get that, download the latest container image from here.
It will be in the a directory like:
The file that needs to be downloaded will have filename in this format:
Decompress the .xz file using 7zip.
Untar the resulting tar file and it will result in some files plus a directory with a named that is a long string.
Inside that directory is a file named “layer.tar”. This is the rootfs for Fedora that we will be using.
Windows Subsystem for Linux
Create a directory where Fedora’s filesystem will be installed to.
Run wsl import to create a new Fedora distribution:
wsl --import Fedora path_to_install_location location_of_fedora_basefs
wsl --import Fedora C:\WSL\Fedora C:\Temp\layer.tar
Get Fedora Running
Start up Fedora (from Powershell):
wsl -d Fedora
Update the system:
The rootfs does not have much, so we will need to have some minimal set of tools for it to be useful. I used package groups to make this process easier.
List package groups:
Install the group you want:
dnf groupinstall "group"
Example (I chose the “Minimal Install” and will add what I need as I go):
dnf groupinstall "Minimal Install"
Do Your Linux Stuff
Don’t forget to add a user and not run around as root.
That’s it! Easy, easy.