Skip to content

Commit 4610efe

Browse files
authored
fix: target the installed Apple vmnet service (#47)
Signed-off-by: Joseph Yaksich <gitcommit90@users.noreply.github.com> Co-authored-by: Joseph Yaksich <gitcommit90@users.noreply.github.com>
1 parent 2373cba commit 4610efe

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/server/channel-computers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ async function repairAppleGuestNetwork(computer: ChannelComputer): Promise<void>
593593
// the same fleet-wide outage during one reconciliation pass.
594594
if (now() - appleNetworkRepairAt > 30_000) {
595595
if (platform() === "darwin") {
596-
const label = `gui/${process.getuid?.() ?? 501}/com.apple.container.container-network-vmnet.default`;
596+
const label = `gui/${process.getuid?.() ?? 501}/com.apple.container.network.container-network-vmnet.default`;
597597
const kicked = await spawnCollected("/bin/launchctl", ["kickstart", "-k", label], { timeoutMs: 30_000 });
598598
if (kicked.code !== 0) throw new Error(kicked.stderr.toString("utf8").trim() || "Apple shared VM network service could not restart");
599599
}

test/channel-computers.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ test("Apple channel-computer contract preserves isolation, files, wakes, archive
154154
assert.ok(calls.some((call) => call.includes("-w") && call.includes("/workspace") && call.some((word) => word.includes("/bin/bash")) && call.some((word) => word.includes("-lc"))), "resident commands execute in the correct VM workspace");
155155
assert.equal(db.q1("SELECT disk_bytes FROM channel_computers WHERE channel_id=?", beta.channelId).disk_bytes, computers.MANAGED_CHANNEL_DISK_BYTES, "reported storage is the managed writable allocation, not Apple's host-backed virtual capacity");
156156
const backend = await readFile(join(root, "src", "server", "channel-computers.ts"), "utf8");
157+
assert.match(backend, /com\.apple\.container\.network\.container-network-vmnet\.default/, "network recovery restarts Apple's installed vmnet launch service");
157158
assert.match(backend, /terminal \? \["-it"\] : pipeInput \? \["-i"\]/, "Apple terminal and streamed-stdin invocations request the exact interactive mode they need");
158159
assert.match(backend, /isolatedInvocation\(\["\/bin\/bash", "-l"\][\s\S]*true\)/, "interactive isolated terminals request an explicit guest login shell");
159160
assert.match(backend, /args: \[\.\.\.words, \.\.\.guestWords\(\.\.\.args\)\]/, "Apple guest argv remains quoted for the runtime's documented second shell parse");

0 commit comments

Comments
 (0)