Edited 5 months ago by ExtremeHow Editorial Team
VirtualizationInstallationVirtualBoxOperating SystemsConfigurationVM ManagementHost SetupGuest SetupPerformanceApplications
This content is available in 7 different language
VirtualBox is a powerful open-source virtualization application that allows you to run multiple operating systems simultaneously on your Linux machine. Whether you are a developer, a tester, or just a curious user who wants to try out different operating systems, VirtualBox provides a simple and convenient way to do so. This guide will show you step-by-step how to install and use VirtualBox on a Linux system.
VirtualBox is a free and open-source virtualization software that enables you to run additional operating systems inside your existing operating system. Created by Oracle, VirtualBox supports the installation of both x86 and AMD64/Intel64 virtual machines. It works on various host systems such as Windows, macOS, and Linux.
Before we move on to the installation, let’s make sure your Linux system is ready for VirtualBox. Here are some prerequisites:
Before installing any new software, it is always a good idea to update your system to ensure that all packages are up-to-date. This will also help resolve any potential dependency issues. Open your terminal and run the following command:
sudo apt update sudo apt upgrade
For other distributions, such as Fedora, CentOS, or Arch Linux, you'll need to use the equivalent command, usually using the package manager for your distribution (dnf, yum, or pacman, respectively).
Most Linux distributions provide VirtualBox in their repositories. You can install it directly using your package manager. For Ubuntu, use:
sudo apt install virtualbox
On Fedora, you would use:
sudo dnf install virtualbox
However, using the distribution repository can sometimes lag behind the latest VirtualBox version. If you want the latest version, consider the following method.
Oracle's website provides the latest version of VirtualBox for various Linux distributions as DEB and RPM packages. To download:
Once downloaded, you can install it using the following command:
For DEB-based systems (Ubuntu):
sudo dpkg -i virtualbox-[version]-Ubuntu-[version].deb
sudo apt-get -f install
The first command installs VirtualBox while the second command resolves any dependency issues.
For RPM-based systems (Fedora):
sudo rpm -Uvh VirtualBox-[version]-[Fedora.version].rpm
For some distributions, you may need to set up Oracle's public keys to verify the installation:
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
To be able to use USB devices and other VirtualBox features, you must add your user to the vboxusers group. Do this with the following command:
sudo usermod -aG vboxusers [your-username]
Replace [your-username]
with your actual username. Next, log out and log back in for the changes to take effect.
To verify that VirtualBox has been installed correctly, run the following command in your terminal:
vboxmanage --version
This command will display the installed version of VirtualBox, and confirm that it is installed and working.
Oracle VM VirtualBox Extension Pack provides additional functionalities such as support for USB 2.0/3.0 devices and VirtualBox RDP. Download the extension pack from here and install it using the following command:
sudo VBoxManage extpack install [path-to-extension-pack]
Make sure to replace [path-to-extension-pack]
with the actual path to the downloaded file.
To create a new virtual machine, follow these steps:
virtualbox
or by selecting it from the menu of your desktop application.After you create your virtual machine, follow these instructions to install your preferred operating system:
Once the installation is complete, the virtual machine will behave just like a real computer, running the installed operating system.
Snapshots in VirtualBox allow you to preserve the state of a virtual machine at a given point in time. This feature is useful for creating a point to return to before making important changes. To create and restore a snapshot, do the following:
VirtualBox Guest Editions are special software packages that can be installed inside a virtual machine to improve performance and add features such as shared folders and seamless mouse integration. To install the Guest Edition:
Shared folders allow easy file exchange between your host and guest operating systems. To set up shared folders:
If VirtualBox fails to start your virtual machine, sometimes the problem is a kernel module not being loaded. You can force a reload using the following:
sudo /sbin/vboxconfig
Make sure the correct headers are installed for your current kernel version.
Sometimes, enabling 3D acceleration can cause guest systems to behave unexpectedly. If you experience display problems, try turning off 3D acceleration from the VM settings under "Display" → "Screen".
For slow performance, make sure you allocate enough CPU and RAM to your VM. Also, use the guest edition of VirtualBox to further improve performance.
If your VM cannot access the Internet, check the network settings in VirtualBox. A good initial setup is to use the "NAT" network setting, which will share the host computer's Internet connection with the virtual machine.
VirtualBox is a versatile tool that can greatly enhance your productivity and experimentation on Linux. With the steps outlined in this guide, you are now ready to efficiently create and manage virtual environments. Always remember to save a snapshot before making major changes and use the Guest Edition for the best experience.
If you find anything wrong with the article content, you can