이 콘텐츠는 선택한 언어로 제공되지 않습니다.

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

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

  1. Set the AUTH_CONFIG environment variable to reference the secret file in the kickstart.ks file to authenticate private container registry access by running the following command:

    $ AUTH_CONFIG=~/.quay-auth.json
  2. Set the PULL_SECRET environment variable to reference the secret files in the kickstart.ks file to authenticate the OpenShift Container Platform registry access by running the following command:

    $ PULL_SECRET=~/.pull-secret.json
  3. Set the IMAGE_REF environment 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" 
    1
    1
    Replace <myorg/<mypath> with your remote registry organization name and path.
  4. Create the kickstart.ks file to use during installation by running the following script:

    $ cat > kickstart.ks <<EOFKS
    lang en_US.UTF-8
    keyboard us
    timezone UTC
    text
    reboot
    
    # Partition the disk with hardware-specific boot and swap partitions, adding an
    # LVM volume that contains a 10GB+ system root. The remainder of the volume will
    # be used by the CSI driver for storing data.
    zerombr
    clearpart --all --initlabel
    # Create boot and swap partitions as required by the current hardware platform
    reqpart --add-boot
    # Add an LVM volume group and allocate a system root logical volume
    part pv.01 --grow
    volgroup rhel pv.01
    logvol / --vgname=rhel --fstype=xfs --size=10240 --name=root
    
    # Lock root user account
    rootpw --lock
    
    # Configure network to use DHCP and activate on boot
    network --bootproto=dhcp --device=link --activate --onboot=on
    
    %pre-install --log=/dev/console --erroronfail
    
    # Create a 'bootc' image registry authentication file
    mkdir -p /etc/ostree
    cat > /etc/ostree/auth.json <<'EOF'
    $(cat "${AUTH_CONFIG}")
    EOF
    
    %end
    
    # Pull a 'bootc' image from a remote registry
    ostreecontainer --url "${IMAGE_REF}"
    
    %post --log=/dev/console --erroronfail
    
    # Create an OpenShift pull secret file
    cat > /etc/crio/openshift-pull-secret <<'EOF'
    $(cat "${PULL_SECRET}")
    EOF
    chmod 600 /etc/crio/openshift-pull-secret
    
    %end
    EOFKS

3.2. Creating a virtual machine

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 redhat credentials.

Procedure

  1. Download the Red Hat Enterprise Linux (RHEL) boot ISO image from the Download Red Hat Enterprise Linux.
  2. Copy the downloaded file to the /var/lib/libvirt/images directory.
  3. Configure the VMNAME environment variable with your value by running the following command:

    $ VMNAME=microshift-4.19-bootc
  4. Configure the NETNAME environment variable with your value by running the following command:

    $ NETNAME=default
  5. Create a RHEL virtual machine with 2 cores, 2GB of RAM and 20GB of storage by running the following command:

    $ sudo virt-install \
        --name ${VMNAME} \
        --vcpus 2 \
        --memory 2048 \
        --disk path=/var/lib/libvirt/images/${VMNAME}.qcow2,size=20 \
        --network network=${NETNAME},model=virtio \
        --events on_reboot=restart \
        --location /var/lib/libvirt/images/rhel-9.6-$(uname -m)-boot.iso \
        --initrd-inject kickstart.ks \
        --extra-args "inst.ks=file://kickstart.ks" \
        --wait
    Note

    The sudo virt-install command uses the Kickstart file to pull a bootc image from the remote registry and install the RHEL operating system.

  6. Log in to the virtual machine by using your redhat credentials.

Verification

  1. 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

    Example output

    NAMESPACE                  NAME                                       READY   STATUS    RESTARTS      AGE
    kube-system                csi-snapshot-controller-7cfb9df49c-kc9dx   1/1     Running   0             31s
    openshift-dns              dns-default-rpnlt                          2/2     Running   0             14s
    openshift-dns              node-resolver-rxvdk                        1/1     Running   0             31s
    openshift-ingress          router-default-69cd7b5545-7zcw7            1/1     Running   0             29s
    openshift-ovn-kubernetes   ovnkube-master-c7hlh                       4/4     Running   1 (16s ago)   31s
    openshift-ovn-kubernetes   ovnkube-node-mkpht                         1/1     Running   1 (17s ago)   31s
    openshift-service-ca       service-ca-5d5d96459d-5pd5s                1/1     Running   0             28s
    openshift-storage          topolvm-controller-677cbfcdb9-28dqr        5/5     Running   0             31s
    openshift-storage          topolvm-node-6fzbl                         3/3     Running   0             14s

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동