Skip to main content

🧰 How to Set Up Oracle Linux 8 Using Vagrant and VirtualBox in 2025


Even in the era of Docker and Kubernetes, Vagrant continues to be a simple and effective way to spin up full-featured VMs. If you're setting up an Oracle environment, Vagrant is still a go-to tool for building consistent, disposable, and scriptable development machines.

In this comprehensive tutorial, you'll learn how to build an Oracle Linux 8 VM using Vagrant with VirtualBox as the provider — with steps to configure memory, attach a custom disk, and bring the VM online.

πŸ’‘ Pro Tip: This setup is perfect for Oracle Database installations, testing environments, and development sandboxes!

πŸ“‹ Prerequisites

Before we dive in, make sure you have:

  • VirtualBox installed on your system
  • Vagrant installed and configured
  • ✅ At least 10GB of free disk space
  • 8GB RAM available for the VM

πŸ“ Step 1: Create Your Vagrant Working Directory and Add the Oracle Linux Box

First, let's create a dedicated folder for your Oracle Linux project:

mkdir C:\vagrant-oraclelinux
cd C:\vagrant-oraclelinux

Now, add the generic Oracle Linux 8 base box using:

vagrant box add generic/oracle8

During the prompt, you'll be asked to choose the provider. Select VirtualBox (option 6) as shown below:

==> box: Loading metadata for box 'generic/oracle8'
    box: URL: https://vagrantcloud.com/api/v2/vagrant/generic/oracle8
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) docker
2) hyperv
3) libvirt
4) parallels
5) qemu
6) virtualbox
7) vmware_desktop

Enter your choice: 6

After successful download, you'll see:

==> box: Successfully added box 'generic/oracle8' (v4.3.12) for 'virtualbox (amd64)'!

🎯 Quick Tip: The download might take a few minutes depending on your internet speed. Grab a coffee! ☕

✍️ Step 2: Create and Edit the Vagrantfile

Open the Vagrantfile in your favorite text editor:

notepad Vagrantfile

Paste the following configuration:

Vagrant.configure("2") do |config|
  config.vm.box = "generic/oracle8"
  config.vm.hostname = "oracle19c"
  
  config.vm.provider "virtualbox" do |vb|
    vb.memory = 8192
    vb.cpus = 2
    vb.customize [
      "storageattach", :id,
      "--storagectl", "SATA Controller",
      "--port", 1,
      "--device", 0,
      "--type", "hdd",
      "--medium", "C:/vagrant-oraclelinux/u01.vdi"
    ]
  end
end

πŸ“ Configuration Breakdown:

Parameter Value Description
Box Name "generic/oracle8" Oracle Linux 8 base image
Hostname oracle19c Sets guest machine name
Memory 8192 MB Allocates 8 GB RAM
CPUs 2 Assigns 2 CPU cores
Custom Disk u01.vdi Additional 50GB storage

⚠️ Important: Adjust memory and CPU values based on your host machine's capabilities!

πŸ’Ύ Step 3: Create a Virtual Disk for Oracle Data

Use VBoxManage.exe to create a 50GB virtual hard disk for Oracle data:

& "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createmedium disk --filename "C:\vagrant-oraclelinux\u01.vdi" --size 51200

This dedicated disk will be used for:

  • πŸ—„️ Oracle installation files
  • πŸ’Ύ Database storage
  • πŸ“Š Tablespaces and data files

πŸ’‘ Storage Tip: You can adjust the size by changing 51200 (50GB) to your preferred size in MB.

πŸš€ Step 4: Start the Virtual Machine

Now let's power up the VM:

vagrant up

Vagrant will automatically:

  1. πŸ”§ Initialize the VM
  2. πŸ’½ Attach the custom disk
  3. πŸ–₯️ Boot Oracle Linux 8
  4. ⚙️ Configure networking

The process typically takes 2-5 minutes. You'll see output similar to:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'generic/oracle8' is up to date...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...

πŸ” Step 5: Connect to the VM via SSH

Once the VM is up and running, connect to it:

vagrant ssh

πŸŽ‰ Success! You're now inside the Oracle Linux 8 virtual machine, ready to install Oracle software or run any manual configuration.

Quick System Check:

# Check OS version
cat /etc/os-release

# Check available disk space
df -h

# List attached disks
lsblk

πŸ› ️ Step 6: VM Lifecycle Management

To stop the VM:

vagrant halt

To restart it:

vagrant up

To reconnect:

vagrant ssh

To destroy the VM (when no longer needed):

vagrant destroy

πŸ”„ Lifecycle Tip: Use vagrant status to check the current state of your VM.

πŸ€” What's Next?

Now that your Oracle Linux 8 VM is ready, you can:

  1. Install Oracle Database 19c or 21c
  2. Set up Oracle APEX for web application development
  3. Configure Oracle Grid Infrastructure for RAC testing
  4. Install Oracle Enterprise Manager for database management
  5. Create multiple VMs for cluster configurations

Did you find this tutorial helpful? Share it with your fellow Oracle DBAs and developers! πŸš€

Tags: #OracleLinux #Vagrant #VirtualBox #DatabaseDevelopment #DevOps #Oracle #Virtualization #Linux


Comments

Popular posts from this blog

πŸš€ Automating Oracle Database Patching with Ansible: A Complete Guide

Oracle database patching has long been the bane of DBAs everywhere. It's a critical task that requires precision, expertise, and often results in extended maintenance windows. What if I told you that you could automate this entire process, reducing both risk and downtime while ensuring consistency across your Oracle estate? πŸ’‘ In this comprehensive guide, I'll walk you through a production-ready Ansible playbook that completely automates Oracle patch application using OPatch. Whether you're managing a single Oracle instance or hundreds of databases across your enterprise, this solution will transform your patch management strategy! 🎯 πŸ”₯ The Challenge: Why Oracle Patching is Complex Before diving into the solution, let's understand why Oracle patching is so challenging: πŸ”— Multiple dependencies : OPatch versions, Oracle Home configurations, running processes ⚠️ Risk of corruption : Incorrect patch application can render databases unusable ⏰ Downtime requirements : Da...

🐳Oracle 19c Database Deployment with Docker

Oracle 19c Database Deployment with Docker 🐳 Oracle 19c Database Deployment with Docker Welcome to this comprehensive guide on deploying, configuring, and managing Oracle 19c Database using Docker containers. This blog will walk you through the entire process from setup to production best practices with practical code examples. Docker provides an excellent way to run Oracle databases in isolated, portable containers, making it easy to deploy and manage Oracle 19c instances for development, testing, and production environments. This approach offers numerous benefits: πŸ”’ Isolation : Run Oracle in a containerized environment without affecting your host system 🚚 Portability : Easily move your database between different environments πŸ”„ Reproducibility : Quickly spin up identical database instances ⚡ Resource Efficiency : Use Docker's resource management capabilities to control CPU, memory, and stor...

Mastering Oracle RAC with CRSCTL commands

Mastering Oracle Clusterware Administration: Essential Commands & Best Practices Oracle Clusterware is a key component for managing cluster environments, ensuring high availability and resource management for Oracle databases. Below are essential commands for managing Oracle Clusterware effectively. What is crsctl? crsctl (Cluster Ready Services Control) is a command-line utility provided by Oracle to manage Oracle Clusterware. It allows administrators to start, stop, check, and configure various aspects of cluster services. With crsctl , DBAs can control cluster resources, manage voting disks, check the status of Oracle High Availability Services, and ensure the proper functioning of Oracle RAC environments. Starting and Stopping Oracle Clusterware On Local Node Stop Clusterware: crsctl stop cluster Start Clusterware: crsctl start cluster On RAC Standalone/Oracle Restart Stop Cluster: crsctl stop has Start Cluster: crsctl start has On All Nodes or All Hub Nodes Start Clusterware:...