Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

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

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2026 Red Hat
Nach oben