Skip to content

Instantly share code, notes, and snippets.

@djravine
Last active April 9, 2020 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djravine/aeaaaf28e7ce9b51188c1403f1db6560 to your computer and use it in GitHub Desktop.
Save djravine/aeaaaf28e7ce9b51188c1403f1db6560 to your computer and use it in GitHub Desktop.
Install Virtualbox6.0 on Ubuntu18.04
#!/bin/bash
set -o pipefail
# GIST: https://gist.github.com/djravine/aeaaaf28e7ce9b51188c1403f1db6560
# USAGE: curl -sL https://gist.github.com/djravine/aeaaaf28e7ce9b51188c1403f1db6560/raw | sudo bash -s --
apt-get remove -y --purge virtualbox*
apt-get autoremove -y
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | apt-key add -
echo "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
apt-get update
apt-get install -y virtualbox-6.0
ln -s /usr/lib/virtualbox/UnattendedTemplates /usr/share/virtualbox/UnattendedTemplates
# FIX BUG - https://www.virtualbox.org/ticket/18411
sed -i "s|/bin/bash /root/vboxpostinstall.sh --preseed-late-command|/bin/sh /target/root/vboxpostinstall.sh --need-target-bash --preseed-late-command|g" /usr/lib/virtualbox/UnattendedTemplates/ubuntu_preseed.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment