Last active
May 18, 2024 16:44
-
-
Save kmatt/aad3970a05f72fbbd5f1b9ef7ee1e330 to your computer and use it in GitHub Desktop.
Install Void Linux on WSL2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://gist.github.com/kmatt/71603170556ef8ffd14984af77ff10c5 | |
# prompt ">" indicates Powershell commands | |
# prompt "$" are Linux shell 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 rootfs tarball from https://voidlinux.org/download | |
# ex: https://repo-default.voidlinux.org/live/current/void-x86_64-ROOTFS-20230628.tar.xz | |
# uncompress but do not extract tar file (don't tar -x) | |
> wsl.exe --import $DISTRONAME $STORAGEPATH void-$VERSION.tar | |
> wsl -d $DISTRONAME | |
# optional - update xbps mirrors | |
$ cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/ | |
# if in US https://voidlinux.org/news/2021/10/mirror-retirement.html | |
$ xbps-install -Su xbps | |
$ xbps-install -u | |
$ xbps-install base-system | |
$ xbps-remove base-voidstrap | |
$ xbps-reconfigure -fa | |
$ useradd -m -G wheel -s /bin/bash $USERNAME | |
$ passwd $USERNAME | |
# Default user | |
$ echo -e "[user]\ndefault=$USERNAME" > /etc/wsl.conf | |
# Grant sudo | |
$ sed -i 's/# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers | |
> wsl --terminate $DISTRONAME | |
> wsl -d $DISTRONAME |
https://learn.microsoft.com/en-us/windows/wsl/wsl-config#automount-options
I prefer not to edit the Windows registry if at all possible.
Well the registry is just another place to configure the distro, and these are per-user settings anyway. It's basically the same in the end. Besides, those automount options are not the same setting as setting the default WSL user in general, they're used to give that user the respective permissions.
I don't get what "uncompress but do not unzip tar file" should mean
I don't get what "uncompress but do not unzip tar file" should mean
gunzip rootfs.tar.gz
but do not tar xf rootfs.tar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jsumners it reads the registry first, then the config file.