Here are some of the things I had to look up at some point when using Oracle's VirtualBox hypervisor.

INSTALL GUEST ADDITIONS

To install the Guest Additions into your CentOS VM:

  1. First we install necessary packages

    sudo yum install epel-release
    sudo yum install gcc kernel-devel kernel-headers dkms make bzip2 perl
    sudo yum groupinstall "Development Tools"
    sudo yum update
    
    systemctl reboot
    
  2. After rebooting and getting to the terminal/GUI in the VM, we must inject the Guest Additions CD image into the VM.

    • Goto the "Devices" pulldown menu in VirtualBox, and select "Insert Guest Additions CD Image"
    • VirtualBox will request to download the CD image, allow it to do so
    • After download, it will ask to attach it to the VM, allow it to do so
    • You will now have a CD image attached to the system. The CD has been built to autorun the appropriate installer. So, for example, in GNOME, you can double click on the CD desktop icon.
    • You will have a terminal window open that will start the installation process.
    • After installation process, you must reboot

      systemctl reboot

    • Each time you install a new version of VirtualBox, or the kernel in a VM, you will need to repeat this step

  3. To mount your shared drive:

    • On the fly, in the terminal

      sudo mount -t vboxsf SHARENAME MOUNTPOINT

    • In /etc/fstab

      SHARENAME MOUNTPOINT vboxsf defaults 0 0

    • Sample setup

      ~$ sudo mkdir /mnt/host-downloads ~$ sudo mount -t vboxsf host-downloads /mnt/host-downloads ~$ ls /mnt/host-downloads CentOS-7-x86_64-Minimal-1708.iso clonezilla-live-20180329-artful-amd64.iso clonezilla-live-2.5.5-38-amd64.iso Fedora-Workstation-Live-x86_64-28-1.1.iso pi-topOS-2018-04-03.zip pop-os_18.04_amd64_nvidia_17.iso ~$

  4. References

    https://www.virtualbox.org/manual/ch04.html#sharedfolders

EL7 REPO

To install on EL7:

  1. Install dependencies

    sudo yum install epel-release
    sudo yum install kernel-devel kernel-headers dkms 
    sudo yum groupinstall "Development Tools"
    sudo yum update
    
  2. Install repository

    wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
    sudo rpm --import oracle_vbox.asc
    
  3. Install VirtualBox

    sudo wget http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo
    sudo yum install VirtualBox
    
  4. Reboot (necessary)

    sudo systemctl reboot
    
  5. Setup service

    sudo service vboxdrv setup
    
  6. Add user to "vboxusers" group

    sudo usermod -a -G vboxusers YOURUSERNAME
    

FEDORA REPO

  1. Install dependencies

    sudo dnf install epel-release
    sudo dnf install kernel-devel kernel-headers dkms 
    sudo dnf groupinstall "Development Tools"
    sudo dnf update
    
  2. Install repository

    wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
    sudo rpm --import oracle_vbox.asc
    
  3. Install VirtualBox

    sudo wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo
    sudo dnf install VirtualBox
    
  4. Reboot (necessary)

    sudo systemctl reboot
    
  5. Setup service

    sudo service vboxdrv setup
    
  6. Add user to "vboxusers" group

    sudo usermod -a -G vboxusers YOURUSERNAME
    

UBUNTU 17.10+ REPO

  1. Install dependencies, update system, and reboot

    sudo apt-get -y install gcc make linux-headers-$(uname -r) dkms
    sudo apt update
    sudo apt upgrade
    sudo systemctl reboot
    
  2. Install Repository

    wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
    sudo sh -c 'echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" >> /etc/apt/sources.list.d/virtualbox.list'
    
  3. Install VirtualBox

    sudo apt install virtualbox