Install VBoxGuestAdditions in RPM based Vagrant Guest

function install_vb_additions
    local VB_VERSION="$1";
    local download_url=${VB_VERSION}/VBoxGuestAdditions${VB_VERSION}.iso
    curl -C - -O $download_url
    sudo mkdir /mnt/iso
    sudo mount -o loop VBoxGuestAdditions${VB_VERSION}.iso /mnt/iso
    sudo yum install -y kernel-devel-`uname -r` gcc make perl bzip2
    pushd /mnt/iso
    sudo ./
    sudo umount /mnt/iso

How to use

Get version of VirtualBox

VBoxManager --version

Steps to install VBoxGuestAdditions

Let's assume version of VirtualBox is 5.0.12.

vagrant ssh
# Paste function install_vb_additions in shell
install_vb_additions 5.0.12
vagrant reload

comments powered by Disqus