Mac OS X
- install virtualbox
- install vagrant
- download CentOS 7 minimal ISO
- create a new virtualbox instance "centos7base"
- 512 mb ram
- VDI, dynamically allocated, 8 gb
- disable USB and audio controllers
- insert the centos 7 iso into the virtual drive
- start "centos7base"
- activate nic in network (turn on)
- activate ntp in date/time (turn on switch, upper-right)
- click begin installation
- set root password
vagrant
- add user
vagrant
passwordvagrant
- reboot after installation completes
- login as
root
$ visudo
- append line:
vagrant ALL=(ALL) NOPASSWD: ALL
- remove line:
Defaults requiretty
- append line:
- exit
- login as
vagrant
- authorize vagrant insecure key pair for ssh
$ mkdir -m 700 .ssh
$ curl -o authorized_keys https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub
$ chmod 600 authorized_keys
- make sshd nicer when no internet
$ sudo vi /etc/ssh/sshd_config
- insert line:
UseDNS no
- install updates
$ sudo yum -y upgrade && sudo reboot
- install EPEL repository
$ sudo rpm -Uvh http://mirror.steadfast.net/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
- install virtualbox guest additions
- insert the virtualbox linux additions cd
### in guest
$ sudo yum -y install kernel-devel dkms bzip2 && sudo reboot
$ sudo mkdir -m 000 /mnt/cdrom
$ sudo mount /dev/cdrom /mnt/cdrom
$ cd /mnt/cdrom
$ sudo sh VBoxLinuxAdditions.run
$ sudo shutdown -h now
- now package the box from the host
### on host
$ vagrant package --base centos7base
### if you want to test it locally
$ vagrant box add package.box --name centos7base
Why not a bash script that you can provision directly from the Vagrantfile?