Skip to content

Instantly share code, notes, and snippets.

@clivewalkden
Forked from fernandoaleman/gist:5083680
Last active September 30, 2022 03:13
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save clivewalkden/b4df0074fc3a84f5bc0a39dc4b344c57 to your computer and use it in GitHub Desktop.
Save clivewalkden/b4df0074fc3a84f5bc0a39dc4b344c57 to your computer and use it in GitHub Desktop.
How to add VirtualBox Guest Additions for vagrant into minimal install of Cent OS 7.
# Start the old vagrant
$ vagrant init centos-7
$ vagrant up
# You should see a message like:
# Installing Virtualbox Guest Additions 5.0.20 - guest version is unknown
$ vagrant ssh
vagrantup:~$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm
vagrantup:~$ sudo yum -y update
vagrantup:~$ sudo yum -y install wget nano
vagrantup:~$ cd /opt
vagrantup:~$ sudo wget -c http://download.virtualbox.org/virtualbox/5.0.20/VBoxGuestAdditions_5.0.20.iso \
-O VBoxGuestAdditions_5.0.20.iso
vagrantup:~$ sudo mount VBoxGuestAdditions_5.0.20.iso -o loop /mnt
vagrantup:~$ cd /mnt
vagrantup:~$ sudo sh VBoxLinuxAdditions.run --nox11
vagrantup:~$ cd /opt
vagrantup:~$ sudo rm *.iso
vagrantup:~$ cat /dev/null > ~/.bash_history
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-7.box
@jonasschultzmblox
Copy link

Made a slight improvement - one you actually can run.
https://gist.github.com/jonasschultzmblox/f15fe3c10769d5f269635a54394c84d4

But all the credits to you!

@Himavanth123
Copy link

thanks both of you for you support .
i am new to dev ops and i struggled more than 5 hours for taking up vagrant boxes.
finally i got it.
thanks once again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment