Skip to content
holzkohlengrill edited this page Dec 15, 2023 · 3 revisions

VirtualBox

Install guest additions

# (X)Ubuntu
sudo apt-get install virtualbox-guest-additions-iso
# Arch-based
sudo pacman -S virtualbox-guest-iso

sudo mkdir /mnt/tmp

# (X)Ubuntu
sudo mount /usr/share/virtualbox/VBoxGuestAdditions.iso /mnt/tmp
# Arch-based
sudo mount /usr/lib/virtualbox/additions/VBoxGuestAdditions.iso /mnt/tmp

cd /mnt/tmp
sudo ./VBoxLinuxAdditions.run
reboot

-> for other methods see here (other options do not work (properly) from my experience).

Add user to vboxsf group:

sudo usermod -G vboxsf -a <uname>

@Windows 10

Hyper-V causes a lot of trouble with VirtualBox. Go to Turn Windows Features on or of and disable:

  • Containers
  • Hyper-V (note that this might be enabled from time to time by other software automatically)
  • Virtual Machine Platform
  • Windows Hypervisor Platform

(Windows Sandbox never caused problems for me and can stay enabled); Do not deactivate Virtual Machine Platform and Windows Hypervisor Platform if you use WSL2 -> however then VirtualBox will not work anymore)

When this does not work and you still get the error WHvSetupPartition failed - VERR_NEM_VM_CREATE_FAILED try running: bcdedit /set hypervisorlaunchtype off (if WSL(2) is not working (but VirtualBox will probably not work then) try bcdedit /set hypervisorlaunchtype auto start then reboot)

Use DNS resolution of host system (-> i.e. sites only accessible via VPN network, ...)

# Get VM names
VBoxManage list runningvms
# Activate host DNS resolver
VBoxManage modifyvm "<vm-name>" --natdnshostresolver1 on

Unter Windows it is VBoxManage.exe which can be found in the VirtualBox installation folder.

Make current dynamic VM disk smaller (release non-zeroed free memory)

See this guide: https://www.howtogeek.com/312883/how-to-shrink-a-virtualbox-virtual-machine-and-free-up-disk-space/

Networking modes

https://www.virtualbox.org/manual/ch06.html#networkingmodes

Clone this wiki locally