Install Oracle VirtualBox on Ubuntu Server 18.04 LTS - CentLinux

Latest

Tuesday, 24 March 2020

Install Oracle VirtualBox on Ubuntu Server 18.04 LTS

Install Oracle VirtualBox on Ubuntu Server 18.04 LTS

VirtualBox is a free and open source hypervisor developed and maintained by Oracle Corporation. VirtualBox can be installed on Linux, Windows, macOS, etc. and it supports the creation of guest virtual machines for various operating systems.

In this article, we are installing Oracle VirtualBox on Ubuntu Server 18.04 LTS.

There is a good reference book for you, while working at the Ubuntu command line is Ubuntu Linux Toolbox by Wiley. It contains 1000+ commands for Ubuntu and Debian power users.

 

This Article Provides:

     

    Environment 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

     

    Upgrade Ubuntu Server 18.04 Software Packages:

    Connect with virtualbox-01.centlinux.com as an admin user by using a ssh tool.

    Execute following 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 in Ubuntu Server:

    VirtualBox 5.2 is available in default APT repositories. You can check this using following command.

    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 5.2 then you can easily install it using apt command.

    But we are installing the latest version of VirtualBox, therefore, we need to add VirtualBox official APT repository in our Ubuntu server, and then we can install VirtualBox thereon.

    Before adding VirtualBox APT repository, we are adding the GPG key of this repository in our 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.

     

    Installing Oracle VirtualBox on Ubuntu Server 18.04 LTS:

    VirtualBox APT repository has been added in Ubuntu Server. Now, we can install Oracle VirtualBox 6.1 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 6.1 has been installed on Ubuntu Server 18.04 LTS.

    No comments:

    Post a comment