OEL 8 Box — Options & Setup
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.
Option 1 — Public Boxes from Vagrant Cloud
Vagrant Cloud hosts community and vendor-maintained boxes. For OEL 8 the best options are:
| Box Name | Provider | Notes |
|---|---|---|
| generic/oracle8 | VirtualBox, Parallels | Most popular, well maintained |
| oraclelinux/8 | VirtualBox | Official Oracle box |
| bento/oraclelinux-8 | VirtualBox, Parallels | Bento project — very stable |
| geerlingguy/oracle8 | VirtualBox | Jeff 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!
Option 2 — Build Custom OEL 8 Box (VirtualBox)
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:
Step 1 — Create VM in VirtualBox manually
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
Step 2 — Configure VM for Vagrant
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
Step 3 — Package the Box
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
Box File Locations
| OS | Box Storage Location |
|---|---|
| macOS | ~/.vagrant.d/boxes/ |
| Windows | C:\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.