AlmaLinux

Setup AlmaLinux 10 Vagrant Boxes for VirtualBox and KVM

AlmaLinux is a free, community-driven RHEL-compatible Linux distribution built for production workloads. Vagrant lets you spin up reproducible development environments in seconds using pre-built box images. The AlmaLinux project publishes official Vagrant boxes on Vagrant Cloud for VirtualBox, libvirt/KVM, VMware, Hyper-V, and Parallels providers.

This guide covers how to use official AlmaLinux 10 Vagrant boxes with VirtualBox and libvirt/KVM providers, write custom Vagrantfiles with resource tuning, and optionally build your own boxes from scratch using Packer.

Prerequisites

  • A Linux, macOS, or Windows workstation with hardware virtualization enabled (VT-x/AMD-V)
  • Vagrant installed (version 2.4 or later recommended)
  • VirtualBox 7.x or libvirt/KVM installed on your host – pick one provider
  • At least 2 GB free RAM and 20 GB disk space for the VM

Step 1: Add the AlmaLinux 10 Vagrant Box

The official box name on Vagrant Cloud is almalinux/10. This single box ships with providers for VirtualBox, libvirt, VMware Desktop, Hyper-V, and Parallels. Vagrant automatically downloads the correct provider image based on your configured provider.

Add the box to your local Vagrant catalog:

vagrant box add almalinux/10

If you have multiple providers installed, Vagrant will prompt you to choose one. You can skip the prompt by specifying the provider directly:

vagrant box add almalinux/10 --provider=virtualbox

Or for libvirt/KVM:

vagrant box add almalinux/10 --provider=libvirt

Verify the box was added:

$ vagrant box list
almalinux/10    (virtualbox, 10.0.20260315)
almalinux/10    (libvirt, 10.0.20260315)

Step 2: Create and Start an AlmaLinux 10 VM with VirtualBox

Create a project directory and initialize a Vagrantfile:

mkdir ~/almalinux10-vm && cd ~/almalinux10-vm
vagrant init almalinux/10

This creates a default Vagrantfile in the current directory. Start the VM:

vagrant up --provider=virtualbox

Vagrant downloads the box (if not already cached), imports it into VirtualBox, configures networking, and boots the VM. Once it is running, connect via SSH:

vagrant ssh

Confirm you are inside an AlmaLinux 10 VM:

$ cat /etc/redhat-release
AlmaLinux release 10.0 (Purple Lion)

Step 3: Create and Start an AlmaLinux 10 VM with Libvirt/KVM

If you run KVM on your Linux workstation, the libvirt provider is the better choice for near-native performance. Install the vagrant-libvirt plugin first if you have not already:

vagrant plugin install vagrant-libvirt

Then create a project directory and bring up the VM:

mkdir ~/almalinux10-kvm && cd ~/almalinux10-kvm
vagrant init almalinux/10
vagrant up --provider=libvirt

SSH into the VM the same way:

vagrant ssh

For more details on the libvirt provider, see our guide on using Vagrant with Libvirt (KVM) on Linux.

Step 4: Customize the Vagrantfile (Memory, CPU, Networking)

The default Vagrantfile works but allocates minimal resources. For development or testing workloads, customize CPU count, memory, hostname, and networking. Below are Vagrantfile examples for both providers.

VirtualBox Vagrantfile

Open the Vagrantfile in your project directory:

vi Vagrantfile

Replace the contents with:

Vagrant.configure("2") do |config|
  config.vm.box = "almalinux/10"
  config.vm.hostname = "almalinux10.test"

  # Private network - accessible only from the host
  config.vm.network "private_network", ip: "192.168.56.10"

  # Forward port 8080 on the host to port 80 inside the VM
  config.vm.network "forwarded_port", guest: 80, host: 8080

  # Sync a local folder into the VM
  config.vm.synced_folder ".", "/vagrant", disabled: false

  config.vm.provider "virtualbox" do |vb|
    vb.name = "almalinux10"
    vb.memory = 2048
    vb.cpus = 2
  end

  # Run a shell provisioner to update the system on first boot
  config.vm.provision "shell", inline: <<-SHELL
    dnf -y update
  SHELL
end

Libvirt/KVM Vagrantfile

Open the Vagrantfile:

vi Vagrantfile

Replace the contents with:

Vagrant.configure("2") do |config|
  config.vm.box = "almalinux/10"
  config.vm.hostname = "almalinux10.test"

  # Private network using libvirt default NAT
  config.vm.network "private_network", ip: "192.168.121.10"

  config.vm.provider "libvirt" do |libvirt|
    libvirt.memory = 2048
    libvirt.cpus = 2
    libvirt.driver = "kvm"
    libvirt.storage_pool_name = "default"
  end

  config.vm.provision "shell", inline: <<-SHELL
    dnf -y update
  SHELL
end

After saving the file, bring up the VM:

vagrant up

Step 5: Multi-Machine Vagrantfile for AlmaLinux 10

Vagrant supports defining multiple VMs in a single Vagrantfile. This is useful for testing cluster setups, replication, or multi-tier applications. Here is an example that creates two AlmaLinux 10 nodes. If you are setting up Rocky or AlmaLinux VMs with VirtualBox, the same pattern applies.

Vagrant.configure("2") do |config|
  config.vm.box = "almalinux/10"

  config.vm.define "node1" do |node1|
    node1.vm.hostname = "node1.test"
    node1.vm.network "private_network", ip: "192.168.56.11"
    node1.vm.provider "virtualbox" do |vb|
      vb.memory = 2048
      vb.cpus = 2
    end
  end

  config.vm.define "node2" do |node2|
    node2.vm.hostname = "node2.test"
    node2.vm.network "private_network", ip: "192.168.56.12"
    node2.vm.provider "virtualbox" do |vb|
      vb.memory = 2048
      vb.cpus = 2
    end
  end
end

Bring up both nodes at once:

vagrant up

SSH into a specific node by name:

vagrant ssh node1

Step 6: Common Vagrant Commands

These commands manage the lifecycle of your AlmaLinux 10 Vagrant VM.

CommandDescription
vagrant upStart the VM (downloads box on first run)
vagrant sshSSH into the running VM
vagrant haltGracefully shut down the VM
vagrant reloadRestart the VM and re-apply Vagrantfile changes
vagrant destroy -fDelete the VM and its disk (box image is kept)
vagrant statusShow current state of the VM
vagrant box updateCheck for and download a newer version of the box
vagrant snapshot save NAMESave a point-in-time snapshot of the VM
vagrant snapshot restore NAMERestore VM to a previously saved snapshot

Building Custom AlmaLinux 10 Vagrant Boxes with Packer

The official boxes work well for most use cases, but if you need a custom image with pre-installed packages, hardened configs, or a specific disk layout, you can build your own box using HashiCorp Packer. The AlmaLinux project maintains Packer templates in their cloud-images repository on GitHub.

Clone the repository:

git clone https://github.com/AlmaLinux/cloud-images.git
cd cloud-images

Build a libvirt/QEMU Vagrant box:

packer init .
packer build -only=qemu.almalinux-10 almalinux-10.pkr.hcl

Build a VirtualBox Vagrant box:

packer build -only=virtualbox-iso.almalinux-10 almalinux-10.pkr.hcl

The build downloads the AlmaLinux 10 ISO, runs a kickstart installation inside a temporary VM, provisions it with Ansible, and exports a .box file. This process takes 20-40 minutes depending on your hardware and internet speed.

After the build completes, add the generated box locally:

vagrant box add almalinux-10-custom AlmaLinux-10-Vagrant-10.0-*.x86_64.box

Then reference almalinux-10-custom as the box name in your Vagrantfile.

Conclusion

You now have AlmaLinux 10 Vagrant boxes running on VirtualBox or libvirt/KVM with custom resource allocation and networking. The official almalinux/10 box on Vagrant Cloud is maintained by the AlmaLinux project and receives regular updates - run vagrant box update periodically to pull the latest image.

For production-like test environments, consider adding Ansible provisioners to your Vagrantfile to automate package installation, firewall rules, and SELinux configuration so every vagrant up produces an identical system.

Related Articles

Arch How To Create Linux Network Bridge on Arch Linux or Manjaro AlmaLinux Install Java 17, Java 11 on Rocky Linux 9 / AlmaLinux 9 KVM How to resize guest disk image using virt-resize Virtualization Install oVirt Guest Agent on Rocky |CentOS 8 | RHEL 8

Press ESC to close