Vagrant OEL 8 DevOps · VirtualBox · OEL 8

VagrantOEL 8 Box Setup & Configuration

Use public OEL 8 boxes from Vagrant Cloud or build your own custom VirtualBox box. Configure VM for Vagrant, install Guest Additions and package the box.

A Vagrant box is a packaged VM image. For Oracle Enterprise Linux 8 (OEL 8) you have three options — use a public box from Vagrant Cloud, use Oracle's official box, or create your own custom box. This page covers all three approaches for both VirtualBox and Parallels.

Vagrant Cloud hosts community and vendor-maintained boxes. For OEL 8 the best options are:

Box NameProviderNotes
generic/oracle8VirtualBox, ParallelsMost popular, well maintained
oraclelinux/8VirtualBoxOfficial Oracle box
bento/oraclelinux-8VirtualBox, ParallelsBento project — very stable
geerlingguy/oracle8VirtualBoxJeff Geerling — Ansible tested
BASH — Add Public OEL 8 Box
# Add OEL 8 box for VirtualBox
vagrant box add generic/oracle8 --provider virtualbox

# Add OEL 8 box for Parallels
vagrant box add generic/oracle8 --provider parallels

# Add official Oracle box
vagrant box add oraclelinux/8

# List what you have
vagrant box list

# Create a quick Vagrantfile to test
mkdir oel8-test && cd oel8-test
vagrant init generic/oracle8
vagrant up --provider=virtualbox
vagrant ssh
# You are now inside OEL 8!

Building your own box gives you full control — pre-install packages, configure Oracle settings, set up users. Here is how to create an OEL 8 box for VirtualBox:

BASH — Create Base VM
# In VirtualBox GUI:
# 1. New VM → Name: OEL8-Base → Type: Linux → Version: Oracle (64-bit)
# 2. RAM: 2048 MB
# 3. Disk: 40GB VDI, dynamically allocated
# 4. Mount OEL 8 ISO and install OS

# During OEL 8 installation:
# - Minimal install
# - Set root password
# - Create user: vagrant / password: vagrant
# - Hostname: localhost.localdomain
BASH — Configure VM for Vagrant
# Inside the OEL 8 VM after installation:

# 1. Install VirtualBox Guest Additions dependencies
sudo dnf install -y gcc make perl kernel-devel kernel-headers bzip2

# 2. Mount and install Guest Additions
# (In VirtualBox menu: Devices → Insert Guest Additions CD)
sudo mount /dev/cdrom /mnt
sudo /mnt/VBoxLinuxAdditions.run
sudo umount /mnt

# 3. Create vagrant user with sudo
sudo useradd vagrant
echo "vagrant" | sudo passwd --stdin vagrant
echo "vagrant ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/vagrant
sudo chmod 440 /etc/sudoers.d/vagrant

# 4. Add Vagrant insecure public key
sudo mkdir -p /home/vagrant/.ssh
sudo chmod 700 /home/vagrant/.ssh
sudo curl -sSL https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub   -o /home/vagrant/.ssh/authorized_keys
sudo chmod 600 /home/vagrant/.ssh/authorized_keys
sudo chown -R vagrant:vagrant /home/vagrant/.ssh

# 5. Configure SSH
sudo sed -i "s/^#AuthorizedKeysFile/AuthorizedKeysFile/" /etc/ssh/sshd_config
sudo systemctl restart sshd

# 6. Disable firewall (or configure it)
sudo systemctl disable firewalld
sudo systemctl stop firewalld

# 7. Disable SELinux (for lab use)
sudo setenforce 0
sudo sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config

# 8. Clean up
sudo dnf clean all
sudo rm -rf /tmp/*
sudo cat /dev/null > /home/vagrant/.bash_history
history -c
BASH — Package VirtualBox Box
# Shutdown the VM first
sudo shutdown -h now

# On your HOST machine — package the VirtualBox VM
vagrant package --base "OEL8-Base" --output oel8-base.box

# Add the box to Vagrant
vagrant box add oel8-custom oel8-base.box

# Verify
vagrant box list
OSBox Storage Location
macOS~/.vagrant.d/boxes/
WindowsC:\Users\username\.vagrant.d\boxes\
Linux~/.vagrant.d/boxes/
💡 Note: The generic/oracle8 box from Vagrant Cloud is the easiest starting point. Build a custom box only when you need pre-installed software or specific Oracle configurations.