Este contenido no está disponible en el idioma seleccionado.

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.

12.1. Building Vagrant images for the libvirt and VirtualBox backends

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

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2026 Red Hat
Volver arriba