Skip to content

feat(cli): forkd doctor — 4 new checks (hw-virt / FC version / docker / disk space)#142

Merged
WaylandYang merged 1 commit into
mainfrom
feat/doctor-more-checks
May 21, 2026
Merged

feat(cli): forkd doctor — 4 new checks (hw-virt / FC version / docker / disk space)#142
WaylandYang merged 1 commit into
mainfrom
feat/doctor-more-checks

Conversation

@WaylandYang
Copy link
Copy Markdown
Contributor

Summary

Extends `forkd doctor` from 10 → 14 checks. Targets the silent-failure modes new users hit before reaching the existing checks.

Smoke test on dev box (live, after this PR)

```
✓ platform Linux version 6.14.0-36-generic
✓ hw virt vmx (CPU supports virtualization)
✓ kvm /dev/kvm OK
✓ cgroup v2 cpuset cpu io memory hugetlb pids rdma misc dmem
✓ ip_forward 1 (forwarding enabled)
⚠ tap device forkd-tap0 (down)
→ sudo ip link set forkd-tap0 up — or rerun scripts/host-tap.sh
✓ per-child netns 5 provisioned
✓ firecracker /usr/local/bin/firecracker
✓ firecracker version v1.12.0
⚠ kernel image no vmlinux found in common locations
✓ snapshot dir /home/yangdongxu/.local/share/forkd/snapshots (107 snapshots)
✓ snapshot dir space 654.8 GiB free at /home/yangdongxu/.local/share/forkd/snapshots
✓ docker daemon reachable
✓ daemon http://127.0.0.1:8889 responding

pass=12 warn=2 fail=0 skip=0
```

What each new check answers

New check Catches
hw virt CPU virtualization disabled in BIOS — fails fast with a clear hint instead of letting Firecracker error out later
firecracker version Old FC that can't do v0.3 Diff snapshots. PASS ≥1.10, WARN 1.5-1.9, FAIL <1.5
docker `docker info` works (matters only for `forkd from-image` / `forkd parent build`). Detects "permission denied" specifically and emits the `usermod -aG docker` hint
snapshot dir space `statvfs(3)` on the snapshot dir. PASS ≥5 GiB, WARN ≥1 GiB, FAIL <1 GiB

Files

  • `crates/forkd-cli/src/doctor.rs` — 4 new check functions (~150 LOC), 4 new entries in the `vec![..]` of checks
  • `crates/forkd-cli/Cargo.toml` — `libc = "0.2"` added as a `cfg(unix)` dep for `statvfs`

🤖 Generated with Claude Code

…er, disk space)

Extends \`forkd doctor\` from 10 → 14 checks. New ones target the
common silent-failure modes new users hit:

- hw virt: scans /proc/cpuinfo for vmx (Intel) or svm (AMD). Fails
  early with a clear \"enable virtualization in BIOS\" hint instead
  of letting Firecracker error out a few seconds later.
- firecracker version: parses \`firecracker --version\`. PASS for
  >=1.10 (the version v0.3 forkd was tested against), WARN for
  1.5-1.9 (diff snapshots present but pre-1.10), FAIL for <1.5.
- docker: \`docker info\`. Only needed by \`forkd from-image\` /
  \`forkd parent build\`; emits WARN (not FAIL) when absent or
  unreachable so users without docker can still pass doctor.
  Detects the \"permission denied\" case and emits the usermod
  hint specifically.
- snapshot dir space: statvfs(3) on the snapshot dir (or nearest
  existing parent). PASS ≥5 GiB, WARN ≥1 GiB, FAIL <1 GiB.

Adds libc 0.2 as a cfg(unix) dep for statvfs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@WaylandYang WaylandYang force-pushed the feat/doctor-more-checks branch from 9e46015 to a3f4084 Compare May 21, 2026 08:06
@WaylandYang WaylandYang merged commit ab9e2e7 into main May 21, 2026
2 checks passed
@WaylandYang WaylandYang deleted the feat/doctor-more-checks branch May 21, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant