Always clean stale taps before creating new ones

deleteTap before createTap in all four call sites:
snapshot restore, cold boot, agent start, snapshot create.
Prevents "Device or resource busy" from leftover taps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-07 16:07:24 +00:00
parent 6485705d4b
commit cf2d2d31b7
3 changed files with 4 additions and 0 deletions

View File

@@ -268,6 +268,7 @@ export async function startAgent(
// Setup network
ensureBridge();
ensureNat();
deleteTap(tapDevice); // clean stale tap from previous run
createTap(tapDevice);
// Boot VM