-
-
Save hesam-init/75113b20da1df408c4a57e6ed4516170 to your computer and use it in GitHub Desktop.
Install Arch and Void Linux on WSL2
This file contains hidden or 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
# 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 wsl version of arch : https://geo.mirror.pkgbuild.com/wsl/latest | |
# guide : https://wiki.archlinux.org/title/Install_Arch_Linux_on_WSL | |
> wsl --install archlinux | |
> wsl --install --from-file WSL_image | |
> wsl --install --from-file arch.wsl | |
# Enter wsl machine : | |
> wsl -d $DISTRONAME | |
> wsl -d archlinux | |
$ pacman -Syu fish sudo nano | |
# Add user command : | |
$ useradd -m -G wheel -s /bin/bash $USERNAME | |
$ passwd $USERNAME | |
# Example : | |
$ useradd -m -G wheel -s /bin/fish hesam | |
$ passwd hesam | |
# Default user | |
$ echo -e "[user]\ndefault=hesam" > /etc/wsl.conf | |
# Grant sudo | |
$ sed -i 's/# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers | |
# Set distro as default : | |
> wsl --set-default archlinux | |
> wsl --terminate archlinux | |
> wsl -d archlinux | |
# Reboot system after install | |
> Restart-Computer -Force |
This file contains hidden or 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
# 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.exe --import Void C:\Wsl void-$VERSION.tar | |
# Enter wsl machine : | |
> wsl -d $DISTRONAME | |
> wsl -d Void | |
# 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 fish-shell | |
$ xbps-remove base-voidstrap | |
$ xbps-reconfigure -fa | |
# Add user command : | |
$ useradd -m -G wheel -s /bin/bash $USERNAME | |
$ passwd $USERNAME | |
# Example : | |
$ useradd -m -G wheel -s /bin/fish hesam | |
$ passwd hesam | |
# Default user | |
$ echo -e "[user]\ndefault=hesam" > /etc/wsl.conf | |
# Grant sudo | |
$ sed -i 's/# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers | |
# Set distro as default : | |
> wsl --set-default Void | |
> wsl --terminate Void | |
> wsl -d Void | |
# Reboot system after install | |
> Restart-Computer -Force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment