Chapter 12. Creating Vagrant boxes with RHEL image builder


With RHEL image builder, you can choose between the vagrant-libvirt or vagrant-virtualbox image types to create Vagrant boxes.

RHEL image builder generates pre-configured images optimized for different hypervisors:

  • vagrant-libvirt creates a QCOW2-based image for libvirt
  • vagrant-virtualbox creates a VMDK-based image for VirtualBox

The pre-configured images include the vagrant user with sudo privileges. This configuration simplifies administrative tasks within the Vagrant box.

The images are supported in the following architectures: aarch64 and x86_64.

You can use RHEL image builder to create custom Vagrant boxes for different providers by using the vagrant-libvirt and vagrant-virtualbox image types.

  • The vagrant-libvirt image type creates a QCOW2-based box for use with the libvirt provider.
  • The vagrant-virtualbox image type creates a box compatible with the VirtualBox provider.

You can customize the image type by using blueprint customizations.

Prerequisites

  • RHEL image builder is installed and running.
  • You have a blueprint file ready to build.
  • For the libvirt box: A host system with the libvirt hypervisor is installed and running.
  • For the VirtualBox box: A host system with VirtualBox is installed.

Procedure

  1. Build the Vagrant box image:

    • For libvirt:

      $ sudo image-builder build --distro rhel-10.0 vagrant-libvirt
    • For VirtualBox:

      $ sudo image-builder build - -distro <distro-name> vagrant-virtualbox

      This creates a .box file.

  2. Import the new .box file to your local Vagrant environment. You must explicitly set the provider to virtualbox because it is not the standard provider.

    $ vagrant box add --provider=virtualbox <path/to/box> --name=<box-name>

    Replace path/to/image-name.box with the actual path to your file and <box_name> with a name such as rhel10-vagrant.

  3. Create a new directory for your project, and initialize Vagrant:

    $ mkdir <my_vagrant_project>
    $ cd <my_vagrant_project>
    $ vagrant init <box-name>

    This creates the Vagrantfile configuration file and sets its default box to <box-name>.

  4. Launch the virtual machine by using Vagrant:

    $ vagrant up
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top