garrytan/gstack · error
Xvfb on ${display} exited during startup (code ${proc.exitCo
Error message
Xvfb on ${display} exited during startup (code ${proc.exitCode}). Hint: install xvfb (apt-get install xvfb / yum install xorg-x11-server-Xvfb). What it means
Error "Xvfb on ${display} exited during startup (code ${proc.exitCode}). Hint: install xvfb (apt-get install xvfb / yum install xorg-x11-server-Xvfb)." thrown in garrytan/gstack.
Source
Thrown at browse/src/xvfb.ts:150
const display = `:${displayNum}`;
// Spawn detached: Xvfb's lifetime is tied to whether we've explicitly
// killed it via the handle's close() method, not to the parent process.
const proc = Bun.spawn(['Xvfb', display, '-screen', '0', '1920x1080x24', '-ac'], {
stdio: ['ignore', 'ignore', 'ignore'],
});
proc.unref();
// Wait for the X server to become reachable — Xvfb takes a few hundred ms
// to bind. Probe via xdpyinfo with retries.
const deadline = Date.now() + 3000;
let ready = false;
while (Date.now() < deadline) {
await Bun.sleep(100);
if (!isDisplayFree(displayNum)) { ready = true; break; }
// If Xvfb crashed during startup, fail fast.
if (proc.exitCode != null) {
throw new Error(`Xvfb on ${display} exited during startup (code ${proc.exitCode}). Hint: install xvfb (apt-get install xvfb / yum install xorg-x11-server-Xvfb).`);
}
}
if (!ready) {
try { proc.kill('SIGKILL'); } catch { /* ignore */ }
throw new Error(`Xvfb on ${display} never became reachable within 3s timeout`);
}
const startTime = readPidStartTime(proc.pid);
return {
pid: proc.pid,
startTime,
display,
close: () => cleanupXvfb({ pid: proc.pid, startTime, display }),
};
}
/**
* Cleanup an Xvfb child if it's still ours. Validates ownership first; ifView on GitHub (pinned to 94993f7401)
When it happens
Trigger: Thrown at browse/src/xvfb.ts:150 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of garrytan/gstack@94993f7401 (2026-08-12).
Data as JSON: /api/errors/890d6ac44e60e509.
Report an issue: GitHub.