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:
- ✅ Linux / Mac / Windows host OS support for all functionality
- ✅ Reverse NFS mounts automated by triggers
- ✅ Automatic shell scripts generated to enable and configure NFS support on Windows
- ✅ Various commented performance tweaks
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
- Inside your local user directory, create a
dev
directory, and within that, aboxes
andsrc
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 thesrc
directory. Inside, you will find several OS-specific directories, each of which with a correspondingVagrantfile
inside. AVagrantfile
is a small ruby script that configures thevagrant
software and corresponding virtual machine instance. In this case, theVagrantfile
will configure avirtualbox
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 calledaracpac
, and copy one of theVagrantfile
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 eachVagrantfile
. -
Navigate to the
aracpac
directory using a command shell and issuevagrant 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 runvagrant 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 thearacpac
directory callednfs_fix.bat
. Run this file from the command shell, and when prompted, enter administrator user credentials, then issuevagrant 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:
- ssh into the box by issuing the
vagrant ssh
command - access the box through your web browser at https://dev.local/
- access the files in the box's webroot: on Windows, via the
X:
drive, and on Linux and Mac, via the./www
folder that is created in your project directory