Chapter 3. Running the bootc image in a virtual machine
Use the bootable container image as an installation source to set up a Red Hat Enterprise Linux (RHEL) virtual machine.
3.1. Creating the Kickstart file Copy linkLink copied to clipboard!
You must create the Kickstart file to use during installation.
Prerequisites
- You have root-user access.
- You are logged in to the physical hypervisor host.
Procedure
Set the
AUTH_CONFIGenvironment variable to reference the secret file in thekickstart.ksfile to authenticate private container registry access by running the following command:AUTH_CONFIG=~/.quay-auth.json
$ AUTH_CONFIG=~/.quay-auth.jsonCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
PULL_SECRETenvironment variable to reference the secret files in thekickstart.ksfile to authenticate the OpenShift Container Platform registry access by running the following command:PULL_SECRET=~/.pull-secret.json
$ PULL_SECRET=~/.pull-secret.jsonCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
IMAGE_REFenvironment variable to reference the image mode for your container image to use during installation by running the following command:IMAGE_REF="quay.io/<myorg>/<mypath>/microshift-4.19-bootc"
$ IMAGE_REF="quay.io/<myorg>/<mypath>/microshift-4.19-bootc"1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Replace <myorg/<mypath> with your remote registry organization name and path.
Create the
kickstart.ksfile to use during installation by running the following script:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Creating a virtual machine Copy linkLink copied to clipboard!
You can create a virtual machine by using the Red Hat Enterprise Linux (RHEL) boot ISO image.
Prerequisites
- You created the Kickstart file.
-
You installed the OpenShift CLI (
oc). -
You have
redhatcredentials.
Procedure
- Download the Red Hat Enterprise Linux (RHEL) boot ISO image from the Download Red Hat Enterprise Linux.
-
Copy the downloaded file to the
/var/lib/libvirt/imagesdirectory. Configure the VMNAME environment variable with your value by running the following command:
VMNAME=microshift-4.19-bootc
$ VMNAME=microshift-4.19-bootcCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the NETNAME environment variable with your value by running the following command:
NETNAME=default
$ NETNAME=defaultCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a RHEL virtual machine with 2 cores, 2GB of RAM and 20GB of storage by running the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe
sudo virt-installcommand uses the Kickstart file to pull a bootc image from the remote registry and install the RHEL operating system.-
Log in to the virtual machine by using your
redhatcredentials.
Verification
Verify that all of the MicroShift pods are running without error by entering the following command:
watch sudo oc get pods -A \ --kubeconfig /var/lib/microshift/resources/kubeadmin/kubeconfig$ watch sudo oc get pods -A \ --kubeconfig /var/lib/microshift/resources/kubeadmin/kubeconfigCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow