wsldistro

package
v0.49.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package wsldistro manages the dedicated jerboa WSL2 distribution: a versioned, self-contained Linux environment (jerboad + qemu + firecracker + kernel toolchain) imported via `wsl --import`, the way Docker Desktop ships its own distro. Running the daemon inside it removes any dependency on the user's WSL setup, on jerboad being on PATH, or on host sudo.

Index

Constants

View Source
const DaemonBinaryPath = "/usr/local/bin/jerboad"

DaemonBinaryPath is where jerboad lives inside the distro (baked there by the rootfs image and replaced in place on upgrade).

View Source
const Name = "jerboa"

Name is the registered WSL2 distribution name.

View Source
const RootfsArtifact = "jerboa-rootfs-amd64.tar.gz"

RootfsArtifact is the release asset holding the distro root filesystem.

Variables

This section is empty.

Functions

func DefaultInstallDir

func DefaultInstallDir() string

DefaultInstallDir returns where the distro's ext4 disk is stored on Windows (%LOCALAPPDATA%\jerboa\distro), falling back to ~/.jerboa/distro.

func EnsureNestedVirtualization

func EnsureNestedVirtualization() (changed bool, path string, err error)

EnsureNestedVirtualization makes sure %USERPROFILE%\.wslconfig enables nested virtualization under the [wsl2] section, which firecracker needs for /dev/kvm. It edits the file in place, preserving any other settings, and returns whether it changed anything. A change only takes effect after `wsl --shutdown`, so the caller should tell the user to restart WSL when changed is true.

func Exists

func Exists() (bool, error)

Exists reports whether the jerboa distro is registered with WSL.

func IP

func IP() (string, error)

IP returns the IPv4 address of the running distro's primary interface. WSL2 loopback forwarding does not reach a secondary distro, so the Windows client dials this address directly. Querying it starts the distro if it is stopped.

func Import

func Import(installDir, rootfsTar string) error

Import registers the distro from rootfsTar, storing its disk under installDir.

func InstallDaemonBinary

func InstallDaemonBinary(localPath string) error

InstallDaemonBinary streams the file at localPath into the distro, replacing the jerboad binary atomically (write-then-rename, so a crash never leaves a truncated binary). Piping over stdin avoids translating the Windows path into the distro's /mnt view. The caller should stop the daemon first to avoid ETXTBSY on the running binary.

func List

func List() ([]string, error)

List returns the names of all registered WSL2 distributions.

func Unregister

func Unregister() error

Unregister removes the distro and all of its data.

func WSLConfigPath

func WSLConfigPath() (string, error)

WSLConfigPath returns the path to the host's per-user .wslconfig (%USERPROFILE%\.wslconfig).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL