Skip to content

Support custom kernels for BSD guests#19

Draft
Vbitz wants to merge 1 commit into
mainfrom
codex/custom-bsd-kernels
Draft

Support custom kernels for BSD guests#19
Vbitz wants to merge 1 commit into
mainfrom
codex/custom-bsd-kernels

Conversation

@Vbitz

@Vbitz Vbitz commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add custom file: kernel loading for built-in BSD guest artifacts.
  • Thread requested kernels through OpenBSD, FreeBSD, and NetBSD built-in backends.
  • Extract OpenBSD var/sysmerge/etc.tgz into managed roots so normal /etc content, including /etc/ssl/cert.pem, is present.
  • Add runtime share delegation for sidecar-backed VMs and keep built-in BSD startup shares attached at boot.
  • Seed BSD guest clocks from the managed init script so TLS and build tools do not start from filesystem time.

Acceptance criteria

This PR is not complete until custom kernel use works as an ordinary user workflow:

  • Users build custom kernels using the exact upstream OS commands/documentation for Linux, OpenBSD, FreeBSD, and NetBSD. cc/vmsh must not require a special build recipe or helper tooling.
  • The runtime-specific responsibility is only to boot the resulting kernel artifact with --kernel <path> / file:<path>.
  • OpenBSD guests can boot a user-built OpenBSD kernel artifact produced by the normal upstream OpenBSD build flow.
  • FreeBSD guests can boot a user-built FreeBSD kernel artifact produced by the normal upstream FreeBSD build flow.
  • NetBSD guests can boot a user-built NetBSD kernel artifact produced by the normal upstream NetBSD build flow.
  • The final vmsh docs should explain only the vmsh boot step and point users at upstream OS docs for the build step, plus any path/CWD details needed to pass the built kernel to --kernel.
  • The documented boot commands have been run successfully before this leaves draft.

Current known gap

OpenBSD currently fails getcwd(3) inside /host shared workspaces, which prevents upstream OpenBSD build tools like config from running directly from a shared source tree. See tinyrange/vmsh#62.

Tests

  • go test ./internal/openbsd/rootfs ./internal/freebsd/rootfs ./internal/netbsd/rootfs ./internal/vm/builtin

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