Skip to content

Hermes installer: Windows service for WSL2 auto-start with GPU + Tailscale #565

@joelteply

Description

@joelteply

Problem

WSL2 doesn't auto-start on Windows boot. Every reboot requires someone to manually:

  1. Open PowerShell as administrator (regular won't work — GPU passthrough needs admin)
  2. Type wsl
  3. Wait for it to start
  4. Hope Tailscale and SSH come up

This is unacceptable for a grid node. A machine that needs a human to poke it after every power cycle is not a server.

Solution

Hermes (install.sh) detects Windows/WSL2 and creates a Windows scheduled task:

# Created by Hermes installer — runs at system boot, before login, as SYSTEM
$action = New-ScheduledTaskAction -Execute "wsl.exe" -Argument "-u root -- /etc/continuum/boot.sh"
$trigger = New-ScheduledTaskTrigger -AtStartup
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
Register-ScheduledTask -TaskName "ContinuumWSL" -Action $action -Trigger $trigger -Principal $principal -Settings $settings

Inside WSL: /etc/continuum/boot.sh

#!/bin/bash
# Start SSH
service ssh start

# Start Tailscale  
tailscaled --state=/var/lib/tailscale/tailscaled.state &
sleep 2
tailscale up --ssh --accept-routes

# Protect critical services from OOM killer
for pid in $(pgrep -f 'sshd|tailscaled'); do
    echo -17 > /proc/$pid/oom_adj 2>/dev/null
done

# Log success
echo "$(date): Continuum boot complete" >> /var/log/continuum-boot.log

wsl.conf

[boot]
systemd=true

[automount]
enabled=true

Requirements

  • Runs as SYSTEM (not dependent on user login)
  • Runs at boot (not at login — machine might be headless)
  • GPU passthrough works (admin privileges)
  • Tailscale reconnects automatically
  • SSH accessible within 30 seconds of Windows boot
  • OOM killer can't take down SSH/Tailscale
  • Zero user interaction after initial install

The Standard

curl -sL install.continuum.ai | bash on a Windows machine with WSL2:

  1. Installs continuum in WSL2
  2. Creates the Windows scheduled task
  3. Configures wsl.conf and boot.sh
  4. Machine survives reboots forever

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions