Learn how to install VirtualBox on Ubuntu Server 18 with this step-by-step guide. Follow easy instructions to set up your virtualization environment quickly and efficiently. #centlinux #ubuntu #virtualbox
Table of Contents
What is VirtualBox?
VirtualBox is a free and open-source hosted hypervisor for x86 virtualization, developed by Oracle Corporation. VirtualBox was created by Innotek, it was acquired by Sun Microsystems in 2008, which was in turn acquired by Oracle in 2010.
VirtualBox can be installed on Windows, macOS, Linux, Solaris and OpenSolaris. There are also ports to FreeBSD and Genode. It supports the creation and management of guest virtual machines running Windows, Linux, BSD, OS/2, Solaris, Haiku, and OSx86, as well as limited virtualization of macOS guests on Apple hardware. For some guest operating systems, a “Guest Additions” package of device drivers and system applications is available, which typically improves performance, especially that of graphics.
The core package is, since version 4 in December 2010, free software under GNU General Public License version 2 (GPLv2). The separate “VirtualBox Oracle VM VirtualBox extension pack” providing support for USB 2.0 and 3.0 devices, Remote Desktop Protocol (RDP), disk encryption, NVMe and Preboot Execution Environment (PXE) boot is under a proprietary license, called Personal Use and Evaluation License (PUEL), which permits use of the software for personal use, educational use, or evaluation, free of charge. Since VirtualBox version 5.1.30 Oracle defines personal use as the installation of the software on a single host computer for non-commercial purposes. (Source: Wikipedia)

VirtualBox Alternatives
If you’re considering alternatives to VirtualBox for your virtualization needs, there are several options available that cater to different use cases and preferences. Here are some popular VirtualBox alternatives:
VMware Workstation Player/Pro
- VMware offers both a free (Player) and a paid (Pro) version.
- Known for high performance and a wide range of features.
- Great support for various guest operating systems.
KVM (Kernel-based Virtual Machine)
- Integrated into the Linux kernel, making it a highly efficient option for Linux users.
- Powerful and suitable for enterprise-level virtualization.
- Often used with management tools like libvirt, virt-manager, or oVirt.
Hyper-V
- Microsoft’s virtualization platform, included with Windows 10 Pro and Windows Server.
- Excellent integration with other Microsoft products and services.
- Suitable for both desktop and server virtualization.
Parallels Desktop
- Popular choice for Mac users.
- Allows running Windows and other OSes on macOS with high performance.
- User-friendly interface and seamless integration with macOS features.
Proxmox VE
- An open-source virtualization management solution.
- Supports KVM for full virtualization and LXC for container-based virtualization.
- Web-based interface for easy management.
QEMU
- A free and open-source emulator and virtualizer.
- Works well with KVM for enhanced performance.
- Highly versatile and supports a wide range of hardware platforms and architectures.
Xen
- Open-source hypervisor providing high performance.
- Used by many large-scale cloud providers.
- Suitable for both para-virtualization and hardware-assisted virtualization.
Each of these alternatives has its own strengths and ideal use cases, so the best choice will depend on your specific requirements and environment.
Recommended Training: Ubuntu Linux Server Basics from Cody Ray Miller

Ubuntu Server Specification
We are using a minimal Ubuntu Server virtual machine with following specification.
- CPU – 3.4 Ghz (2 cores)
- Memory – 2 GB
- Storage – 20 GB
- Operating System – Ubuntu Server 18.04 LTS
- Hostname – virtualbox-01.centlinux.com
- IP Address – 192.168.116.218 /24
USB Type C 45W Chromebook Charger for HP Chromebook 14 X360 14-ca051wm 14-ca052wm 14-ca091wm ca061dx 14-ca0061dx 14-ca060nr 14-ca020nr 14-ca043cl USB C Power Supply Adapter
$9.99 (as of March 7, 2025 18:54 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Update Ubuntu Software Packages
Connect with virtualbox-01.centlinux.com as an admin user by using a ssh tool.
Execute following Linux command to check for updated software packages.
ahmer@ubuntu-server:~$ sudo apt update
Hit:1 http://pk.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://pk.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://pk.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 http://pk.archive.ubuntu.com/ubuntu bionic-security InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
10 packages can be upgraded. Run 'apt list --upgradable' to see them.
Install all available software updates using apt command.
ahmer@ubuntu-server:~$ sudo apt -y upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
libdumbnet1
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:
bsdutils fdisk libblkid1 libfdisk1 libmount1 libsmartcols1 libuuid1 mount
util-linux uuid-runtime
10 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,740 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://pk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 bsdutils amd64 1:2.31.1-0.4ubuntu3.6 [60.3 kB]
Get:2 http://pk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libuuid1 amd64 2.31.1-0.4ubuntu3.6 [20.1 kB]
Get:3 http://pk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libblkid1 amd64 2.31.1-0.4ubuntu3.6 [124 kB]
Get:4 http://pk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libfdisk1 amd64 2.31.1-0.4ubuntu3.6 [164 kB]
Get:5 http://pk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmount1 amd64 2.31.1-0.4ubuntu3.6 [136 kB]
Get:6 http://pk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libsmartcols1 amd64 2.31.1-0.4ubuntu3.6 [83.7 kB]
Get:7 http://pk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 fdisk amd64 2.31.1-0.4ubuntu3.6 [108 kB]
Get:8 http://pk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 util-linux amd64 2.31.1-0.4ubuntu3.6 [903 kB]
Get:9 http://pk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 mount amd64 2.31.1-0.4ubuntu3.6 [107 kB]
Get:10 http://pk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 uuid-runtime amd64 2.31.1-0.4ubuntu3.6 [34.8 kB]
Fetched 1,740 kB in 4s (398 kB/s)
(Reading database ... 102529 files and directories currently installed.)
Preparing to unpack .../bsdutils_1%3a2.31.1-0.4ubuntu3.6_amd64.deb ...
Unpacking bsdutils (1:2.31.1-0.4ubuntu3.6) over (1:2.31.1-0.4ubuntu3.5) ...
Setting up bsdutils (1:2.31.1-0.4ubuntu3.6) ...
(Reading database ... 102529 files and directories currently installed.)
Preparing to unpack .../libuuid1_2.31.1-0.4ubuntu3.6_amd64.deb ...
Unpacking libuuid1:amd64 (2.31.1-0.4ubuntu3.6) over (2.31.1-0.4ubuntu3.5) ...
Setting up libuuid1:amd64 (2.31.1-0.4ubuntu3.6) ...
(Reading database ... 102529 files and directories currently installed.)
Preparing to unpack .../libblkid1_2.31.1-0.4ubuntu3.6_amd64.deb ...
Unpacking libblkid1:amd64 (2.31.1-0.4ubuntu3.6) over (2.31.1-0.4ubuntu3.5) ...
Setting up libblkid1:amd64 (2.31.1-0.4ubuntu3.6) ...
(Reading database ... 102529 files and directories currently installed.)
Preparing to unpack .../libfdisk1_2.31.1-0.4ubuntu3.6_amd64.deb ...
Unpacking libfdisk1:amd64 (2.31.1-0.4ubuntu3.6) over (2.31.1-0.4ubuntu3.5) ...
Setting up libfdisk1:amd64 (2.31.1-0.4ubuntu3.6) ...
(Reading database ... 102529 files and directories currently installed.)
Preparing to unpack .../libmount1_2.31.1-0.4ubuntu3.6_amd64.deb ...
Unpacking libmount1:amd64 (2.31.1-0.4ubuntu3.6) over (2.31.1-0.4ubuntu3.5) ...
Setting up libmount1:amd64 (2.31.1-0.4ubuntu3.6) ...
(Reading database ... 102529 files and directories currently installed.)
Preparing to unpack .../libsmartcols1_2.31.1-0.4ubuntu3.6_amd64.deb ...
Unpacking libsmartcols1:amd64 (2.31.1-0.4ubuntu3.6) over (2.31.1-0.4ubuntu3.5) ...
Setting up libsmartcols1:amd64 (2.31.1-0.4ubuntu3.6) ...
(Reading database ... 102529 files and directories currently installed.)
Preparing to unpack .../fdisk_2.31.1-0.4ubuntu3.6_amd64.deb ...
Unpacking fdisk (2.31.1-0.4ubuntu3.6) over (2.31.1-0.4ubuntu3.5) ...
Setting up fdisk (2.31.1-0.4ubuntu3.6) ...
(Reading database ... 102529 files and directories currently installed.)
Preparing to unpack .../util-linux_2.31.1-0.4ubuntu3.6_amd64.deb ...
Unpacking util-linux (2.31.1-0.4ubuntu3.6) over (2.31.1-0.4ubuntu3.5) ...
Setting up util-linux (2.31.1-0.4ubuntu3.6) ...
(Reading database ... 102529 files and directories currently installed.)
Preparing to unpack .../mount_2.31.1-0.4ubuntu3.6_amd64.deb ...
Unpacking mount (2.31.1-0.4ubuntu3.6) over (2.31.1-0.4ubuntu3.5) ...
Preparing to unpack .../uuid-runtime_2.31.1-0.4ubuntu3.6_amd64.deb ...
Unpacking uuid-runtime (2.31.1-0.4ubuntu3.6) over (2.31.1-0.4ubuntu3.5) ...
Setting up mount (2.31.1-0.4ubuntu3.6) ...
Setting up uuid-runtime (2.31.1-0.4ubuntu3.6) ...
Processing triggers for systemd (237-3ubuntu10.39) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Add VirtualBox APT Repository
VirtualBox 5.2 is available in default APT repositories. You can check this by executing following command at Linux bash prompt.
ahmer@ubuntu-server:~$ apt search virtualbox | grep -B2 "base binaries"
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
virtualbox/bionic-updates 5.2.34-dfsg-0~ubuntu18.04.1 amd64
x86 virtualization solution - base binaries
If you want to install VirtualBox on Ubuntu then you can easily install it using apt command.
However, if you wish to install the latest version of VirtualBox, then you are required to add VirtualBox official APT repository in your Linux server, and then you can install VirtualBox thereon.
Before adding VirtualBox APT repository, you should add the GPG key of this repository in your Ubuntu server (As mentioned in VirtualBox documentation).
ahmer@ubuntu-server:~$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
OK
ahmer@ubuntu-server:~$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
OK
Edit APT repository’s sources list.
ahmer@ubuntu-server:~$ sudo vi /etc/apt/sources.list
And add following directive therein.
# VirtualBox APT Repository
deb https://download.virtualbox.org/virtualbox/debian bionic contrib
Run following command to fetch information from VirtualBox repository.
ahmer@ubuntu-server:~$ sudo apt update
Hit:1 http://pk.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://pk.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 https://download.virtualbox.org/virtualbox/debian bionic InRelease [4,432 B]
Get:4 http://pk.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://pk.archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:6 http://pk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [892 kB]
Get:7 https://download.virtualbox.org/virtualbox/debian bionic/contrib amd64 Packages [1,864 B]
Get:8 http://pk.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,060 kB]
Fetched 2,210 kB in 7s (299 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
VirtualBox APT repository has been added in Linux Server.
Install VirtualBox on Ubuntu Server
Oracle VirtualBox 6.1 is the latest version at the time of this writing. Now, you can easily install VirtualBox on Ubuntu by using apt command.
ahmer@ubuntu-server:~$ sudo apt install -y virtualbox-6.1
...
Setting up libqt5svg5:amd64 (5.9.5-0ubuntu1) ...
Setting up virtualbox-6.1 (6.1.4-136177~Ubuntu~bionic) ...
Adding group `vboxusers' (GID 113) ...
Done.
Setting up libwww-perl (6.31-1ubuntu0.1) ...
Setting up adwaita-icon-theme (3.28.0-1ubuntu1) ...
update-alternatives: using /usr/share/icons/Adwaita/cursor.theme to provide /usr/share/icons/default/index.theme (x-cursor-theme) in auto mode
Setting up liblwp-protocol-https-perl (6.07-2) ...
Setting up humanity-icon-theme (0.6.15) ...
Setting up libxml-parser-perl (2.44-2build3) ...
Setting up libxml-twig-perl (1:3.50-1) ...
Setting up ubuntu-mono (16.10+18.04.20181005-0ubuntu1) ...
Setting up libnet-dbus-perl (1.1.0-4build2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for udev (237-3ubuntu10.39) ...
Processing triggers for systemd (237-3ubuntu10.39) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for shared-mime-info (1.9-2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for libglib2.0-0:amd64 (2.56.4-0ubuntu0.18.04.6) ...
Setting up glib-networking:amd64 (2.56.0-1) ...
Setting up libsoup2.4-1:amd64 (2.62.1-1ubuntu0.4) ...
Setting up libsoup-gnome2.4-1:amd64 (2.62.1-1ubuntu0.4) ...
Setting up librest-0.7-0:amd64 (0.8.0-2) ...
Setting up libgtk-3-0:amd64 (3.22.30-1ubuntu4) ...
Setting up libgtk-3-bin (3.22.30-1ubuntu4) ...
Setting up qt5-gtk-platformtheme:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up notification-daemon (3.20.0-3) ...
Setting up libgirara-gtk3-3:amd64 (0.2.8-2) ...
Setting up zathura-pdf-poppler (0.2.8-1) ...
Setting up zathura (0.3.8-1) ...
Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.36.11-2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Oracle VirtualBox has been installed successfully.
Ansible for DevOps – A Comprehensive Guide from Beginner to Intermediate
$3.99 (as of March 7, 2025 18:51 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Final Thoughts
Installing VirtualBox on Ubuntu Server 18 can be a straightforward process if you follow the right steps. Whether you are setting up a test environment or deploying virtual machines for production, VirtualBox offers a robust solution for your virtualization needs.
Need expert AWS and Linux system administration? From cloud architecture to server optimization, I provide reliable and efficient solutions tailored to your needs. Hire me on Fiverr today!
FAQs
1. Can I install VirtualBox on Ubuntu Server 18 without a GUI?
Yes, you can install and manage VirtualBox on Ubuntu Server 18 using the command line.
2. Do I need to add a repository to install VirtualBox?
Yes, you may need to add the Oracle VirtualBox repository for the latest version.
3. What dependencies are required for VirtualBox on Ubuntu Server 18?
You need essential packages like dkms
, linux-headers
, and build-essential
.
4. Can I manage VirtualBox VMs on a server remotely?
Yes, you can use VBoxManage
for command-line management or enable VRDP for remote access.
5. Is VirtualBox on Ubuntu Server 18 suitable for production environments?
VirtualBox is best for testing and development; for production, consider KVM or VMware ESXi.
Leave a Reply
You must be logged in to post a comment.