Air-gapped deployment on Windows (WSL 2)
Run an air-gapped pack on a Windows machine, and keep it running through closed terminals, sign-outs and restarts.
TL;DR
- For a Windows 10, Windows 11 or Windows Server machine that runs the pack inside WSL 2, with Ubuntu and Docker Engine in WSL.
- The pack flow itself is in Air-gapped deployment. This page covers only what differs on Windows.
- Run the first
./scripts/deploy.shin Ubuntu started from a Windows terminal opened with Run as administrator. - The install sets up Windows so the deployment starts with Windows and survives closed terminals, sign-outs and restarts.
- Do not change
memory=orprocessors=in.wslconfigafter the pack was issued.
Before you start
- Install WSL 2 with Ubuntu: see Windows WSL setup.
- Install Docker Engine inside Ubuntu and make it start with Ubuntu through systemd. Docker Desktop does not work here: it runs only while its Windows user is signed in.
- WSL must come from the Microsoft Store, must be able to run Windows programs, and must mount the Windows drives.
- The install checks all of this first. If something is missing it prints the steps to fix it and "Nothing was changed."
First install
- In Windows, open Windows Terminal with Run as administrator.
- Start Ubuntu:
wsl -d <distro>. - Go to the extracted pack and run
./scripts/deploy.sh.
Only an administrator may register the Windows task that starts WSL with Windows.
What the install sets up on Windows
%UserProfile%\.wslconfiggetsinstanceIdleTimeout=-1under[general], so WSL keeps running after the last terminal closes. Nothing else in the file is changed.- A task
\Pipelogic\wsl-<distro>in Task Scheduler holds the distro open at every Windows start, whether or not anyone is signed in. - A task
\Pipelogic\wsl-<distro>-watchrestarts WSL after a full Windows drive stopped the distro. C:\ProgramData\Pipelogic-WSLholds the watcher's.cmdscript. Only SYSTEM and Administrators may change it.
Later installs over a kept deployment need no elevation when the tasks are already registered as needed.
ppl-offline teardown removes the tasks, unless another deployment in the same distro still needs them. If Windows refuses, it prints the schtasks /Delete line to run as administrator. The .wslconfig line stays: delete it yourself if nothing needs WSL kept running.
When the Windows owner is not an administrator
The install stops and prints lines for an administrator. They run them in Windows PowerShell opened with Run as administrator, with the owner next to them to type the owner's Windows password, which Windows checks and does not keep. Then the owner runs ./scripts/deploy.sh again.
Each line first checks the file the install wrote. If it changed, the line says "The file <path> changed after the install wrote it. Run scripts/deploy.sh again as <user> to write it anew, then run these lines."
What survives what
- Closing the terminal or signing out: the deployment keeps running.
wsl --shutdown: WSL stops for a minute at most, then the task starts it again.- Restart, fast shutdown, Windows update restart: the task starts WSL at every Windows start, and the deployment starts with it.
- An install cut off by any of these: run the install again. It finishes the earlier one.
- A power cut in the middle of an install: the next install says "An install of this pack was cut off by a restart; loading every image again and writing it to disk, which takes longer." Let it finish.
The management console
ppl-offline console prints "Open the management console: http://127.0.0.1:9099" and how to read the token file. It keeps running after its terminal closes and after a restart. Stop it with Ctrl-C in the terminal where it runs. Running it again attaches to it.
Known limits
- WSL cannot sleep (S3) on the machines tested, and sleep was not tested. Hibernate was not tested on real hardware. Keep the machine awake.
- The pack is bound to the CPU and memory WSL shows the distro. Do not change
memory=orprocessors=under[wsl2]in%UserProfile%\.wslconfigafter the pack was issued. - The distro's disk is a file on a Windows drive. The install measures that drive and refuses if it cannot hold the pack. If the drive fills up during the install, free space, run
wsl --shutdownin a Windows terminal and install again. While running, the watcher restarts WSL once the drive has at least 2 GB free. - After a power cut followed by deleting the deployment folder, Docker keeps a half-written image load for about a day. Installs work meanwhile.
- If Ubuntu was started in a way that has no live link to Windows, for example from a service, the install says "This WSL process has no live connection to Windows; open a WSL terminal from Windows and run the same command there." Do that.
Errors
Each entry starts with words the install prints.
- "Windows lets only an administrator register one": the install ran in a terminal that is not elevated. Open Windows Terminal with Run as administrator and run it again.
- "is not an administrator": the Windows owner of the distro is not an administrator. An administrator runs the printed lines, then run the install again.
- "changed after the install wrote it": a file the printed lines check was changed. Run the install again as the same Windows user, then run the new lines.
- "Windows could not register the Windows task": Windows refused the task and said why. Fix what it names, check the Pipelogic tasks in Task Scheduler, and run the same command again from a WSL terminal opened from Windows. The deployment runs meanwhile, but stops when the last terminal closes.
- "Windows did not provide a readable definition for the WSL startup task.": Windows answered with a task definition the install cannot read. Open Task Scheduler, check the task under Pipelogic, then run the install again.
- "Run keep-alive from a Windows terminal opened as administrator to repair it.": the watcher's script differs from what the install writes. Run
ppl-offline keep-alivefrom a terminal opened as administrator. - "This WSL process has no live connection to Windows": Ubuntu was started without a link to Windows, for example from a service. Open Ubuntu from Windows and run the same command there.
- "filled up during the install and this WSL distro's disk turned read-only": the Windows drive holding the distro's disk is full. Free space, run
wsl --shutdownin a Windows terminal, and install again. - "systemd is not running": Docker would not start with the distro. Add
systemd=trueunder[boot]in/etc/wsl.conf, runwsl --shutdown, open Ubuntu again and install again. - "Docker here is Docker Desktop": Docker Desktop runs only while its Windows user is signed in. Turn off its WSL integration for the distro, install Docker Engine inside Ubuntu and install again.
- "cannot run Windows programs (WSL interop is off)": set
enabled=trueunder[interop]in/etc/wsl.conf, runwsl --shutdownand install again. If your organisation turns this off by policy, the pack cannot keep running on this machine. - "sets instanceIdleTimeout":
.wslconfighas another idle timeout. Change that line toinstanceIdleTimeout=-1and install again.
Next steps
For exact messages and fixes, see the page in the CLI:
ppl docs get flows/air-gapped-windows