VirtualBox Setup
Prerequisites
Explicit Need Only
VirtualBox VMs are ONLY used to test cases which cannot be tested in containers (kernel, firmware, proc, systemd, networking, etc) these should never be default test cases.
Install
source {VENV}/bin/activate
pamac install virtualbox # No additional dependencies.
mhwd-kernel -l
mhwd-kernel -li # Install at least the running kernel.
pamac install linux{VERSION}-virtualbox-host-modules
pip install molecule-plugins[VirtualBox]
gpasswd -a ${USER} vboxusers # Add user to virtualbox users.
systemctl reboot # Install extended features first if needed.
Reference:
Extended features are only needed for testing USB, webcam, RDP, PXE, disk encryption, or NVMe.
pamac build virtualbox-ext-oracle
systemctl reboot
modprobe vboxdrv vboxnetadp xvboxnetflt # Alternate reload without reboot.
Confirm installed.
vboxmanage --version
> 7.1.4r165100 # Installed version.
Set alternative storage location (optional)
Developing on VMs will thrash disk especially when running molecule. Relocate high-use directories to a disk that can handle high wear. Prefer to config change as this enables quick use without configuration changes.
Move and link user directories to an alternative location (1)
- Consider moving and linking entire
.cachedirectory.
# delete or move existing cache data.
ls -s /mnt/cache/config/VirtualBox ${HOME}/.config/VirtualBox # Config.
ln -s '/mnt/cache/VirtualBox VMs' '${HOME}/VirtualBox VMs' # VM data.
Reference: