-
GitHub stars
Vagrant
# Providers
Trellis supports most of Vagrant's common providers automatically. By default we recommend VirtualBox since it's free and open source. However, if you need or prefer one of the commercial providers (eg: VMWare or Parallels), they can be used as well.
This main exception here is for developers on Macs with Apple Silicon chips. Because these are ARM-based CPUs, VirtualBox won't work; it's limited to x86 CPUs like Intel and AMD.
# Parallels (Apple Silicon Macs)
Currently Parallels is the best solution for running virtual machines on Apple Silicon based Macs. Unfortunately, Parallels is a paid and commercial product unlike VirtualBox. Parallels Pro is required as well which has a yearly subscription price of $99 USD.
If you'd like to support Roots, please purchase Parallels Pro through our affiliate link
Installation:
- Purchase Parallels Pro
- Install Parallels
- Install the Vagrant provider:
vagrant plugin install vagrant-parallels
See the Parallels site for more details.
# Configuration
Editing the Vagrantfile
directly should be avoided unless necessary. Instead,
you can easily set common settings in vagrant.default.yml
.
To make local overrides, create a vagrant.local.yml
file with any overrides
you want. Note: this file is Git ignored.
# Vagrantfile
The example Vagrantfile
in this project can be kept in this folder or moved anywhere else such as a project/site folder. Generally, if you want to have multiple sites on 1 Vagrant VM, you should keep the Vagrantfile
where it is (in the trellis dir). If you want to have 1 Vagrant VM per project/site, you should make copies of the Vagrantfile
and put them into each project's dir. You'd then run vagrant up
from the project-specific directory.
# Synced folders
Trellis uses Vagrant's synced folder feature to sync folders from your local machine (like your Trellis project itself) to the virtual machine. Vagrant supports different types of mount options for synced folders like NFS, SMB, and Virtualbox's native option.
By default, Trellis tries to default to NFS because it offers the best performance for macOS users. To change the mount type for synced folders, you can change the vagrant_mount_type
configuration option:
vagrant_mount_type: nfs
Whenever you change the mount type on an existing Vagrant box, you need to run vagrant reload
for the changes to take affect (or destroy and create a new one).
We suggest trying differet options and seeing what works best for you.
# NFS
For more NFS details and troubleshooting, see the official Vagrant docs.
# Virtualbox
While nfs
is the default mount type, the virtualbox
method might offer better I/O performance on Linux hosts (up to 9x faster writes and 25x faster reads).
virtualbox
is also much simpler than nfs
since it's built-into VirtualBox and requires no other software or configuration.
See this issue for details and tests results.
Contributors
Last updated
Support Roots
Help us continue to build and maintain our open source projects. We’re a small team of independent developers and every little bit helps.
Sponsor Roots on GitHub