Repository navigation
virtualbox: default access method, C vCPU count - #323
Merged
Merged
Conversation
Without VirtualBox params, the VirtualBox driver uses the VBoxVMI method at the VM's default socket (<VirtualBox user home>/vmi/<VM UUID>.sock or the VBoxInternal/VMI/SocketPath extradata, resolved through the VirtualBox API), and falls back to the MachineDebugger method only when that socket file does not exist. VBoxVMI without a socket path uses the default socket. Explicit methods never fall back. The choice is logged at info level. C: access_method = 0 is the default, VBOX_ACCESS_METHOD_VBOXVMI with a null socket_path the default socket. Python: unset virtualbox is the default, VBoxInitParamsPy.VBoxVMI() the default socket. ADR-0004 supersedes ADR-0003's no-default rule. The VirtualBox integration harness gains VBOX_TEST_METHOD=default and default-fallback, and virtualbox_default_method_selection. Refs #312
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #312 (libmicrovmi part; the LibVMI fork pins this branch's head).
Summary
The VirtualBox Driver gets a default Access method, ADR-0004 superseding ADR-0003's no-default rule:
VBoxInternal/VMI/SocketPathextradata, else<IVirtualBox::HomeFolder>/vmi/<IMachine::Id>.sock, the same asConsoleImplConfigCommon.cpp. It comes from newvboxapi::vmi_socket_path(Wenzel/rs-vboxapi@fcd2e49). So the default, and VBoxVMI without a path, need both methods (virtualboxfeature):virtualbox-vmionly: they fail withVBoxVmiSocketPathRequiredvirtualbox-apionly: the default is MachineDebuggeraccess_method = 0means the defaultVBOX_ACCESS_METHOD_VBOXVMIwith a nullsocket_pathmeans the default socketbool microvmi_get_vcpu_count(void*, uint16_t*)VBoxInitParams::VBoxVMI::socket_path: Option<String>.virtualboxleft unset means the default, andVBoxInitParamsPy.VBoxVMI()means the default socket. The Volatility URL handler no longer requiresvbox_access_method.VBOX_TEST_METHOD=default|default-fallbackand the testvirtualbox_default_method_selection.Evidence
Run against the patched VirtualBox (
vmi/cross-method-testbuild) onmicrovmi-alpine, withRUST_LOG=microvmi=info:The full
MICROVMI_TEST_FILTER=virtualbox_suite passes under bothdefaultanddefault-fallback. Errors in the register-write test show which method served the request:VBoxVMI register write refusedvsIMachineDebugger::SetRegisters failed. Read speed: 1350 MiB/s with VBoxVMI, 240 MiB/s with MachineDebugger.Also run:
cargo test --test virtualbox_errorswithvirtualbox-vmiand withvirtualbox-D warningsforvirtualbox,virtualbox-apiandvirtualbox-vmiMerge Danger
Door: two-way
Blast Radius: VirtualBox callers
These changes break VirtualBox callers:
VBoxVMI { socket_path: String }MicrovmiError::AccessMethodRequiredA caller that relied on "no access method is an error" now gets a VirtualBox driver. Autodetection (
init(None, ..)) without VirtualBox params now also tries VirtualBox's default method.