[HOW TO] Update To VirtualBox 7.x

In light of the many issues reported with Virtual Box 6.x, caused by an incompatible kernel module1 introduced with recent updates, it may be best to upgrade to a newer version of Virtual Box which seems to solve 2 these issues; some of them anyway.

Zorin OS 17 does not have offer Virtual Box at version 7.x, unfortunately. It needs to be installed manually, following either one of these methods:

  1. Download and install precompiled binary file from Oracle. This is likely the easier choice for people not experienced using the terminal, but has the downside that it won't automatically update Virtual Box anymore.

  2. Update the software repositories. This is the preferred method as it ensures that the Virtual Box continues to receive updates when available. It's also a little safer as it requires using cryptographic signatures. It involves running a few terminal commands, there's no way around it, but they are very easy to follow along.

Prerequisites:

  1. Make any necessary backups to keep your virtual machines and other settings.
  2. Uninstall VirtualBox.

Option #1: Download and install precompiled binary file from Oracle

  1. Visit the Virtual Box download page and choose Ubuntu 20.04 if you are running Zorin OS 16, and Ubuntu 22.04 if you are running Zorin OS 17:

  2. Double click on the downloaded file to install it. You will be prompted with a warning message about installing packages in this way; you can click "Run Anyway".

  3. After that you will be taken to the Software Store where you can finally click on "Install".

Option #2: Update the software repositories

  1. Update the software repositories to point to the latest version of Virtual Box. To do that, create a new file at the location /etc/apt/sources.list.d/virtualbox.sources with the following contents.
    You will need root privileges to edit this file.

    Architectures: amd64
    Components: contrib
    Enabled: yes
    Signed-By: /etc/apt/keyrings/oracle-virtualbox-2016.gpg
    Suites: jammy
    Types: deb
    URIs: https://download.virtualbox.org/virtualbox/debian
    

    Please note, if you are running Zorin OS 16, you need to change the "Suites" field from "jammy" to "focal". In addition, the following directory needs to be created upfront:

    sudo mkdir /etc/apt/keyrings
    
  2. Download the public key used to verify the package sources (this is done automatically during updates):

    wget https://www.virtualbox.org/download/oracle_vbox_2016.asc
    
  3. Verify that the public key is the correct; do not proceed with the installation if the fingerprint is not the same:

    gpg --show-keys oracle_vbox_2016.asc
    

    Expected output:

    pub   rsa4096 2016-04-22 [SC]
          B9F8D658297AF3EFC18D5CDFA2F683C52980AECF
    uid                      Oracle Corporation (VirtualBox archive signing key)    <info@virtualbox.org>
    sub   rsa4096 2016-04-22 [E]
    
  4. Once verified, you can tell the system to use this key:

    sudo gpg -o /etc/apt/keyrings/oracle-virtualbox-2016.gpg --dearmor oracle_vbox_2016.asc
    
  5. Update the repositories so that it can find the new version of Virtual Box. If everything was done correctly, there should be no errors:

    sudo apt update
    
  6. Install Virtual Box at the desired version. You can choose between virtualbox-7.1to install 7.1 specifically, or virtualbox-7.0 to let it automatically figure out the latest version available (within the 7.x release).

    sudo apt install virtualbox-7.0
    
2 Likes