outerlayer runner init refuses. Install Docker Engine inside WSL2,
as this page shows, or run the
runner image on Docker
Desktop. OuterLayer has not tested the runner image on Windows end to end.
Before you start
You need:- WSL2 with a Linux distribution that runs nothing but the runner. Setup
turns off Windows access in that distribution. After the restart you lose
code .,explorer.exeand/mnt/cin it. Use another distribution for Windows tools. - The runner’s files in the distribution’s own file system. Keep the
config file, its directory and Node.js out of
/mnt. The service cannot start otherwise. - Everything in Before you start on the setup page.
- Git’s credential helper. Git Credential Manager for Windows stops working. Use a helper inside the distribution.
~/.docker/config.json. Remove a"credsStore": "desktop.exe"key, which Docker Desktop leaves behind. With it, pulls and image builds fail.- The default user. A copy of a distribution made with
wsl --exportandwsl --importstarts as root. Set[user] default=in that copy’s/etc/wsl.conf. Otherwise the service runs as root.
Set it up
- In a WSL2 shell, install and start Docker Engine 26 or later. Follow Docker’s instructions for your Linux distribution.
- Install Docker’s Buildx plugin, version 0.18 or later.
-
Check the shell and the engine:
-
From the same shell, follow Set up your first host. Run
outerlayer runner initwithoutsudo: undersudo, it makes no scheduled task. -
If setup says that it turned systemd on, run
wsl --shutdownfrom Windows. Open the distribution again, and runouterlayer runner install --service --config ~/.outerlayer-runner/config.json. - Restart the distribution, so the settings that turn off Windows access apply.
-
Run
outerlayer runner check --config ~/.outerlayer-runner/config.json. Thehook provisionline saysbuiltin:container.
--config ~/.outerlayer-runner/config.json,
as the setup page does. Leave it out if you saved the key with
outerlayer login.
Restart the distribution
Setup writes the settings that turn off Windows access to/etc/wsl.conf.
WSL reads that file only when the distribution starts, and setup does not
restart it. Until you restart, Windows access stays on.
Run these commands from Windows. Use the name that wsl -l shows for
<distribution>.
Keep the runner running
WSL2 shuts a distribution down when no Windows program uses it. So setup makes two things:- A systemd unit inside WSL2, as on Linux. See Run the runner as a service.
- A Windows scheduled task,
outerlayer-runner. It starts the distribution when you log in and keeps it running.
schtasks.exe, through the distribution’s access
to Windows. After the restart, that access is off. A later run of
runner install --service or runner uninstall --service then prints the
schtasks command to run in Windows:
Windows access from the runner’s distribution
Setup turns off three WSL2 defaults in the runner’s distribution. It writes them to/etc/wsl.conf and keeps every other line of the file:
- Interop. With interop on, any Linux process in the distribution can start a Windows program. Windows runs it as the active Windows user.
- The Windows
PATH. WSL adds it to the distribution’sPATH, so a shell findscmd.exeandpowershell.exeby name. - Drive automount. WSL mounts each Windows drive under
/mnt. A process can then read and change the drive with your Windows rights.
/etc/fstab still mounts at
start. WSLg still shows windows on your desktop.
The runner’s account is often in the docker group, which gives root in
practice. A build that must never reach your Windows account needs microVM
builds, which WSL2 does not offer. See WSL2.
To apply these settings to a runner whose distribution does not have them,
run outerlayer runner install --service --config ~/.outerlayer-runner/config.json.
Then restart the distribution.
To turn Windows access back on, delete the three lines and restart the
distribution. runner uninstall --service leaves them in place, because
another runner can share the distribution.
Check with outerlayer doctor
Run outerlayer doctor --config ~/.outerlayer-runner/config.json.
Every other line is in
outerlayer doctor.
Remove the runner
Follow Uninstall the runner.runner uninstall --service removes the unit and the scheduled task. If it
cannot start schtasks.exe, run the remove command from the table above in
Windows.