testdrivermachine-setuplisted
Install: claude install-skill testdriverai/testdriverai
<!-- Generated from machine-setup.mdx. DO NOT EDIT. -->
TestDriver provisions a fresh cloud VM for every test by default. This guide covers how to configure Linux and Windows machines, reduce startup time by keeping machines alive between runs, use provision scripts for repeatable setup, and install custom software on the fly.
---
## Linux Machines
Linux is the default operating system. No extra configuration is required.
```javascript
import { describe, expect, it } from "vitest";
import { TestDriver } from "testdriverai/vitest/hooks";
describe("My Test", () => {
it("runs on Linux", async (context) => {
const testdriver = TestDriver(context);
await testdriver.provision.chrome({ url: "https://example.com" });
const result = await testdriver.assert("the page loaded successfully");
expect(result).toBeTruthy();
});
});
```
### Common Linux Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `os` | string | `"linux"` | Operating system |
| `resolution` | string | `"1366x768"` | Screen resolution (Enterprise only) |
| `e2bTemplateId` | string | — | Custom E2B template ID (see [Self-Hosted](/v7/self-hosted)) |
| `keepAlive` | number | `60000` | Ms to keep VM alive after disconnect |
| `reconnect` | boolean | `false` | Reconnect to last used sandbox |
```javascript
const testdriver = TestDriver(context, {
os: "linux",
resolution: "1920x1080",
keepAlive: 5 * 60 * 1000, // keep alive 5 minutes
});
```
---