Skip to content

Instantly share code, notes, and snippets.

@kwakwaversal
Forked from fernandoaleman/gist:5083680
Last active July 23, 2018 21:04
Show Gist options
  • Save kwakwaversal/8e954919f98a8b39b8a7f808aa9d8b03 to your computer and use it in GitHub Desktop.
Save kwakwaversal/8e954919f98a8b39b8a7f808aa9d8b03 to your computer and use it in GitHub Desktop.
How to update VirtualBox Guest Additions for debian/jessie64 with vagrant #shell
# Start a vagrant without virtualbox guest additions
$ vagrant init debian/jessie64
$ 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.4
# VirtualBox Version: 5.1.4
$ vagrant ssh
vagrantup:~$ sudo apt-get -y update
vagrantup:~$ sudo apt-get install --no-install-recommends -yq build-essential linux-headers-$(uname -r)
#vagrantup:~$ sudo apt-get install --no-install-recommends -yq module-assistant && sudo m-a prepare
vagrantup:~$ cd /opt
vagrantup:~$ sudo wget -c http://download.virtualbox.org/virtualbox/5.1.4/VBoxGuestAdditions_5.1.4.iso \
-O VBoxGuestAdditions_5.1.4.iso
vagrantup:~$ sudo mount VBoxGuestAdditions_5.1.4.iso -o loop /mnt
vagrantup:~$ cd /mnt
vagrantup:~$ sudo sh VBoxLinuxAdditions.run
vagrantup:~$ cd /opt
vagrantup:~$ sudo rm *.iso
vagrantup:~$ sudo umount /mnt
vagrantup:~$ sudo apt-get remove --auto-remove -y build-essential linux-headers-$(uname -r) # module-assistant
vagrantup:~$ sudo apt-get autoremove -y
vagrantup:~$ sudo apt-get clean
vagrantup:~$ sudo rm -rf /var/lib/apt/lists/*
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-6.3.box
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment