Oracle VM VirtualBox Configuration¶
This guide explains how to set-up in your system Oracle VM VirtualBox 7.0 for Linux.
Install and set-up¶
- The first thing you must do is purge your current VirtualBox installation. If you don’t do this, your guest OSes will fail to run.
To purge VirtualBox log in to your Linux host, open a terminal window and issue the command:sudo apt-get autoremove purge virtualbox*
Now your old version of VirtualBox is out. - Next, we need to download and install a pair of GPG keys. First, download them with the commands:
curl https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor > oracle_vbox_2016.gpgcurl https://www.virtualbox.org/download/oracle_vbox.asc | gpg --dearmor > oracle_vbox.gpg - Now you can install those keys with:
sudo install -o root -g root -m 644 oracle_vbox_2016.gpg /etc/apt/trusted.gpg.d/sudo install -o root -g root -m 644 oracle_vbox.gpg /etc/apt/trusted.gpg.d/ - Create the repository for VirtualBox 7.0 with:
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list - Update apt with:
sudo apt-get update - If you don’t already have the kernel headers installed on your system, do so with the command:
sudo apt install linux-headers-$(uname -r) dkms - Finally, install VirtualBox 7.0 with:
sudo apt-get install virtualbox-7.0 -y - Last but not least, fix any lingering problems with the command:
sudo /sbin/vboxconfig
Troubleshoot¶
If there are some errors like: Err:6 http://download.virtualbox.org/virtualbox/debian jammy InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2F683C52980AECF then you can try to follow the steps from Upgrading to later versions sections.
Set-up new VM¶
1. Create a new VM- Start VirtualBox and Click on 'New' in the menu.
- Enter the Name of your VM. This is how you will identify it in VirtualBox so name it something meaningful to you.
- Select Type and Version. This depends on what OS you are installing.
- This depends on how much memory you have on your host computer. Never allocate more than half of your available RAM.
- If you already have an existing VM that you want to add select "Use an existing Virtual hard drive file." * Otherwise select "Create a virtual hard drive now."
4. Check the summary of configuration and then click 'Finish'.
Configure VM¶
To configure VM you need to start VirtualBox and select 'Settings' button from the Details window of your VM.
Tips and tricks¶
Upgrading to later versions¶
- Before you can proceed with upgrades, you need to uninstall the current version. Stop running vms.
vboxmanage list runningvms | sed -r 's/.*\{(.*)\}/\1/' | \xargs -L1 -I {} VBoxManage controlvm {} poweroff - Quit VirtualBox manager by running:
pkill VirtualBox - Next, remove VirtualBox Extension Package if installed.
sudo vboxmanage extpack uninstall "Oracle VM VirtualBox Extension Pack" - Then, uninstall virtualbox.
sudo apt remove --purge --auto-remove virtualbox virtualbox-6.1
Note that this wont remove the VirtualBox virtual machines on your host system. - Once the package removal is done, reboot the system;
sudo systemctl reboot -i - Next, install VirtualBox repository on your Ubuntu or Debian system if not already in place;
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | \sudo tee /etc/apt/sources.list.d/virtualbox.list - Install VirtualBox repository signing key;
sudo apt install gnupg2wget -qO- https://www.virtualbox.org/download/oracle_vbox_2016.asc | \sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/virtualbox.gpg - Run system package cache update;
sudo apt update - Install VirtualBox 7.x (VirtualBox 7.0 as of this writing is available) using the package manager.
sudo apt install virtualbox-7.0
Troubleshoot¶
If an error like this Err:6 http://download.virtualbox.org/virtualbox/debian jammy InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2F683C52980AECF appears you should also try the following steps:
- You need to download the appropriate package for your Linux distribution from the https://www.virtualbox.org/wiki/Linux_Downloads .
- Open a new terminal.
- Navigate to the folder where the package was downloaded and run
sudo dpkg -i virtualbox-7.0_7.0.20-163906~Ubuntu~jammy_amd64.deb. - If you encounter errors like
Unable to locate package...orUnmet dependencies, runsudo apt --fix-broken install.