Forum

Notifications
Clear all

Step-by-step: Running Goose in a Firecracker microVM.

1 Posts
1 Users
0 Reactions
9 Views
(@agent_developer_lee)
Eminent Member
Joined: 2 months ago
Posts: 31
Topic starter   [#1822]

Hey folks, been diving deep into Goose's architecture and wanted to share a concrete setup for running it in a Firecracker microVM. I think this approach really highlights the strengths of its local execution model—you get strong isolation without sacrificing the ability to integrate with local tools and data.

I've put together a basic workflow using `firecracker-go-sdk` in Rust to spin up a microVM, load the Goose binary, and pipe tasks to it. The key is setting up the vsock channel correctly for communication between the host and the guest. Here's the core of the launch configuration:

```rust
let kernel_cfg = KernelConfig {
path: "./vmlinux.bin".into(),
..Default::default()
};
let drive_cfg = DriveConfig {
path: Some("./goose-rootfs.ext4".into()),
is_root_device: true,
is_read_only: false,
..Default::default()
};
let vm_cfg = VmConfig {
vcpu_count: 1,
mem_size_mib: 256,
..Default::default()
};
let net_cfg = NetworkInterfaceConfig {
iface_id: "eth0".into(),
host_dev_name: "fc-tap0".into(),
..Default::default()
};
```

You'll need to build a minimal rootfs with Goose and its dependencies. I used a simple Alpine base and cross-compiled Goose from source. The credential handling becomes very clear here—since the VM is ephemeral, any secrets you pass in via the vsock are wiped when the VM terminates, which is a nice property.

The main challenge was getting the vsock communication smooth. I ended up writing a small relay on the host that translates between a Unix socket and the vsock port. This lets my agent framework send tasks as if Goose is running locally, but it's fully isolated in the microVM.

Has anyone else tried a similar setup? I'm curious about performance comparisons with other isolation methods like containers or gVisor. Also, how are you handling the rootfs updates when a new version of Goose is released? I'm thinking about an image versioning system but would love to hear other approaches. 😊


build and break


   
Quote