Turbocharged Vagrantfiles
The Vagrantfiles
in this repository have been optimized for the
AracPac Vagrant boxes. Important configuration details like the box IP,
primary hostname and aliases, and local and remote share points can be configured by modifying variables at the top of
each Vagrantfile
. Some features of these Vagrantfiles
are:
First, you will first need to download and install vagrant and
virtualbox.
Once you’ve installed vagrant, you will also need to install the
Vagrant Host Manager plugin, which you can do from the command
line after vagrant is installed:
vagrant plugin install vagrant-hostmanager
dev
directory, and within that, a boxes
and src
directory:
.
└── dev
├── boxes <-- used to store vagrant instances
└── src <-- used to store git source code
Navigate to the src
directory using a command shell and clone this codebase by issuing the command below. This will
download all the source code from this repository to your computer. You will be prompted for your GitHub username and
password.
git clone https://github.com/aracpac/aracpac-vagrantfiles
You will now have an aracpac-vagrantfiles
directory within the src
directory. Inside, you will find several OS-specific
directories, each of which with a corresponding Vagrantfile
inside. A Vagrantfile
is a small ruby
script that configures the vagrant
software and corresponding virtual machine instance. In this case, the Vagrantfile
will configure a virtualbox
instance, or box.
.
└── dev
├── boxes
└── src
└── aracpac-vagrantfiles
├── README.md
├── centos9-stream <-- Vagrant configuration files to use for a CentOS 9 virtual machine
└── Vagrantfile
└── ubuntu22 <-- Vagrant configuration files to use for a Ubuntu 22 virtual machine
└── Vagrantfile
...
Now navigate to the boxes
folder using your command shell, create a new directory called aracpac
, and copy one of
the Vagrantfile
s into this directory. NOTE: you will need to create a new empty directory with a uniqueVagrantfile
for every box you wish to create. Be sure to update the # local ip for the box
and # domain for the
box
configuration variables at the top of each Vagrantfile
.
Navigate to the aracpac
directory using a command shell and issue vagrant up
. Vagrant should now download the box
and set up a local environment for you to use. NOTE FOR WINDOWS USERS: the first time you run vagrant up
, the
script may end with an error if you do not have
Services for Network File System
installed. This is expected and addressed in the next step.
ONE TIME STEP FOR WINDOWS USERS: After running vagrant up
, you will find a new file in the aracpac
directory
called nfs_fix.bat
. Run this file from the command shell, and when prompted, enter administrator user credentials,
then issue vagrant up
againt after the script runs. The script will:
- enable Services for Network File System
- map the Windows anonymous user’s
uid
andgid
to1000
, which is theuid
of thevagrant
user in the box- set the default windows filemode to 775, which ensures files and directories created on the nfs share are group
writable
Once vagrant is ready, you can:
vagrant ssh
commandX:
drive, and on Linux and Mac, via the ./www
folder