This repository contains the automatic build script of minimal Arch Linux on WSL2 RootFS, provided by Azure Zeng.
This repo will build RootFS automatically at 07:24 AM UTC on every 1st day of the month.
Please read this readme carefully before using this RootFS.
-
Please read this README thoroughly before using any RootFS archives provided by this repository.
-
Arch Linux on WSL installation is currently supported by official. Before you start, it is recommended to visit official guide on Arch Linux Wiki.
-
Although supported officially, there might be some problems which is not reproducible in non-WSL Arch Linux installation. Therefore, you should be familiar with normal Arch Linux installations.
-
The RootFS file provided in this repository is only intended to be installed in WSL2. WSL1 is not supported as Microsoft strongly advises using WSL2 now.
Download the latest archlinux.wsl in the Repository Releases.
Double click archlinux.wsl or execute the following to install and configure Arch Linux WSL:
wsl --install --from-file /path/to/archlinux.wslThen OOBE will start immediately if you start the distro. Just follow the instruction and start using!
Import RootFS by using wsl --import <Distro> <InstallLocation> <FileName>.
For example:
wsl --import Arch C:\Users\azurezeng\WSL\Arch archlinux.wslThen execute OOBE script immediately:
$ /usr/lib/wsl/oobe.shFor detailed auto-build process, please visit build-rootfs.yml.
Summary:
-
Pre-installed packages:
basecurlwgetvimnanosudotexinfoman-dbman-pages -
/etc/pacman.d/mirrorlist: Updated fromhttps://archlinux.org/mirrorlist/all/, and all mirrorlist sites are enabled by default. -
/etc/pacman.conf: EnabledColorandParallelDownloadsoptions by default. -
/etc/locale.gen: Enableden_US.UTF-8 UTF-8by default. Then usedlocale-gento generate localization files. -
/etc/sudoers.d/wheel: Enabled%wheel ALL=(ALL:ALL) ALL, which means users inwheelgroup will be able to usesudoby default. -
Removed auto-generated
/etc/pacman.d/gnupgfor security reason (since 7/20/2024). -
/tmpis mounted astmpfsby adding this mount option to/etc/fstab. This behavior is same as default Arch Linux installation. -
Masked Systemd services:
systemd-binfmt.service,systemd-resolved.service,systemd-networkd.service,tmp.mount. -
Disabled the appending of Windows environment variables by default. This setting is done via
/etc/wsl.conf.
-
After importing/installing the RootFS, it is advised to do
pacman -Syuas early as possible, to ensure everything the latest. -
Install
mesamesa-utilsto get WSL GPU acceleration. -
Intel graphics user may experience some problems (see this issue on ArchWSL). A workaround:
sudo ln -sf libedit.so /usr/lib/libedit.so.2- To download all packages (without package re-installing):
pacman -Qq | sudo pacman -Sw -- To enable
systemdsupport, create/etc/wsl.confwith below content:
[boot]
systemd=true- You can set the default user by putting the following content to
/etc/wsl.conf:
[user]
default=USERNAME_IN_WSL-
Error
error: restricting filesystem access failed because landlock is not supported by the kernel!when usingpacmanSome security features are introduced in
pacmanv7.x, requiring a newer kernel version.Update WSL to version 2.5.7 or later to use newer kernel version, or just enable
DisableSandboxsetting in/etc/pacman.conf.
#UseSyslog
Color
#NoProgressBar
CheckSpace
#VerbosePkgLists
ParallelDownloads = 5
DownloadUser = alpm
DisableSandbox