Skip to content

Instantly share code, notes, and snippets.

@kmatt
Last active November 4, 2023 13:57
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kmatt/71603170556ef8ffd14984af77ff10c5 to your computer and use it in GitHub Desktop.
Save kmatt/71603170556ef8ffd14984af77ff10c5 to your computer and use it in GitHub Desktop.
Fedora on WSL2
# From https://fedoramagazine.org/wsl-fedora-33/
# prompt ">" indicates Powershell commands
# https://docs.microsoft.com/en-us/windows/wsl/install-win10
> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# install https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
> wsl --set-default-version 2
# use container image as rootfs from https://github.com/fedora-cloud/docker-brew-fedora/tree/$VERSION/x86_64
# uncompress but do not unzip tar file
> wsl.exe --import $DISTRONAME $STORAGEPATH fedora-$VERSION.tar
> wsl -d $DISTRONAME
$ dnf update
$ dnf install wget curl sudo ncurses dnf-plugins-core dnf-utils passwd findutils
$ useradd -G wheel $USER
$ passwd $USER
$ echo -e "[user]\ndefault=$USERNAME" > /etc/wsl.conf
# optional wslu utilities
$ sudo dnf copr enable wslutilities/wslu
$ sudo dnf install -y wslu
> wsl -t $DISTRONAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment