-
-
Save bennythejudge/1e161db32328b78f6c8b1d287bf78176 to your computer and use it in GitHub Desktop.
How to update VirtualBox Guest Additions with vagrant (updated to VirtualBox 5.1.24)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use centos/7 | |
$ vagrant init centos/7 | |
$ vagrant up | |
# You should see a message like: | |
# [default] The guest additions on this VM do not match the install version of | |
# VirtualBox! This may cause things such as forwarded ports, shared | |
# folders, and more to not work properly. If any of those things fail on | |
# this machine, please update the guest additions and repackage the | |
# box. | |
# | |
# Guest Additions Version: 5.1.24 | |
# VirtualBox Version: 5.1.24 | |
######################################################################################################## | |
## ATTENTION: | |
## Make sure you use the version of Guest Additions that match your VirtualBox version | |
## When following this gist in the future, the version referenced above will be obsolete. | |
$ vagrant ssh | |
vagrantup:~$ sudo yum -y update | |
vagrantup:~$ cd /opt | |
# replacing the version so that you are forced to change it and use the correct one | |
vagrantup:~$ sudo wget -c http://download.virtualbox.org/virtualbox/4.2.8/VBoxGuestAdditions_x.y.z.iso \ | |
-O VBoxGuestAdditions_x.y.z.iso | |
vagrantup:~$ sudo mount VBoxGuestAdditions_x.y.z.iso -o loop /mnt | |
vagrantup:~$ cd /mnt | |
vagrantup:~$ sudo sh VBoxLinuxAdditions.run --nox11 | |
vagrantup:~$ cd /opt | |
vagrantup:~$ sudo rm *.iso | |
vagrantup:~$ sudo /etc/init.d/vboxadd setup | |
vagrantup:~$ sudo chkconfig --add vboxadd | |
vagrantup:~$ sudo chkconfig vboxadd on | |
vagrantup:~$ exit | |
# Now check that the Guest Additions work | |
$ vagrant halt | |
$ vagrant up | |
# Package the new VM | |
$ vagrant halt | |
$ vagrant package | |
$ mv package.box centos-x.y.box |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment