4.5. Creating VMDK images by using bootc-image-builder
Create a Virtual Machine Disk (VMDK) from a bootc image and use it within VMware’s virtualization platforms, such as vSphere, or use it in Oracle VirtualBox.
Prerequisites
- You have Podman installed on your host machine.
-
You have authenticated to the Red Hat Registry by using the
podman login registry.redhat.io. -
You have pulled the
rhel10/bootc-image-buildercontainer image.
Procedure
Create a
Containerfilewith the following content:FROM registry.redhat.io/rhel10/rhel-bootc:latest RUN dnf -y install cloud-init open-vm-tools && \ ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants && \ rm -rf /var/{cache,log} /var/lib/{dnf,rhsm} && \ systemctl enable vmtoolsd.serviceBuild the bootc image:
# podman build . -t localhost/rhel-bootc-vmdkCreate a VMDK file from the previously created bootc image. The image must be accessible from a registry, such as
registry.redhat.io/rhel10/bootc-image-builder:latest.# podman run \ --rm \ --privileged \ -v /var/lib/containers/storage:/var/lib/containers/storage \ -v ./output:/output \ --security-opt label=type:unconfined_t \ --pull newer \ registry.redhat.io/rhel10/bootc-image-builder:latest \ --type vmdk \ --config /config.toml \ localhost/rhel-bootc-vmdk:latestA VMDK disk file for the bootc image is stored in the
output/vmdkdirectory.