How to install and configure VirtualBox on Windows, Mac, and Linux?

First published: Wednesday, June 5, 2024 | Last updated: Wednesday, June 5, 2024

Discover how to install and configure VirtualBox hypervisor on your Windows, Mac, and Linux operating systems to create and manage VMs.


What is VirtualBox?

VirtualBox serves as a hypervisor software, enabling users to create and customize VMs. The installation of VirtualBox is essential for building virtual machines, as hypervisor software is a prerequisite for this task.

Install VirtualBox

When it comes to the installation process of VirtualBox, it’s important to note that the steps may differ based on the operating system - whether it’s Windows, Mac, or Linux. VirtualBox falls under the category of type-2 or hosted hypervisor, allowing you to effectively manage virtual machines, regardless of the method of installation you choose. After completing the installation, it is crucial to verify the version of VirtualBox that was installed to ensure that it has been successful. For more comprehensive instructions and in-depth information, make sure to refer to the official VirtualBox documentation.

Windows

  1. Download the VirtualBox installer.
  2. Execute the VirtualBox installer, and proceed with Next and Finish prompts to install VirtualBox.

After installing VirtualBox on your Windows operating system, you’ll want to verify the installation by using the following commands.

# Check VirtualBox version.
$ virtualbox --help

Finally, if you are utilizing an alternative hypervisor such as Hyper-V, it is necessary to disable it. There are two methods for disabling Hyper-V, one is GUI and the other is PowerShell. Kindly follow the steps provided below to disable Hyper-V.

# Disable Hyper-V from UI.
Control Panel
	Programs and Features
		Turn Windows features on or off
			Hyper-V: false
# Disable Hyper-V from PowerShell.
$ Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor
$ Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All

Mac

  1. Download the VirtualBox package.
  2. Execute the VirtualBox package, and proceed with Continue and Install prompts to install VirtualBox.

After installing VirtualBox on your Mac operating system, you’ll want to verify the installation by using the following commands.

# Check VirtualBox version.
$ virtualbox --help

Linux (Debian)

You can use the following commands to install VirtualBox in Debian-based Linux operating systems such as Ubuntu Linux, Mint Linux, Kali Linux, Kubuntu Linux, etc., or any other similar equivalents.

# Install system packages.
$ sudo apt install gcc make perl

# Download VirtualBox.
$ wget https://download.virtualbox.org/virtualbox/7.0.20/virtualbox-7.0_7.0.20-163906~Ubuntu~noble_amd64.deb -P /tmp

# Install VirtualBox.
$ sudo apt install /tmp/virtualbox-7.0_7.0.20-163906~Ubuntu~noble_amd64.deb

# Check VirtualBox version.
$ virtualbox --help

Configure VirtualBox

Mac and Linux

Please run the below commands to configure VirtualBox networking on a Mac or Linux operating system.

# Add host-only network configuration for VirtualBox.
$ sudo mkdir /etc/vbox
$ sudo nano /etc/vbox/networks.conf
* 0.0.0.0/0 ::/0