Vagrant OEL 8 DevOps · VirtualBox · Setup

VagrantInstallation with VirtualBox

Install VirtualBox and Vagrant on macOS, Windows and OEL/RHEL 8 Linux. Verify installation, understand directory structure and set up .gitignore.

To use Vagrant with VirtualBox you need two things installed on your host machine — VirtualBox (the hypervisor) and Vagrant (the orchestration tool). Both are free and available for macOS, Windows, and Linux.

BASH — Install VirtualBox (macOS)
# Option 1: Download from official site
# https://www.virtualbox.org/wiki/Downloads
# Download the macOS .dmg and install

# Option 2: Using Homebrew (recommended)
brew install --cask virtualbox

# Verify
VBoxManage --version
⚠ Warning: On macOS Sonoma/Ventura you may need to allow VirtualBox in System Settings → Privacy & Security → Allow after installation.
BASH — Install Vagrant (macOS)
# Option 1: Download from official site
# https://developer.hashicorp.com/vagrant/downloads
# Download the macOS .dmg and install

# Option 2: Using Homebrew (recommended)
brew install --cask vagrant

# Verify
vagrant --version
BASH — Vagrant Plugins
# Install VirtualBox guest additions plugin
vagrant plugin install vagrant-vbguest

# Verify plugins
vagrant plugin list
BASH — Install VirtualBox (Windows)
# Download from:
# https://www.virtualbox.org/wiki/Downloads
# Run the Windows installer (.exe)

# Or using Chocolatey
choco install virtualbox

# Verify in PowerShell
VBoxManage --version
BASH — Install Vagrant (Windows)
# Download from:
# https://developer.hashicorp.com/vagrant/downloads
# Run the Windows installer (.msi) — requires restart

# Or using Chocolatey
choco install vagrant

# Verify in PowerShell
vagrant --version
BASH — Install on OEL/RHEL 8
# Install VirtualBox
sudo dnf install -y kernel-devel kernel-headers dkms
sudo rpm --import https://www.virtualbox.org/download/oracle_vbox.asc
sudo curl -o /etc/yum.repos.d/virtualbox.repo   https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
sudo dnf install -y VirtualBox-7.0

# Install Vagrant
sudo rpm --import https://rpm.releases.hashicorp.com/gpg
sudo curl -o /etc/yum.repos.d/hashicorp.repo   https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo dnf install -y vagrant

# Verify
VBoxManage --version
vagrant --version
BASH — Verify Installation
# Check Vagrant version
vagrant --version

# Check VirtualBox version
VBoxManage --version

# Check Vagrant can see VirtualBox
vagrant status

# List available boxes (empty on fresh install)
vagrant box list

Vagrant stores its data in these locations:

LocationPurpose
~/.vagrant.d/Vagrant home — boxes, plugins, data
~/.vagrant.d/boxes/Downloaded box images stored here
~/.vagrant.d/plugins.jsonInstalled plugins list
./VagrantfileYour project config (per project)
./.vagrant/Per-project VM state (auto-created)
💡 Note: The .vagrant/ folder in your project directory should be added to .gitignore — it contains machine-specific state that should not be committed.
BASH — .gitignore for Vagrant
# Create .gitignore for Vagrant projects
cat > .gitignore << EOF
.vagrant/
*.log
*.box
EOF