Search notes:

Oracle VM VirtualBox

VirtualBox provides a x86 processor in a virtual environment. Thus, only x86 based operating systems are supported.
The virtual processor corresponds to the host's actual processor. This is different from QEMU where the processor is emulated (or imitated).

Global configuaration file

The global configuration file is VirtualBox.xml.

Enabling BIOS/UEFI

In order to be able to use virtualization, VT-x must be enabled in the BIOS or UEFI.

Some command line examples

VirtualBox can be configured from the command line.

List all available and running virtual machines

VBoxManage list vms
VBoxManage list runningvms

Starting and shutting down a virtual machine

The following command starts a virtual machine whose name is lnx. lnx needs to be either in powered-off or saved state.
VBoxManage startvm lnx
After starting the virtual machine, it probably needs to be resumed:
VBoxManage controlvm lnx resume
The virtual machine can be shut down the hard way:
VBoxManage controlvm lnx poweroff

Remove hard disk, DVD or floppy image

A hard-disk, DVD or floppy image can be removed from the the media registry like so. With --delete, the associated files will also be removed.
VBoxManage closemedium [disk|dvd|floppy] <uuid|filename> [--delete]

Adding a custom screen resolution

It seems that, at least when running on a Windows host, the virtual box only has some predefined screen resolutions: 1600x1200, 1280x1024, 1152x864, 1024x768 and 800x600.
These predefined resolutions can be extended with a custom video mode . First, the virtual machine must be stopped. Then (within cmd.exe), VBoxManage.exe can be executed:
"c:\Program Files\Oracle\VBoxManage.exe" setextradata "VIRTUAL BOX NAME HERE" CustomVideoMode 1600x900x32

Arch Linux

Apparently, under Arch Linux, VirtualBox is loaded through/via/by the vboxdrv kernel module which must be loaded before any virtual machine can run.
This modules is installed with
sudo pacman -S virtualbox
and then loaded with
modprobe vboxdrv.
Optional (but recommended) modules are: vboxnetadp, vboxnetflt and vboxpci. (See also /etc/modules-load.d/virtualbox.conf)
The user who wants to use the VirtualBox must be member of the vboxusers group:
gpasswd -a $USER vboxusers
Apparently, the executable to start the VirtualBox, virtualbox, must be installed separately:
sudo pacman -S virtualbox
TODO: Apparently, it cannot hurt to also install virtualbox-guest-iso.
TODO: does it also need sudo pacman -S virtualbox-host-modules-arch?

Windows / Hyper-V

As per some comments that I found in the vast depths of the Internet, VirtualBox cannot be run on Windows 10 if Hyper-V is active because Hyper-V does not release VT-x once it has acquired it.
Apparently though, VirtualBox and VMWare can coexist.
However, at least with VirtualBox version six, there seems to be an experimental feature where VirtualBox detects Hyper-V and uses it if it finds it. Such a configuration is indicated by a CPU icon in the VM window status bar.
Apparently, the interaction with Hyper-V leads to performance degradation.
An advantage of VirtualBox over Hyper-V is that it is free and also runs on a Windows home edition.

Auto Capture Keyboard

When Auto Capture Keyboard is enabled, it causes the Virtual Machine to automatically capture the keyboard every time the VM window is activated and make it unavailable to other application running (for example Alt-Tab).
This feature can be enabled or disabled in the Virtual Machine Manager's Menu Preferences -> Input -> Keyboard -> Keyboard Settings.

Python API

VirtualBox comes with two Python APIs:

Components

IPRT A portable runtime library which abstracts file access, threading, and string manipulation. Whenever Oracle VM VirtualBox accesses host operating features, it does so through this library for cross-platform portability.
VMM The Virtual Machine Monitor, which is the heart of the hypervisor.
EM The Execution Manager controls execution of guest code.
TRPM The Trap Manager intercepts and processes guest traps and exceptions.
HM The Hardware Acceleration Manager provides support for VT-x and AMD-V.
GIM The Guest Interface Manager provides support for various paravirtualization interfaces to the guest.
PDM The Pluggable Device Manager is an abstract interface between the VMM and emulated devices which separates device implementations from VMM internals and makes it easy to add new emulated devices. Through PDM, third-party developers can add new virtual devices to Oracle VM VirtualBox without having to change Oracle VM VirtualBox itself.
PGM The Page Manager is a component that controls guest paging.
TM The Time Manager handles timers and all aspects of time inside guests.
CFGM The Configuration Manager provides a tree structure which holds configuration settings for the VM and all emulated devices.
SSM The Saved State Manager saves and loads virtual machine state.
VUSB The Virtual USB layer which separates emulated USB controllers from the controllers on the host and from USB devices. This component also enables remote USB.
DBGF The Debug Facility is a built-in VM debugger.

Misc

VirtualBox was originally created by innotek GmbH which was acquired by Sun Microsystems Inc. (2008) which in turn was acquired by Oracle (2010).

TODO

VboxSDS is the process (service) that monitors a guest's system resources (VBoxManage.exe metrics). This process/services ends shortly after all VMs and frontends have been closed.
PS C:\> (get-service VBoxSDS).displayName
VirtualBox system service
/dev/vboxuser and /dev/vboxguest
/proc/irq/n/vboxvideo and /proc/irq/n/vboxguest
/sys/kernel/btf/vboxvideo and /sys/kernel/btf/vboxguest
/sys/kernel/debug/printk/index/vboxvideo and /sys/kernel/debug/printk/index/vboxguest -` /sys/class/misc/vboxuser and /sys/class/misc/vboxguest
/sys/devices/virtual/misc/vboxuser and /sys/devices/virtual/misc/vboxguest
/sys/bus/pci/drivers/vboxvideo and /sys/bus/pci/drivers/vboxguest
/sys/module/drm_kms_helper/holders/vboxvideo, /sys/module/drm_vram_helper/holders/vboxvideo
/sys/module/vboxvideo and /sys/module/vboxguest

Performance

After installing Windows 10 in a guest, it turned out that some web pages (with WebGL?) were sluggish.
By enabling 3D acceleration, this problem went away:
VBoxManage modifyvm $VBNAME --accelerate3d on
However, with accelerated 3D, the start menu and the taskbar became transparent so that the text could not be read anymore.
So, «Windows transparency» must be disabled:
$null = set-itemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize -name EnableTransparency -type dWord -value 0

See also

Guest additions
host key
C:\Program Files\Oracle\VirtualBox
Error message Failed to open a session for the virtual machine
VirtualBox is the default virtualisation provider for Vagrant.
The Linux Kernel source file drivers/gpu/drm/vboxvideo
x86 hardware virtualization

Index