Skip to content

VBox 3a: vboxapi crate: attach to a VM and read guest memory #274

Closed

Description

@Wenzel

Parent

#269

What to build

A minimal Rust crate (vboxapi, unpublished, under ~/vmi) binding VirtualBox's C API glue, loaded at runtime from the installed VirtualBox, able to attach a shared session to a running VM by name and read guest physical memory through IMachineDebugger.

Acceptance criteria

  • Example program dumps a guest physical page; bytes match the core dump
  • Clear error when VirtualBox libraries are not found or the VM is not running
  • Binding surface limited to what the MachineDebugger method needs

Blocked by

Activity

  1. Wenzel commented on Oct 11, 2026

    @Wenzel
    OwnerAuthor

    Implemented in local repo ~/vmi/vboxapi (unpublished per the spec, no remote, so no PR): commits 08cc563, 120b810.

    • Vm::attach(name) (shared session, process-wide IVirtualBoxClient loaded once via dlopen of VBoxXPCOMC.so; VBOX_APP_HOME or /opt/VirtualBox, /usr/lib/virtualbox), Vm::read_physical(paddr, buf) (1 MiB chunks, checked arithmetic).
    • Errors: LibraryNotFound, LibraryIncompatible (C API version check), VmNotFound, VmNotRunning, AddressOutOfRange, Api { call, rc, text }.
    • Verified against the patched build (vmi/machinedebugger): 8 pages + a 3 MiB block byte-identical to a dumpvmcore core; the three error cases give clear messages; two Vms at once, attach/drop/attach and attach from another thread work.
    • Code-reviewed (9 findings, all fixed: drop order vs. shutdown, double uninit, single process-wide client, null out-pointers, no env mutation, bounded chunks, checked addresses, version message + unit test).
    • Linux only for now (Windows C API vtables differ) — the virtualbox-api Windows CI build from VirtualBox driver: MachineDebugger and VBoxVMI access methods (phase 1: VM state access) #269 needs follow-up.

    Left open for maintainer review.

  2. Wenzel commented on Oct 11, 2026

    @Wenzel
    OwnerAuthor

    Done (see comment above); closing as the work is verified and in use by later tickets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions