Skip to content

Latest commit

 

History

History
66 lines (44 loc) · 2.3 KB

File metadata and controls

66 lines (44 loc) · 2.3 KB

Setup TDX Guest Image

Create EFI Cloud Image

The default cloud image for CentOS Stream does not support EFI schema, so it needs to create customized EFI based CentOS image via TDX Guest Image Tool.

The tool provides scripts to generate guest image for RHEL, CentOS Stream and Ubuntu. In this section, it takes RHEL 8.5 as an example. If you want to generate CentOS Stream guest image, the steps are the same as following. The scripts for CentOS Stream is at https://github.com/intel/tdx-tools/tree/main/build/centos-stream-8/guest-image

For Ubuntu 22.04 guest image, please refer to https://github.com/intel/tdx-tools/blob/main/build/ubuntu-22.04/README.md

Prerequisite

  • Install required packages:

    sudo dnf install -y virt-install libguestfs-tools-c
    
  • TDX guest RPM repository was already generated by build-repo.sh

  • Make sure libvirtd service and the default virbr0 interface works normal via

    systemctl status libvirtd
    ifconfig virbr0
    

Install Guest Image With ISO Installer

Generate guest image td-guest-rhel-8.5.qcow2:

cd tdx-tools/build/rhel-8/guest-image/
./create-efi-img.sh

NOTE:

  • For RHEL-8 image, please prepare RHEL 8.5 base ISO image and put it under the same directory as create-efi-img.sh. You can download RHEL 8.5 base ISO image from https://access.redhat.com/downloads Modify create-efi-img.sh and set the ISO variable to the image name as below. Then run create-efi-img.sh to create the RHEL 8.5 guest image.

    ISO="RHEL-8.5.0-20211013.2-x86_64-dvd1.iso"
    
  • For CentOS Stream image, the script will download CentOS-Stream-8-x86_64-latest-dvd1.iso (~10G) if it does not exist. Then it runs virt-install to install guest image using kickstart scripts.

Install TDX Guest Stack into the Guest Image

Install tdx-guest-grub2, tdx-guest-shim and tdx-guest-kernel:

./tdx-guest-stack.sh

NOTE:

  • It will copy TDX guest repo to target guest image and install the guest packages
  • Use the existing host environment in the guest. Such as /etc/environment, /etc/chrony.conf
  • This script can be used as an example of how to install necessary guest components if a custom image is wanted.