Skip to content

Instantly share code, notes, and snippets.

@trickster
Created April 24, 2026 14:29
Show Gist options
  • Select an option

  • Save trickster/30a33fe5b87a85698a25dc1238419f4f to your computer and use it in GitHub Desktop.

Select an option

Save trickster/30a33fe5b87a85698a25dc1238419f4f to your computer and use it in GitHub Desktop.
Installing Guix as a WSL Image using Busybox

Installing Guix as a WSL Image using Busybox

A guide to creating a minimal busybox-based WSL image and bootstrapping Guix inside it.

Prerequisites

  • Guix package manager installed on an existing Linux system (e.g., Ubuntu)
  • WSL 2 enabled on Windows

1. Create the busybox tarball (on Linux)

guix pack -f tarball \
  -S /bin=bin \
  -S /usr/bin=bin \
  -S /sbin=sbin \
  busybox

This 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.gz

2. Import into WSL (PowerShell)

wsl --import guix C:\Distros\Guix C:\path\to\busybox.tar.gz
wsl -d guix

3. Fix missing /etc files

The 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/fstab

4. Fix the mount issue

WSL needs /bin/mount to process /etc/fstab. Copy busybox to /bin/mount:

cp /bin/busybox /bin/mount

Then from PowerShell, terminate and restart:

wsl -t guix
wsl -d guix

5. Create build users for the Guix daemon

The 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"
done

6. Start the Guix daemon and authorize substitutes

guix-daemon --build-users-group=guixbuild &
guix archive --authorize < /var/guix/profiles/per-user/root/current-guix/share/guix/ci.guix.gnu.org.pub

7. Pull latest Guix

guix pull

Notes

  • If you created the tarball with guix pack, busybox lives under /bin/ (via the -S /bin=bin symlink), not at /busybox like some other guides assume.
  • If you want to disable WSL automounting (to avoid fstab errors), create /etc/wsl.conf:
[automount]
enabled = false

[boot]
systemd = false

Then wsl --shutdown and restart the distro from PowerShell.

@trickster
Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment