Vagrant Troubleshooting — OEL 8
This page covers the most common Vagrant issues with VirtualBox and Parallels providers on OEL 8, with clear diagnostic steps and fixes.
Issue 1 — vagrant up hangs on SSH
BASH — SSH Hang Fix
# Symptom: VM starts but Vagrant waits forever for SSH
# default: Warning: Connection timeout. Retrying...
# Diagnostic steps:
# 1. Check VM actually started
vagrant global-status
# 2. Try connecting manually
vagrant ssh-config
ssh -i .vagrant/machines/default/virtualbox/private_key vagrant@127.0.0.1 -p 2222
# Common fixes:
# Fix A: Wrong network adapter — add to Vagrantfile:
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
# Fix B: Disable GUI then try
config.vm.provider "virtualbox" do |vb|
vb.gui = false
end
# Fix C: Increase SSH timeout
config.vm.boot_timeout = 600
Issue 2 — Parallels Box Add Fails
BASH — Parallels Box Fix
# Symptom:
# vagrant box add oraclelinux_custom oraclelinux.box
# Error: The box doesn't match the provider
# Fix: Use metadata JSON method (see Page 16 for full guide)
cat > box-metadata.json << EOF
{
"name": "oraclelinux8-parallels",
"versions": [{
"version": "1.0.0",
"providers": [{
"name": "parallels",
"url": "file:///absolute/path/to/oraclelinux8.box"
}]
}]
}
EOF
# Use the metadata JSON to add the box
vagrant box add box-metadata.json
# Never use:
vagrant box add myname myfile.box # ← This fails for Parallels!
Issue 3 — Private Network Not Working
BASH — Network Fix
# Symptom: Cannot ping 192.168.56.x from host
# On macOS — VirtualBox host-only adapter may need to be created:
VBoxManage hostonlyif create
VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1
# On OEL 8 host — check firewall
sudo firewall-cmd --zone=public --add-rich-rule="rule family=ipv4 source address=192.168.56.0/24 accept" --permanent
sudo firewall-cmd --reload
# In Vagrantfile — try explicit adapter name
config.vm.network "private_network",
ip: "192.168.56.10",
name: "vboxnet0" # VirtualBox
# For Parallels — check host-only network exists
prlsrvctl net list
Issue 4 — Disk Full Inside VM
BASH — Disk Full Fix
# Symptom: No space left on device inside OEL 8 VM
# Check disk inside VM
df -h
lsblk
# Expand disk — first resize via VirtualBox (VM must be off)
vagrant halt
VBoxManage modifymedium disk /path/to/vm.vmdk --resize 51200 # 50GB
# Start VM again
vagrant up
vagrant ssh
# Resize partition and filesystem inside VM
sudo growpart /dev/sda 3
sudo pvresize /dev/sda3
sudo lvextend -l +100%FREE /dev/ol/root
sudo xfs_growfs /
df -h # Verify new size
Issue 5 — Provisioner Fails
BASH — Provisioner Fix
# Symptom: provisioner script fails during vagrant up
# Re-run provisioner without restarting VM
vagrant provision
# Run specific provisioner
vagrant provision --provision-with shell
# Debug — add set -x to shell script for verbose output
#!/bin/bash
set -ex # e=exit on error, x=print each command
# Check provisioner logs
vagrant up 2>&1 | tee vagrant.log
grep -i "error\|fail" vagrant.log
Issue 6 — vagrant-parallels Plugin Issues
BASH — Plugin Fix
# Symptom: Provider not found or plugin errors
# Reinstall plugin
vagrant plugin uninstall vagrant-parallels
vagrant plugin install vagrant-parallels
# Check plugin version
vagrant plugin list
# Update plugin
vagrant plugin update vagrant-parallels
# Check Parallels is Pro/Business edition
# Standard edition does NOT support Vagrant provider
# Set PATH for prlctl
export PATH=$PATH:/usr/local/bin
which prlctl
Quick Troubleshooting Reference
| Symptom | Likely Cause | Fix |
|---|---|---|
| SSH timeout on vagrant up | Network/Guest Additions issue | Add natdnshostresolver1=on, increase boot_timeout |
| Parallels box add fails | Missing metadata.json | Use metadata JSON method (Page 16) |
| Private network unreachable | Host-only adapter not configured | Create VBoxManage hostonlyif or check prlsrvctl net |
| Disk full in VM | Default box size too small | Use vagrant-disksize plugin or VBoxManage resize |
| Provisioner fails | Script error or network issue | Add set -ex, run vagrant provision, check logs |
| vagrant plugin error | Plugin version mismatch | vagrant plugin update or reinstall |
| VM starts but MySQL not running | Provisioner failed silently | vagrant ssh; check journalctl -u mysqld |
| Port forwarding not working | Port conflict on host | Use auto_correct:true or different host port |
Useful Debug Commands
BASH — Debug Commands
# Verbose vagrant up output
vagrant up --debug 2>&1 | tee vagrant-debug.log
# Check VM state
vagrant global-status --prune
# Check VirtualBox VM details
VBoxManage showvminfo "OEL8-Lab"
# Check Parallels VM details
prlctl list --all
prlctl status "OEL8-Lab"
# Check SSH config
vagrant ssh-config
# Test SSH manually
ssh -vvv -i .vagrant/machines/default/virtualbox/private_key -p 2222 vagrant@127.0.0.1
# Inside VM — check services
systemctl status mysqld
journalctl -u mysqld -n 50
journalctl -xe