From 4cee8a0a3566ec2ddf3f81a2c833ca5ba47708bc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Feb 2026 12:28:06 -0500 Subject: [PATCH] replace nebula.exe -service install with New-Service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nebula's built-in Go service manager (-service install) is unreliable on Windows — it reports "service already exists" when the SCM, registry, and Get-Service all confirm no service is present. Use PowerShell's New-Service cmdlet instead, which talks directly to the Windows SCM. --- README.md | 2 +- install-nebula.ps1 | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5c8998f..7f39fa5 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ Get-WinEvent -FilterHashtable @{LogName='Application'; ProviderName='nebula'} -M Common causes: - **"found unknown escape character"** — Backslashes in `config.yml` paths. YAML interprets `\` as escape characters inside double quotes. Use forward slashes (`C:/Program Files/Nebula/ca.crt`). -- **"no config files found"** — The service was installed without `-config`. Reinstall using `install-nebula.ps1`. +- **"no config files found"** — The service binary path is missing the `-config` argument. Reinstall using `install-nebula.ps1`. ### Handshake timeouts after reboot Nebula started before the physical network was ready. Verify the service is configured with auto start and NLA dependency: diff --git a/install-nebula.ps1 b/install-nebula.ps1 index 9e37544..dbffda1 100644 --- a/install-nebula.ps1 +++ b/install-nebula.ps1 @@ -209,9 +209,10 @@ if (-not (Test-Path (Join-Path $InstallDir "dist"))) { # --- Install and configure service --- Write-Host "Installing Nebula service..." -& "$InstallDir\nebula.exe" -service install -config "$ConfigPath" -if ($LASTEXITCODE -ne 0) { - Write-Error "Failed to install Nebula service." +try { + New-Service -Name "nebula" -BinaryPathName $ExpectedBinPath -StartupType Automatic -Description "Nebula Network Service" -ErrorAction Stop | Out-Null +} catch { + Write-Error "Failed to install Nebula service: $_" exit 1 }