How to install Virtual Box 5.2.12 on Ubuntu 18.04

To install VirtualBox 5.2.12 on Ubuntu 18.04

VirtualBox is a free and cross-platform virtualization application. It supports both 32bit and 64bit Architecture guest operating system. You can create and run guest operating systems inside a window of the host computer. This tutorial covers the method to install VirtualBox V 5.1 on Ubuntu 18.04.

Installation

Before starting your installation add the Oracle public key using the following command

root@linuxhelp1:~# wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
OK

Add a VirtualBox repository to your system.

root@linuxhelp1:~# echo " deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic contrib"  | sudo tee /etc/apt/sources.list.d/virtualbox.list
deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic contrib

Update the system repository

root@linuxhelp1:~# apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://download.virtualbox.org/virtualbox/debian bionic InRelease [4,429 B]            
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]                               
Get:4 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease [83.2 kB]  
Get:5 http://download.virtualbox.org/virtualbox/debian bionic/contrib amd64 Packages [1,430 B]
.
.
Get:16 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [120 kB]
Get:17 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [120 kB]
Get:18 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [190 kB]
Get:19 http://in.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [5,100 B]
Fetched 1,282 kB in 4s (309 kB/s)  
Reading package lists... Done

Install VM VirtualBox application using the following command

root@linuxhelp1:~# apt-get install virtualbox-5.2 -y
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap linux-headers-4.15.0-20 linux-headers-4.15.0-20-generic
  linux-image-4.15.0-20-generic linux-modules-4.15.0-20-generic
  linux-modules-extra-4.15.0-20-generic
Use ' sudo apt autoremove'  to remove them.
The following additional packages will be installed:
.
.
Setting up libqt5x11extras5:amd64 (5.9.5-0ubuntu1) ...
Setting up libqt5widgets5:amd64 (5.9.5+dfsg-0ubuntu1) ...
Setting up gcc-7 (7.3.0-16ubuntu3) ...
Setting up gcc (4:7.3.0-3ubuntu2) ...
Setting up libqt5printsupport5:amd64 (5.9.5+dfsg-0ubuntu1) ...
Setting up libqt5opengl5:amd64 (5.9.5+dfsg-0ubuntu1) ...
Setting up libqt5svg5:amd64 (5.9.5-0ubuntu1) ...
Setting up virtualbox-5.2 (5.2.12-122591~Ubuntu~bionic) ...
Adding group `vboxusers'  (GID 127) ...
Done.
Processing triggers for libc-bin (2.27-3ubuntu1) ...

After installing the application you can access the application from the menu

once you launch the application you can create a virtual machine and start working on.

You can see the version of Virtualbox from the help menu

with this, the method to install VirtualBox 5.2.12 on Ubuntu 18.04 comes to an end.

Comment
parthiban
Aug 27 2018
Yes it is mandatory, In order to install Virtualbox, you must have the public key on your machine
Venkat
Jul 09 2018
What is the use of adding oracle public key in first step? is that mandatory to add that ?
Add a comment
FAQ
Q
Is virtual machine safe?
A
Virtual machines are an isolated environment from the physical operating system, so you can run potentially dangerous stuff, such as malware, without fear of compromising your main OS. They're a safe environment, but there are exploits against virtualization software, allowing malware to spread to the physical system.
Q
What is VirtualBox VMS?
A
Oracle VM VirtualBox is a free, open source, cross-platform application for creating, managing and running virtual machines (VMs). Each virtual machine can execute its own operating system, including versions of Microsoft Windows, Linux, BSD, and MS-DOS.
Q
Is Virtual Box free?
A
Oracle VM VirtualBox (formerly Sun VirtualBox, Sun xVM VirtualBox and Innotek VirtualBox) is a free and open-source hypervisor for x86 computers currently being developed by Oracle Corporation. ... VirtualBox may be installed on a number of host operating systems, including: Linux, macOS, Windows, Solaris, and OpenSolaris.
Q
Can I redistribute the VirtualBox base package binaries?
A
Yes. The GPLv2 allows you to distribute the VirtualBox base package binaries, in modified or unmodified form, as long as you adhere to the terms and conditions of the GPLv2.
Q
How does virtual box work?
A
Virtualization in the Computer Science field means providing a virtual version of hardware or software to another software. For example, VirtualBox provides a virtual version of your CPU and Memory to its guest OS. Java Virtual Machine and .NET CLR also follow the same principles.