A guide to creating a minimal busybox-based WSL image and bootstrapping Guix inside it.
- Guix package manager installed on an existing Linux system (e.g., Ubuntu)
- WSL 2 enabled on Windows
guix pack -f tarball \
-S /bin=bin \
-S /usr/bin=bin \
-S /sbin=sbin \
busyboxThis outputs a store path like /gnu/store/...-tarball-pack.tar.gz. Copy it to a location accessible from Windows.
cp /gnu/store/...-tarball-pack.tar.gz ~/busybox.tar.gzwsl --import guix C:\Distros\Guix C:\path\to\busybox.tar.gz
wsl -d guixThe bare busybox image is missing files WSL expects. Create them inside the distro:
mkdir -p /etc /root
echo "root:x:0:0:root:/root:/bin/sh" > /etc/passwd
echo "root:x:0:" > /etc/group
touch /etc/fstabWSL needs /bin/mount to process /etc/fstab. Copy busybox to /bin/mount:
cp /bin/busybox /bin/mountThen from PowerShell, terminate and restart:
wsl -t guix
wsl -d guixThe Guix daemon requires a dedicated group and build users:
addgroup guixbuild
for i in 1 2 3 4 5 6 7 8 9 10; do
adduser -D -G guixbuild -s /bin/false -h /var/empty "guixbuilder$i"
doneguix-daemon --build-users-group=guixbuild &
guix archive --authorize < /var/guix/profiles/per-user/root/current-guix/share/guix/ci.guix.gnu.org.pubguix pull- If you created the tarball with
guix pack, busybox lives under/bin/(via the-S /bin=binsymlink), not at/busyboxlike some other guides assume. - If you want to disable WSL automounting (to avoid fstab errors), create
/etc/wsl.conf:
[automount]
enabled = false
[boot]
systemd = falseThen wsl --shutdown and restart the distro from PowerShell.
Main source: https://github.com/giuliano108/guix-packages/blob/master/notes/Guix-on-WSL2.md#minimal-rootfs-archive