Creating a custom vagrant box is easy. Start with obtaining an iso and installing it in a hypervizor. Here, I choose a Debian, http://cdimage.debian.org/debian-cd/8.1.0/amd64/iso-cd/debian-8.1.0-amd64-netinst.iso,
debian-8.1.0-amd64-netinst.iso in Oracle VM Virtual Box.
Create a virtual machine named
512 MB memory with creating a virtual hard drive. Remember that base settings such as memory may easily be incremented through individual Vagrant implementation. Here I will choose
40 GB dynamically allocated virtual machine disk file type.
Some conventions are setting host name to
vagrant-debian81-raring with domain
vagrantup.com. Again these may be overridden in Vagrant configuration later. Root password should be
vagrant, and a user
vagrant should be created with password
vagrant. We have option to use ssh authentication later if we desire passwordless connection.
Since Vagrant needs ssh connection, shh server should be installed in virtual machine.
Vagrant also needs guest additions to perform. First install linux headers and build essentials,
Then guest additions may be installed through first pointing the necessary iso in hypervizor, then mounting the device and running the installation script as follows,
Vagrant may use passwordless ssh authentication. In order to perform this, create a new group
admin and make
vagrant user belong to group
visudo to give members of
admin group passwordless privileges,
Puppet will be handy in elegant provisioning, so it is better to install it. It will also be good to test if
vagrant is able to do privilege jobs without password (after a logout / login).
And as a last step, put default public keys of vagrant to virtual machine.
We clean temporary files
And make virtual machine a vagrant box with;
This should create package.box in working directory which is
d:\ in my case. Now, let’s add this new box into vagrant base box list,
Now, let’s use newly created base to prepare a system for mooc
M101JS: MongoDb for NodeJs developers, https://university.mongodb.com/courses/M101JS/about,
I will modify
default.pp to make sure
mongodb is installed. More information about provisioning may be seen in an earlier blog, https://sifaserdarozen.wordpress.com/2015/07/10/cultivating-a-development-system-through-vagrant-puppet/
After provisioning, our system is ready for the course,