I've used: centos/7
sudo yum install wget
wget http://download.virtualbox.org/virtualbox/5.0.30/VBoxGuestAdditions_5.0.30.iso
sudo mkdir /media/VBoxGuestAdditions
sudo mount -o loop,ro VBoxGuestAdditions_5.0.30.iso /media/VBoxGuestAdditions
sudo sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run
VBoxGuestAdditions_5.0.30.iso
sudo umount /media/VBoxGuestAdditions
sudo rmdir /media/VBoxGuestAdditions
systemctl disable NetworkManager
sudo yum clean all
Credit - https://scotch.io/tutorials/how-to-create-a-vagrant-base-box-from-an-existing-one#make-the-box-as-small-as-possible
sudo dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY
history -c
> ~/.bash_history
From the same directory (where the Vagrantfile
is on):
vagrant package --output my-centos7-box.box
vagrant box add my-centos7-box.box --name My-Centos7
I've had some issues with vagrant mounts in /var/www
could not be read in apache due to SELinux policies.
The fix: sudo setenforce 0
For production you will need to setup SELinux policies. See here for more info: