Skip to content
Claude edited this page Jun 30, 2026 · 1 revision

Ephemeral WSL (Linux on a Windows host)

On Windows, spin up a throwaway Linux distro on demand to run Linux software, then tear it down. By default a tiny Alpine minirootfs (a few MB) is downloaded and imported in seconds — your existing distros are never touched.

All wsl.exe calls run with WSL_UTF8=1 for clean output.

Check availability

wsl_status {}
wsl_list_distros {}

Provision a throwaway distro

Download the latest Alpine minirootfs and import it:

wsl_create_temp {}

Returns {name, install_dir, source: "alpine", version}. The auto name looks like llcu-tmp-1782754365-53b8.

Alternatives:

Clone an existing distro (export + import):

wsl_create_temp { "clone_from": "Ubuntu-24.04" }

Import a specific rootfs:

wsl_create_temp { "rootfs_url": "https://.../rootfs.tar.gz" }
wsl_create_temp { "base_tar": "C:\\path\\to\\rootfs.tar" }

Run commands

wsl_run { "distro": "llcu-tmp-1782754365-53b8", "command": "cat /etc/os-release; uname -a" }

Install packages and run something (Alpine uses apk):

wsl_run { "distro": "llcu-tmp-1782754365-53b8", "command": "apk add --no-cache curl && curl --version" }

Optional user, cwd, timeout parameters are supported.

Manage and tear down

List throwaway distros from this session:

wsl_list_temp {}

Destroy one (irreversible — terminates and unregisters the distro, deletes files):

wsl_destroy { "name": "llcu-tmp-1782754365-53b8" }

Destroy everything this session created:

wsl_destroy_all_temp {}

Notes

  • Requires WSL installed on the Windows host (wsl --install). wsl_status reports the version and availability.
  • Throwaway distros live under %LOCALAPPDATA%\lowlevel-cu-wsl\<name>.
  • Always destroy when done to reclaim disk.

Clone this wiki locally