RHEL 8 and RHEL 9 OS image import reference implementation on GDC air-gapped

This document provides step-by-step instructions for importing Red Hat Enterprise Linux (RHEL) 8.10 and RHEL 9.6 KVM qcow2 images into a Google Distributed Cloud (GDC) air-gapped tenant project. Completing this component implementation produces reusable project-scoped VirtualMachineImage resources and writes the isolated environment contract ${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/env.d/linux-vm-images.sh consumed by downstream database, storage, and application guides.

Tested releases

Distribution Minor release GDC air-gapped target Status Notes
RHEL 8 8.10 1.16.2 Supported Native platform import (--os=rhel-8) requires a populated pkg.org.internal; manual mode verified (operatingSystem: garden-linux, prepareImage: false)
RHEL 9 9.6 1.16.2 Lab verified Manual-mode image import (operatingSystem: garden-linux), first-boot SELinux relabeling, guest-agent synchronization, and in-guest SSH verified
RHEL 9 9.8 1.16.2 Partially verified Manual-mode image import and boot verified; guest-agent synchronization failed with the 1.16 RPM; in-guest SSH not verified

On distributions that the platform doesn't natively support, including RHEL 9, guest-agent synchronization is best effort: in lab testing, the 1.16 RPM synchronized on RHEL 9.6 but failed to synchronize on RHEL 9.8. Plan user and SSH key provisioning through cloud-init.

The following diagram illustrates the offline OS image customization, object storage staging, VirtualMachineImageImport custom resource translation modes, and deployed Linux guest VM architecture:

Custom Linux OS image import architecture showing workstation bake, object storage staging, VirtualMachineImageImport modes, and deployed Linux guest VM.

Before you begin

Environment configuration

Before you import images or create VMs, configure the required GDC Identity and Access Management (IAM) roles, workstation tools, and environment variables.

Identity and Access Management

To get the permissions that you need to import custom OS images and verify SSH access, ask your IAM Project Admin to grant you the following roles in your project namespace on the management API server:

  • Project Viewer (project-viewer)
  • Virtual Machine Project Admin (project-vm-admin)
  • Virtual Machine Image Project Admin (project-vm-image-admin)
  • Bucket Object Project Admin (project-bucket-object-admin)
  • Project Network Policy Admin (project-networkpolicy-admin)

Workstation requirements

The following command-line utilities and artifacts must be available on your workstation:

  • gdcloud CLI: command-line tool for managing GDC air-gapped resources, with the storage-cli-dependencies component installed.
  • kubectl CLI: command-line tool for interacting with the management API server.
  • guestfs-tools (or libguestfs-tools-c on RHEL 8, libguestfs-tools on Debian and Ubuntu): offline VM image inspection and customization tools (virt-customize, virt-cat, virt-inspector) required for manual-mode import on RHEL 8 and RHEL 9.
  • openssh-client: OpenSSH client utilities (ssh, ssh-keygen) for key generation and direct connection verification.
  • qemu-img: utility for inspecting virtual disk formats and virtual sizes.
  • sha256sum: utility for verifying downloaded vendor image checksums.
  • gdc-guest-agent-RELEASE-x86_64.rpm: GDC guest environment agent RPM matching your GDC release (optional for manual-mode import on RHEL 8 and RHEL 9). To obtain the RPM, run dnf download gdc-guest-agent on a Rocky Linux or RHEL VM configured against the platform-bundled vm-rocky-package-repo Rocky YUM mirror on pkg.org.internal, or request the .rpm file extracted from the infrastructure operator (IO) package repository archive. If this RPM isn't available, you can still operate manual mode without it by relying on cloud-init (with offline virt-customize credential injection) for user creation and network configuration, and qemu-guest-agent for hypervisor guest coordination (with platform-managed access using gdcloud compute ssh disabled).
  • Vendor KVM Guest Images: Prefer vendor KVM guest images (rhel-9.6-x86_64-kvm.qcow2, rhel-8.10-x86_64-kvm.qcow2) over ISO or kickstart builds. These images already include virtio drivers, cloud-init, and serial console configuration.
  • Source File Hygiene: Decompress .gz or .xz archives, flatten backing chains with qemu-img convert -O qcow2, and set minimumDiskSize in binary units (Gi) at least as large as the virtual disk size (at least 20% larger is recommended). Upload each import attempt under a unique object name in vm-images-bucket because reusing an object name already consumed by an earlier import stalled the import in testing.

Install the required virtualization and image customization utilities on your workstation:

# For Ubuntu workstations:
sudo apt-get update && sudo apt-get install -y \
    libguestfs-tools linux-image-generic qemu-utils

# For Debian workstations:
sudo apt-get update && sudo apt-get install -y \
    libguestfs-tools linux-image-amd64 qemu-utils

# For RHEL 9 or Fedora workstations:
sudo dnf install -y guestfs-tools qemu-img

# For RHEL 8 workstations:
sudo dnf install -y libguestfs-tools-c qemu-img

Run all commands in this guide from the workstation unless a step states otherwise.

Workstation configuration

  1. Create the root solution directories and secrets folder:

    mkdir -p ${HOME}/gdcag-solutions/env.d
    mkdir -p ${HOME}/gdcag-solutions/secrets
    
    touch ${HOME}/gdcag-solutions/secrets/harbor_crane_robot_token
    touch ${HOME}/gdcag-solutions/secrets/harbor_k8s_robot_token
    
    chmod u=rwx,go= ${HOME}/gdcag-solutions/secrets
    chmod -R u=rw,go= ${HOME}/gdcag-solutions/secrets/*
    
  2. Create the platform environment configuration file:

    cat << 'EOF' > ${HOME}/gdcag-solutions/env.d/platform.sh && echo "Successfully created." || echo "Failed to create!"
    # Infrastructure (Platform Native)
    export GDC_DOMAIN_SUFFIX="DOMAIN_SUFFIX"
    export GDC_ORG="ORG"
    export GDC_PROJECT="PROJECT"
    export GDC_ZONE="ZONE"
    export GDC_HARBOR_INSTANCE_NAME="HARBOR_INSTANCE_NAME"
    
    # Derived platform values
    export GDC_ZONAL_HOSTNAME="${GDC_ORG}.${GDC_ZONE}.${GDC_DOMAIN_SUFFIX}"
    export GDC_ZONAL_CONSOLE_URL="https://console.${GDC_ZONAL_HOSTNAME}"
    export GDC_HARBOR_HOST="${GDC_HARBOR_INSTANCE_NAME}-${GDC_PROJECT}.${GDC_ORG}.${GDC_ZONE}.${GDC_DOMAIN_SUFFIX}"
    EOF
    

    Replace the following:

    • DOMAIN_SUFFIX: GDC domain suffix.
    • ORG: GDC organization.
    • PROJECT: GDC project.
    • ZONE: GDC zone.
    • HARBOR_INSTANCE_NAME: GDC Harbor instance name.
  3. Create the registry environment configuration file:

    cat << 'EOF' > ${HOME}/gdcag-solutions/env.d/registry.sh && echo "Successfully created." || echo "Failed to create!"
    # GDC Solutions Registry & Secrets
    export GDCS_HARBOR_PROJECT_NAME="solutions"
    export GDCS_HARBOR_CRANE_ROBOT_NAME='HARBOR_CRANE_ROBOT_NAME'
    export GDCS_HARBOR_CRANE_ROBOT_TOKEN="$(cat ${GDCS_ROOT_HOME}/secrets/harbor_crane_robot_token)"
    export GDCS_HARBOR_K8S_ROBOT_NAME='HARBOR_K8S_ROBOT_NAME'
    export GDCS_HARBOR_K8S_ROBOT_TOKEN="$(cat ${GDCS_ROOT_HOME}/secrets/harbor_k8s_robot_token)"
    export GDCS_HARBOR_K8S_PULL_SECRET="gdcs-image-pull-secret"
    
    # Derived registry values
    export GDCS_HARBOR_PROJECT_URI="${GDC_HARBOR_HOST}/${GDCS_HARBOR_PROJECT_NAME}"
    export GDCS_HARBOR_CHART_OCI_URI="oci://${GDCS_HARBOR_PROJECT_URI}"
    EOF
    

    Replace the following:

    • HARBOR_CRANE_ROBOT_NAME: the full name of the Harbor robot account for crane, as Harbor shows it, including the robot$ prefix. Keep the single quotes so that the shell doesn't expand $.
    • HARBOR_K8S_ROBOT_NAME: the full name of the Harbor robot account for Kubernetes image pulls, as Harbor shows it, including the robot$ prefix. Keep the single quotes so that the shell doesn't expand $.
  4. Create the root environment loader file:

    cat << 'EOF' > ${HOME}/gdcag-solutions/env.sh && echo "Successfully created." || echo "Failed to create!"
    export GDCS_ROOT_HOME="${HOME}/gdcag-solutions"
    echo "GDCS_ROOT_HOME=${GDCS_ROOT_HOME}"
    
    # Sourced in dependency order
    source "${GDCS_ROOT_HOME}/env.d/platform.sh"
    source "${GDCS_ROOT_HOME}/env.d/registry.sh"
    EOF
    

Configure solution variables

  1. Create the isolated implementation directory structure for custom Linux OS images and restrict permissions on the secrets directory:

    mkdir -p ${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/env.d
    mkdir -p ${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/images
    mkdir -p ${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/manifests
    mkdir -p ${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/secrets
    chmod u=rwx,go= ${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/secrets
    
  2. Create the Linux VM images environment contract file env.d/linux-vm-images.sh inside the component directory:

    cat << 'EOF' > ${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/env.d/linux-vm-images.sh && echo "Successfully created." || echo "Failed to create!"
    # Shared Linux VM Images Contract
    export GDCS_VM_IMAGES_BUCKET="vm-images-bucket"
    export GDCS_RHEL8_IMAGE_NAME="rhel-8-10-custom"
    export GDCS_RHEL8_IMAGE_MIN_DISK_SIZE="20Gi"
    export GDCS_RHEL8_IMAGE_OS="rhel-8"
    export GDCS_RHEL8_QCOW2_FILE="${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/images/rhel-8.10-x86_64-kvm.qcow2"
    export GDCS_RHEL8_BAKED_QCOW2_FILE="${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/images/rhel-8.10-x86_64-kvm-baked.qcow2"
    export GDCS_RHEL8_MANUAL_IMAGE_OS="garden-linux"
    
    export GDCS_RHEL9_IMAGE_NAME="rhel-9-6-custom"
    export GDCS_RHEL9_IMAGE_MIN_DISK_SIZE="20Gi"
    export GDCS_RHEL9_IMAGE_OS="garden-linux"
    export GDCS_RHEL9_QCOW2_FILE="${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/images/rhel-9.6-x86_64-kvm.qcow2"
    export GDCS_RHEL9_BAKED_QCOW2_FILE="${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/images/rhel-9.6-x86_64-kvm-baked.qcow2"
    
    export GDCS_GDC_GUEST_AGENT_RPM="GDC_GUEST_AGENT_RPM"
    export GDCS_VM_ADMIN_USER="cloud-user"
    export GDCS_VM_ADMIN_SSH_KEY_FILE="${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/secrets/rhel_admin_ed25519"
    export GDCS_GDC_NTP_SERVERS="ntp1.org.internal ntp2.org.internal"
    
    # Verification and Test VM Variables
    export GDCS_TEST_VM_NAME="rhel-test-vm"
    export GDCS_TEST_VM_MACHINE_TYPE="n3-standard-2-gdc"
    export GDCS_TEST_VM_BOOT_DISK_SIZE="22GB"
    export GDCS_TEST_VM_ADMIN_CIDR="TEST_VM_ADMIN_CIDR"
    export GDCS_TEST_VM_SSH_PNP_NAME="allow-test-vm-ssh"
    export GDCS_TEST_VM_INGRESS_IP=""
    
    export GDC_MANAGEMENT_API_SERVER="${GDC_ORG}-admin"
    export GDC_MANAGEMENT_API_KUBECONFIG="${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/${GDC_MANAGEMENT_API_SERVER}-kubeconfig.yaml"
    EOF
    

    Replace the following:

    • GDC_GUEST_AGENT_RPM: path to GDC guest agent RPM from IO (or leave empty if operating without GDC guest agent).
    • TEST_VM_ADMIN_CIDR: workstation or administrative CIDR (for example, 10.0.0.0/8).
  3. Create the implementation loader script:

    cat << 'EOF' > ${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/env.sh && echo "Successfully created." || echo "Failed to create!"
    source "${HOME}/gdcag-solutions/env.sh"
    
    export GDCS_IMPLEMENTATION_HOME="${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel"
    echo "GDCS_IMPLEMENTATION_HOME=${GDCS_IMPLEMENTATION_HOME}"
    
    source "${GDCS_IMPLEMENTATION_HOME}/env.d/linux-vm-images.sh"
    EOF
    
  4. Source the environment file:

    source ${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/env.sh
    

    The output is similar to the following:

    GDCS_ROOT_HOME=HOME_DIRECTORY_PATH/gdcag-solutions
    GDCS_IMPLEMENTATION_HOME=HOME_DIRECTORY_PATH/gdcag-solutions/components/custom-linux-os-images/rhel
    
  5. Generate an ED25519 SSH key pair for the virtual machine administrative user if one doesn't already exist:

    if [[ ! -f "${GDCS_VM_ADMIN_SSH_KEY_FILE}" ]]; then
      ssh-keygen \
      -C "cloud-user@gdc-vm" \
      -N "" \
      -f "${GDCS_VM_ADMIN_SSH_KEY_FILE}" \
      -t ed25519
    fi
    
    chmod u=rw,go= "${GDCS_VM_ADMIN_SSH_KEY_FILE}"*
    
  6. Store the temporary emergency password for serial console recovery in a restricted (0600) secret file:

    chmod u=rwx,go= "${GDCS_IMPLEMENTATION_HOME}/secrets"
    install -m 600 /dev/null "${GDCS_IMPLEMENTATION_HOME}/secrets/vm_admin_password"
    set +o history
    printf '%s' 'VM_ADMIN_PASSWORD' > "${GDCS_IMPLEMENTATION_HOME}/secrets/vm_admin_password"
    set -o history
    

    Replace VM_ADMIN_PASSWORD with a temporary emergency password for serial console recovery. Keep the single quotes so that the shell doesn't expand special characters such as $, backticks, \`, or!(if your password includes a single quote, prompt for it withIFS= read -r -s` instead).

Prepare the RHEL image for Manual-Mode import

Select one of the following options:

RHEL 8

By default, RHEL 8 uses native platform import (--os=rhel-8), where VM Manager automatically installs the guest agent, configures time synchronization, and sets up cloud-init during import. Proceed directly to Import Custom RHEL Images into VM Manager.

Before choosing native import, verify with your infrastructure operator (IO) whether the organization package mirror http://pkg.org.internal/rocky/... is populated and reachable from organization VMs over the Virtual Private Cloud (VPC) (through dataplane-ingress-gateway). If pkg.org.internal is unpopulated, translation retries and fails with HTTP 404 errors for repomd.xml. If it's unreachable, translation fails with DNS or connection errors (HTTP 502, 503, or 504 indicate errors in the repository server, proxy or TLS configuration, or backing object storage connection). The platform controller perpetually restarts failed translation jobs until the import resource is deleted or the --timeout flag (default 1h) of the gdcloud compute images import command expires and cleans up the import.

Alternative: prepare RHEL 8 offline in manual mode

When pkg.org.internal isn't available, customize the RHEL 8 image offline using the same configuration files (chrony.conf and 99-gdc-datasource.cfg) as RHEL 9. RHEL 8 chrony doesn't include /etc/chrony.d, so the configuration is uploaded directly to /etc/chrony.conf. If you haven't already generated these configuration files, generate them first using the commands in the RHEL 9 tab.

  1. Copy the pristine vendor image to the customization output file and customize it offline with virt-customize:

    cp "${GDCS_RHEL8_QCOW2_FILE}" "${GDCS_RHEL8_BAKED_QCOW2_FILE}"
    
    virt-customize --add "${GDCS_RHEL8_BAKED_QCOW2_FILE}" \
    --run-command "id -u ${GDCS_VM_ADMIN_USER} >/dev/null 2>&1 || useradd --create-home --groups wheel --shell /bin/bash ${GDCS_VM_ADMIN_USER}" \
    --password "${GDCS_VM_ADMIN_USER}:file:${GDCS_IMPLEMENTATION_HOME}/secrets/vm_admin_password" \
    --ssh-inject "${GDCS_VM_ADMIN_USER}:file:${GDCS_VM_ADMIN_SSH_KEY_FILE}.pub" \
    --write "/etc/sudoers.d/${GDCS_VM_ADMIN_USER}:${GDCS_VM_ADMIN_USER} ALL=(ALL) NOPASSWD:ALL" \
    --chmod "0440:/etc/sudoers.d/${GDCS_VM_ADMIN_USER}" \
    --copy-in "${GDCS_IMPLEMENTATION_HOME}/images/99-gdc-datasource.cfg:/etc/cloud/cloud.cfg.d" \
    --upload "${GDCS_IMPLEMENTATION_HOME}/images/chrony.conf:/etc/chrony.conf" \
    --copy-in "${GDCS_GDC_GUEST_AGENT_RPM}:/tmp" \
    --run-command "dnf --assumeyes --disablerepo='*' localinstall /tmp/$(basename "${GDCS_GDC_GUEST_AGENT_RPM}")" \
    --run-command "rm -f /tmp/$(basename "${GDCS_GDC_GUEST_AGENT_RPM}")" \
    --run-command "systemctl enable chronyd guest-agent.service qemu-guest-agent.service sshd" \
    --selinux-relabel
    

    If your infrastructure operator hasn't provided the GDC guest agent RPM, omit --copy-in "${GDCS_GDC_GUEST_AGENT_RPM}:/tmp", the dnf localinstall and rm -f /tmp cleanup commands, and guest-agent.service from systemctl enable in virt-customize. The image still boots, initializes network interfaces through cloud-init, and accepts SSH connections by using the ${GDCS_VM_ADMIN_SSH_KEY_FILE}.pub key injected offline with virt-customize --ssh-inject. In this mode, the GuestEnvironmentSynced condition remains False and gdcloud compute ssh isn't available. However, direct SSH using ssh -i "${GDCS_VM_ADMIN_SSH_KEY_FILE}" works within the same project by default, or from external networks after configuring external VM access (such as --enable-external-access or a VirtualMachineExternalAccess custom resource) and a ProjectNetworkPolicy custom resource allowing TCP ingress on port 22.

  2. Verify the contents and configuration of the customized RHEL 8 image without booting a virtual machine:

    virt-cat --add "${GDCS_RHEL8_BAKED_QCOW2_FILE}" "/home/${GDCS_VM_ADMIN_USER}/.ssh/authorized_keys" | cut -c1-40
    virt-cat --add "${GDCS_RHEL8_BAKED_QCOW2_FILE}" /etc/chrony.conf | head -3
    virt-cat --add "${GDCS_RHEL8_BAKED_QCOW2_FILE}" /etc/cloud/cloud.cfg.d/99-gdc-datasource.cfg
    virt-inspector --add "${GDCS_RHEL8_BAKED_QCOW2_FILE}" | awk -F'[<>]' '/[<]name>(gdc-guest-agent|qemu-guest-agent|chrony)/ {print $3}' | sort -u
    qemu-img info "${GDCS_RHEL8_BAKED_QCOW2_FILE}" | grep -E 'virtual size|disk size'
    

RHEL 9

Download the official Red Hat Enterprise Linux 9.6 KVM guest image (rhel-9.6-x86_64-kvm.qcow2) from the Red Hat Customer Portal using your Red Hat subscription, and place it at ${GDCS_RHEL9_QCOW2_FILE}.

  1. Verify the SHA-256 checksum of the downloaded Red Hat Enterprise Linux 9.6 KVM guest image:

    echo "49443696e7f2410e5647aa16f15eb7b7b08610fea92cdf3eba44ab9ec9ff899f  ${GDCS_RHEL9_QCOW2_FILE}" | sha256sum --check -
    

    The output is similar to the following:

    .../rhel-9.6-x86_64-kvm.qcow2: OK
    
  2. Inspect the format and virtual disk size of the downloaded Red Hat Enterprise Linux 9.6 KVM guest image:

    qemu-img info "${GDCS_RHEL9_QCOW2_FILE}"
    

    The output is similar to the following:

    image: .../rhel-9.6-x86_64-kvm.qcow2
    file format: qcow2
    virtual size: 10 GiB (10737418240 bytes)
    disk size: ...
    
  3. Copy the pristine vendor image to the customization output file to preserve the original download:

    cp "${GDCS_RHEL9_QCOW2_FILE}" "${GDCS_RHEL9_BAKED_QCOW2_FILE}"
    
  4. Generate the offline chrony and cloud-init configuration files required for manual-mode operation:

    cat << EOF > "${GDCS_IMPLEMENTATION_HOME}/images/chrony.conf"
    # GDC air-gapped organization time servers (manual-mode import: not injected by the platform)
    $(for s in ${GDCS_GDC_NTP_SERVERS}; do echo "server ${s} iburst"; done)
    driftfile /var/lib/chrony/drift
    makestep 1.0 3
    rtcsync
    logdir /var/log/chrony
    EOF
    
    cat << 'EOF' > "${GDCS_IMPLEMENTATION_HOME}/images/99-gdc-datasource.cfg"
    # GDC provides a NoCloud seed (cloud-init runs its platform scripts at every boot); pin the list so no cloud datasources are probed
    datasource_list: [ NoCloud, None ]
    EOF
    
  5. Customize the target image offline with the GDC guest environment agent, administrative credentials, time services, and cloud-init configuration:

    virt-customize --add "${GDCS_RHEL9_BAKED_QCOW2_FILE}" \
    --run-command "id -u ${GDCS_VM_ADMIN_USER} >/dev/null 2>&1 || useradd --create-home --groups wheel --shell /bin/bash ${GDCS_VM_ADMIN_USER}" \
    --password "${GDCS_VM_ADMIN_USER}:file:${GDCS_IMPLEMENTATION_HOME}/secrets/vm_admin_password" \
    --ssh-inject "${GDCS_VM_ADMIN_USER}:file:${GDCS_VM_ADMIN_SSH_KEY_FILE}.pub" \
    --write "/etc/sudoers.d/${GDCS_VM_ADMIN_USER}:${GDCS_VM_ADMIN_USER} ALL=(ALL) NOPASSWD:ALL" \
    --chmod "0440:/etc/sudoers.d/${GDCS_VM_ADMIN_USER}" \
    --copy-in "${GDCS_IMPLEMENTATION_HOME}/images/99-gdc-datasource.cfg:/etc/cloud/cloud.cfg.d" \
    --upload "${GDCS_IMPLEMENTATION_HOME}/images/chrony.conf:/etc/chrony.conf" \
    --copy-in "${GDCS_GDC_GUEST_AGENT_RPM}:/tmp" \
    --run-command "dnf --assumeyes --disablerepo='*' localinstall /tmp/$(basename "${GDCS_GDC_GUEST_AGENT_RPM}")" \
    --run-command "rm -f /tmp/$(basename "${GDCS_GDC_GUEST_AGENT_RPM}")" \
    --run-command "systemctl enable chronyd guest-agent.service qemu-guest-agent.service sshd" \
    --selinux-relabel
    

    If your infrastructure operator hasn't provided the GDC guest agent RPM, omit --copy-in "${GDCS_GDC_GUEST_AGENT_RPM}:/tmp", the dnf localinstall and rm -f /tmp cleanup commands, and guest-agent.service from systemctl enable in virt-customize. The image still boots, initializes network interfaces through cloud-init, and accepts SSH connections by using the ${GDCS_VM_ADMIN_SSH_KEY_FILE}.pub key injected offline with virt-customize --ssh-inject. In this mode, the GuestEnvironmentSynced condition remains False and gdcloud compute ssh isn't available. However, direct SSH using ssh -i "${GDCS_VM_ADMIN_SSH_KEY_FILE}" works within the same project by default, or from external networks after configuring external VM access (such as --enable-external-access or a VirtualMachineExternalAccess custom resource) and a ProjectNetworkPolicy custom resource allowing TCP ingress on port 22.

  6. Verify the contents and configuration of the customized image without booting a virtual machine:

    virt-cat --add "${GDCS_RHEL9_BAKED_QCOW2_FILE}" "/home/${GDCS_VM_ADMIN_USER}/.ssh/authorized_keys" | cut -c1-40
    virt-cat --add "${GDCS_RHEL9_BAKED_QCOW2_FILE}" /etc/chrony.conf | head -3
    virt-cat --add "${GDCS_RHEL9_BAKED_QCOW2_FILE}" /etc/cloud/cloud.cfg.d/99-gdc-datasource.cfg
    virt-inspector --add "${GDCS_RHEL9_BAKED_QCOW2_FILE}" | awk -F'[<>]' '/[<]name>(gdc-guest-agent|qemu-guest-agent|chrony)/ {print $3}' | sort -u
    qemu-img info "${GDCS_RHEL9_BAKED_QCOW2_FILE}" | grep -E 'virtual size|disk size'
    

    The output is similar to the following:

    ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA...
    # GDC air-gapped organization time servers (manual-mode import: not injected by the platform)
    server ntp1.org.internal iburst
    server ntp2.org.internal iburst
    # GDC provides a NoCloud seed (cloud-init runs its platform scripts at every boot); pin the list so no cloud datasources are probed
    datasource_list: [ NoCloud, None ]
    chrony
    gdc-guest-agent
    qemu-guest-agent
    virtual size: 10 GiB (10737418240 bytes)
    disk size: ...
    

Import custom RHEL images into VM Manager

  1. Authenticate to the GDC environment and retrieve the management API server kubeconfig:

    gdcloud config set core/organization_console_url "${GDC_ZONAL_CONSOLE_URL}"
    gdcloud config set core/project "${GDC_PROJECT}"
    gdcloud config set core/zone "${GDC_ZONE}"
    gdcloud auth login
    
    export KUBECONFIG="${GDC_MANAGEMENT_API_KUBECONFIG}"
    gdcloud clusters get-credentials "${GDC_MANAGEMENT_API_SERVER}" \
    --zone="${GDC_ZONE}"
    
  2. Import the custom RHEL image into VM Manager. Select one of the following options:

    RHEL 8

    1. Import the custom RHEL 8 image using native platform import:

      gdcloud compute images import "${GDCS_RHEL8_IMAGE_NAME}" \
      --os="${GDCS_RHEL8_IMAGE_OS}" \
      --project="${GDC_PROJECT}" \
      --source-file="${GDCS_RHEL8_QCOW2_FILE}" \
      --timeout=1h
      
      kubectl get virtualmachineimage.virtualmachine.gdc.goog "${GDCS_RHEL8_IMAGE_NAME}" \
      --namespace="${GDC_PROJECT}" \
      --output=jsonpath='{.metadata.name}{" "}{.spec.minimumDiskSize}{"\n"}'
      

      The gdcloud compute images import command has no disk-size flag and always sets the minimumDiskSize field from the QCOW2 virtual size (10Gi for the 10 GiB KVM guest image).

      The output is similar to the following:

      rhel-8-10-custom 10Gi
      

    Alternative: Import RHEL 8 in manual mode

    When pkg.org.internal isn't available, upload the baked RHEL 8 image to the vm-images-bucket object storage bucket and apply the VirtualMachineImageImport custom resource with operatingSystem: ${GDCS_RHEL8_MANUAL_IMAGE_OS} and prepareImage: false.

    If the vm-images-bucket bucket doesn't already exist in the project, create it first using the bucket creation step on the RHEL 9 tab.

    1. Upload the baked RHEL 8 image to the object storage bucket and apply the VirtualMachineImageImport manifest:

      export GDCS_VM_IMAGES_BUCKET_ENDPOINT=$(kubectl get bucket.object.gdc.goog "${GDCS_VM_IMAGES_BUCKET}" \
      --namespace="${GDC_PROJECT}" \
      --output=jsonpath='{.status.endpoint}')
      
      export GDCS_VM_IMAGES_BUCKET_FQN=$(kubectl get bucket.object.gdc.goog "${GDCS_VM_IMAGES_BUCKET}" \
      --namespace="${GDC_PROJECT}" \
      --output=jsonpath='{.status.fullyQualifiedName}')
      
      export GDCS_S3_KEY_SECRET=$(kubectl auth can-i --list --namespace=object-storage-access-keys \
        | grep -oE 'object-storage-key-std-user-[a-z0-9]+' | head -n 1)
      
      set +o history
      gdcloud config set storage/s3_endpoint "${GDCS_VM_IMAGES_BUCKET_ENDPOINT}"
      gdcloud config set storage/s3_access_key_id "$(kubectl get secret "${GDCS_S3_KEY_SECRET}" --namespace=object-storage-access-keys --output=jsonpath='{.data.access-key-id}' | base64 --decode)"
      gdcloud config set storage/s3_secret_access_key "$(kubectl get secret "${GDCS_S3_KEY_SECRET}" --namespace=object-storage-access-keys --output=jsonpath='{.data.secret-access-key}' | base64 --decode)"
      set -o history
      
      gdcloud storage cp "${GDCS_RHEL8_BAKED_QCOW2_FILE}" "s3://${GDCS_VM_IMAGES_BUCKET_FQN}/$(basename "${GDCS_RHEL8_BAKED_QCOW2_FILE}")"
      
      cat << EOF > "${GDCS_IMPLEMENTATION_HOME}/manifests/${GDCS_RHEL8_IMAGE_NAME}-manual-import.yaml"
      apiVersion: virtualmachine.gdc.goog/v1
      kind: VirtualMachineImageImport
      metadata:
        name: ${GDCS_RHEL8_IMAGE_NAME}
        namespace: ${GDC_PROJECT}
      spec:
        imageMetadata:
          minimumDiskSize: ${GDCS_RHEL8_IMAGE_MIN_DISK_SIZE}
          name: ${GDCS_RHEL8_IMAGE_NAME}
          operatingSystem: ${GDCS_RHEL8_MANUAL_IMAGE_OS}
        prepareImage: false
        source:
          objectStorage:
            bucketRef:
              name: ${GDCS_VM_IMAGES_BUCKET}
            objectName: $(basename "${GDCS_RHEL8_BAKED_QCOW2_FILE}")
      EOF
      
      kubectl apply \
      --filename="${GDCS_IMPLEMENTATION_HOME}/manifests/${GDCS_RHEL8_IMAGE_NAME}-manual-import.yaml" \
      --namespace="${GDC_PROJECT}"
      
      kubectl wait virtualmachineimageimport.virtualmachine.gdc.goog "${GDCS_RHEL8_IMAGE_NAME}" \
      --for=condition=Ready \
      --namespace="${GDC_PROJECT}" \
      --timeout=3600s
      
      kubectl get virtualmachineimage.virtualmachine.gdc.goog "${GDCS_RHEL8_IMAGE_NAME}" \
      --namespace="${GDC_PROJECT}" \
      --output=jsonpath='{.metadata.name}{" "}{.spec.minimumDiskSize}{"\n"}'
      

      The output is similar to the following:

      rhel-8-10-custom 20Gi
      

    RHEL 9

    1. Verify or create the vm-images-bucket object storage bucket in the project namespace, and wait for it to report BucketReady:

      if ! kubectl get bucket.object.gdc.goog "${GDCS_VM_IMAGES_BUCKET}" --namespace="${GDC_PROJECT}" >/dev/null 2>&1; then
        cat << EOF > "${GDCS_IMPLEMENTATION_HOME}/manifests/vm-images-bucket.yaml"
      apiVersion: object.gdc.goog/v1
      kind: Bucket
      metadata:
        name: ${GDCS_VM_IMAGES_BUCKET}
        namespace: ${GDC_PROJECT}
      spec:
        description: Scratch bucket for imported VM images
        storageClass: Standard
      EOF
      
        kubectl apply \
        --filename="${GDCS_IMPLEMENTATION_HOME}/manifests/vm-images-bucket.yaml" \
        --namespace="${GDC_PROJECT}"
      fi
      
      kubectl wait bucket.object.gdc.goog "${GDCS_VM_IMAGES_BUCKET}" \
      --for=condition=BucketReady \
      --namespace="${GDC_PROJECT}" \
      --timeout=300s
      
    2. Retrieve the bucket endpoint, fully qualified bucket name, and user S3 credentials, then upload the baked qcow2 image to vm-images-bucket:

      export GDCS_VM_IMAGES_BUCKET_ENDPOINT=$(kubectl get bucket.object.gdc.goog "${GDCS_VM_IMAGES_BUCKET}" \
      --namespace="${GDC_PROJECT}" \
      --output=jsonpath='{.status.endpoint}')
      
      export GDCS_VM_IMAGES_BUCKET_FQN=$(kubectl get bucket.object.gdc.goog "${GDCS_VM_IMAGES_BUCKET}" \
      --namespace="${GDC_PROJECT}" \
      --output=jsonpath='{.status.fullyQualifiedName}')
      
      export GDCS_S3_KEY_SECRET=$(kubectl auth can-i --list --namespace=object-storage-access-keys \
        | grep -oE 'object-storage-key-std-user-[a-z0-9]+' | head -n 1)
      
      set +o history
      gdcloud config set storage/s3_endpoint "${GDCS_VM_IMAGES_BUCKET_ENDPOINT}"
      gdcloud config set storage/s3_access_key_id "$(kubectl get secret "${GDCS_S3_KEY_SECRET}" --namespace=object-storage-access-keys --output=jsonpath='{.data.access-key-id}' | base64 --decode)"
      gdcloud config set storage/s3_secret_access_key "$(kubectl get secret "${GDCS_S3_KEY_SECRET}" --namespace=object-storage-access-keys --output=jsonpath='{.data.secret-access-key}' | base64 --decode)"
      set -o history
      
      gdcloud storage cp "${GDCS_RHEL9_BAKED_QCOW2_FILE}" "s3://${GDCS_VM_IMAGES_BUCKET_FQN}/$(basename "${GDCS_RHEL9_BAKED_QCOW2_FILE}")"
      
    3. Create the VirtualMachineImageImport resource with prepareImage: false and operatingSystem: ${GDCS_RHEL9_IMAGE_OS} to register ${GDCS_RHEL9_IMAGE_NAME} in the project namespace:

      cat << EOF > "${GDCS_IMPLEMENTATION_HOME}/manifests/${GDCS_RHEL9_IMAGE_NAME}-import.yaml"
      apiVersion: virtualmachine.gdc.goog/v1
      kind: VirtualMachineImageImport
      metadata:
        name: ${GDCS_RHEL9_IMAGE_NAME}
        namespace: ${GDC_PROJECT}
      spec:
        imageMetadata:
          minimumDiskSize: ${GDCS_RHEL9_IMAGE_MIN_DISK_SIZE}
          name: ${GDCS_RHEL9_IMAGE_NAME}
          operatingSystem: ${GDCS_RHEL9_IMAGE_OS}
        prepareImage: false
        source:
          objectStorage:
            bucketRef:
              name: ${GDCS_VM_IMAGES_BUCKET}
            objectName: $(basename "${GDCS_RHEL9_BAKED_QCOW2_FILE}")
      EOF
      
      kubectl apply \
      --filename="${GDCS_IMPLEMENTATION_HOME}/manifests/${GDCS_RHEL9_IMAGE_NAME}-import.yaml" \
      --namespace="${GDC_PROJECT}"
      
    4. Wait for the VirtualMachineImageImport to report Ready=True and verify that the custom VirtualMachineImage is available in the project:

      kubectl wait virtualmachineimageimport.virtualmachine.gdc.goog "${GDCS_RHEL9_IMAGE_NAME}" \
      --for=condition=Ready \
      --namespace="${GDC_PROJECT}" \
      --timeout=3600s
      
      kubectl get virtualmachineimage.virtualmachine.gdc.goog "${GDCS_RHEL9_IMAGE_NAME}" \
      --namespace="${GDC_PROJECT}" \
      --output=jsonpath='{.metadata.name}{" "}{.spec.minimumDiskSize}{"\n"}'
      

      The output is similar to the following:

      rhel-9-6-custom 20Gi
      

Create a test VM and connect over SSH

Virtual machines in GDC air-gapped are administered over SSH through the VM ingress IP created by --enable-external-access (VirtualMachineExternalAccess, TCP 22) and a ProjectNetworkPolicy custom resource that admits the administrative CIDR. In release 1.16.2, VirtualMachineExternalAccess is no longer the preferred option, and configuring it in the GDC console is deprecated. Scope the ProjectNetworkPolicy ingress rule strictly to the administrator or jump host CIDR range, never 0.0.0.0/0, allow key-only SSH, and remove the port after the virtual machine is configured. With the GDC guest environment agent installed and active, the agent connects to the platform at boot (GuestEnvironmentSynced=True), allowing short-lived SSH authentication using gdcloud compute ssh without managing persistent keys. Alternatively, if connecting before guest synchronization or in environments where the guest agent isn't used (such as RHEL 9.8), administrators can connect directly using the administrative SSH key through the ingress IP.

  1. Create a test virtual machine instance from the imported custom image with external access enabled. Select one of the following options:

    RHEL 8

    gdcloud compute instances create "${GDCS_TEST_VM_NAME}" \
    --boot-disk-size="${GDCS_TEST_VM_BOOT_DISK_SIZE}" \
    --enable-external-access \
    --image="${GDCS_RHEL8_IMAGE_NAME}" \
    --machine-type="${GDCS_TEST_VM_MACHINE_TYPE}" \
    --no-boot-disk-auto-delete=false \
    --project="${GDC_PROJECT}"
    

    This command waits for the virtual machine to reach the Running state and exits with no output on success.

    RHEL 9

    gdcloud compute instances create "${GDCS_TEST_VM_NAME}" \
    --boot-disk-size="${GDCS_TEST_VM_BOOT_DISK_SIZE}" \
    --enable-external-access \
    --image="${GDCS_RHEL9_IMAGE_NAME}" \
    --machine-type="${GDCS_TEST_VM_MACHINE_TYPE}" \
    --no-boot-disk-auto-delete=false \
    --project="${GDC_PROJECT}"
    

    This command waits for the virtual machine to reach the Running state and exits with no output on success.

  2. Create the manifest for the ProjectNetworkPolicy that admits administrative ingress traffic on TCP 22:

    cat << EOF > "${GDCS_IMPLEMENTATION_HOME}/manifests/${GDCS_TEST_VM_SSH_PNP_NAME}-pnp.yaml"
    apiVersion: networking.gdc.goog/v1
    kind: ProjectNetworkPolicy
    metadata:
      name: ${GDCS_TEST_VM_SSH_PNP_NAME}
      namespace: ${GDC_PROJECT}
    spec:
      ingress:
      - from:
        - ipBlock:
            cidr: ${GDCS_TEST_VM_ADMIN_CIDR}
        ports:
        - port: 22
          protocol: TCP
      policyType: Ingress
      subject:
        subjectType: UserWorkload
    EOF
    
    kubectl apply \
    --filename="${GDCS_IMPLEMENTATION_HOME}/manifests/${GDCS_TEST_VM_SSH_PNP_NAME}-pnp.yaml" \
    --namespace="${GDC_PROJECT}"
    
  3. Wait for the guest environment to report GuestEnvironmentSynced=True:

    kubectl wait virtualmachine.virtualmachine.gdc.goog "${GDCS_TEST_VM_NAME}" \
    --for=condition=GuestEnvironmentSynced \
    --namespace="${GDC_PROJECT}" \
    --timeout=600s
    

    The output is similar to the following:

    virtualmachine.virtualmachine.gdc.goog/rhel-test-vm condition met
    
  4. Wait for the VirtualMachineExternalAccess custom resource to report Ready=True and retrieve the external ingress IP address assigned to the virtual machine:

    kubectl wait virtualmachineexternalaccess.virtualmachine.gdc.goog "${GDCS_TEST_VM_NAME}" \
    --for=condition=Ready \
    --namespace="${GDC_PROJECT}" \
    --timeout=300s
    
    export GDCS_TEST_VM_INGRESS_IP=$(kubectl get virtualmachineexternalaccess.virtualmachine.gdc.goog "${GDCS_TEST_VM_NAME}" \
    --namespace="${GDC_PROJECT}" \
    --output=jsonpath='{.status.ingressIP}')
    
    echo "GDCS_TEST_VM_INGRESS_IP=${GDCS_TEST_VM_INGRESS_IP}"
    

    The output is similar to the following:

    GDCS_TEST_VM_INGRESS_IP=INGRESS_IP_ADDRESS
    
  5. Connect to the virtual machine using gdcloud compute ssh to verify platform-managed access:

    gdcloud compute ssh "${GDCS_TEST_VM_NAME}" \
    --command="hostnamectl; uname -r; getenforce; systemctl is-active guest-agent chronyd" \
    --project="${GDC_PROJECT}"
    

    The output is similar to the following:

    Operating System: Red Hat Enterprise Linux ...
    ...
    Enforcing
    active
    active
    

    Verify direct SSH access if needed. Select one of the following options:

    RHEL 8

    In native RHEL 8 deployments, platform-managed authentication using gdcloud compute ssh is the primary access method. Because gdcloud compute ssh creates a temporary VirtualMachineAccessRequest and ephemeral key (~/.ssh/gdch_compute_engine) that it deletes on exit (triggering gdc-guest-agent to remove that key), direct SSH using your persistent workstation key requires creating a separate VirtualMachineAccessRequest.

    For manual-mode RHEL 8 deployments, connect directly using the baked administrative SSH key (${GDCS_VM_ADMIN_SSH_KEY_FILE}):

    ssh -i "${GDCS_VM_ADMIN_SSH_KEY_FILE}" \
    -o ConnectTimeout=15 \
    -o StrictHostKeyChecking=accept-new \
    "${GDCS_VM_ADMIN_USER}@${GDCS_TEST_VM_INGRESS_IP}" \
    "hostnamectl && id && getenforce"
    

    The output is similar to the following:

    uid=1000(cloud-user) gid=1000(cloud-user) groups=1000(cloud-user),10(wheel)
    Enforcing
    

    RHEL 9

    Connect to the virtual machine using the baked administrative SSH key as a fallback verification:

    ssh -i "${GDCS_VM_ADMIN_SSH_KEY_FILE}" \
    -o ConnectTimeout=15 \
    -o StrictHostKeyChecking=accept-new \
    "${GDCS_VM_ADMIN_USER}@${GDCS_TEST_VM_INGRESS_IP}" \
    "hostnamectl && id && getenforce"
    

    The output is similar to the following:

    uid=1000(cloud-user) gid=1000(cloud-user) groups=1000(cloud-user),10(wheel)
    Enforcing
    

Capture a reusable golden image from the prepared virtual machine

Once a custom virtual machine is fully configured, patched, and validated in GDC, platform administrators can capture its boot disk directly into a reusable VirtualMachineImage artifact without exporting or re-uploading the disk image. New virtual machines can then create their boot disks from this image.

  1. Generalize the preparation virtual machine before shutdown to remove instance-specific identifiers, machine IDs, temporary passwords, baked SSH authorized keys, personal operator accounts provisioned during testing, shell history, and SSH host keys.

    Connect to the virtual machine serial console using gdcloud compute connect-to-serial-port "${GDCS_TEST_VM_NAME}" --project="${GDC_PROJECT}". For manual-mode VMs, sign in as ${GDCS_VM_ADMIN_USER} with the emergency password stored in ${GDCS_IMPLEMENTATION_HOME}/secrets/vm_admin_password. For native-import VMs (--os=rhel-8), first connect over gdcloud compute ssh, set a temporary password on ${GDCS_VM_ADMIN_USER} (for example, sudo passwd "${GDCS_VM_ADMIN_USER}"), and disconnect SSH before signing in through gdcloud compute connect-to-serial-port.

    Run the following generalization command as root inside the serial console session (gdc-guest-agent tracks active operator accounts in /var/lib/google/google_users and grants sudo access through membership in the google-sudoers group and /etc/sudoers.d/google_sudoers):

    sudo bash -euo pipefail -c 'shopt -s nullglob; for acct in $(sort -u <(cat /var/lib/google/google_users 2>/dev/null || true) <(getent group google-sudoers 2>/dev/null | cut -d: -f4 | tr "," "\n")); do [[ -n "${acct}" && "${acct}" != "${1}" ]] && userdel -r "${acct}" || true; done; rm -f /var/lib/google/google_users /etc/ssh/ssh_host_* "/home/${1}/.ssh/authorized_keys" /root/.ssh/authorized_keys /home/*/.ssh/authorized_keys /root/.bash_history /home/*/.bash_history; passwd -d "${1}" || true; passwd -l "${1}" || true; truncate -s 0 /etc/machine-id; rm -f /var/lib/dbus/machine-id; cloud-init clean --logs --seed; rm -rf /tmp/* /var/tmp/*' _ 'VM_ADMIN_USER'
    

    Replace VM_ADMIN_USER with your administrative username (for example, cloud-user). Running the cleanup inside the serial console prevents gdcloud compute ssh from re-provisioning an operator account during cleanup and ensures that you can delete gdc-guest-agent accounts before locking the ${GDCS_VM_ADMIN_USER} password.

  2. Cleanly stop the virtual machine instance to ensure file system consistency prior to disk snapshot capture:

    gdcloud compute instances stop "${GDCS_TEST_VM_NAME}" \
    --project="${GDC_PROJECT}"
    

    The output is similar to the following:

    Stopping VM instance PROJECT/rhel-test-vm
    VM instance PROJECT/rhel-test-vm stopped successfully
    
  3. Identify the boot VirtualMachineDisk of the stopped virtual machine:

    export GDCS_SOURCE_BOOT_DISK=$(kubectl get virtualmachine.virtualmachine.gdc.goog "${GDCS_TEST_VM_NAME}" \
    --namespace="${GDC_PROJECT}" \
    --output=jsonpath='{.spec.disks[?(@.boot==true)].virtualMachineDiskRef.name}')
    
    echo "GDCS_SOURCE_BOOT_DISK=${GDCS_SOURCE_BOOT_DISK}"
    

    The output is similar to the following:

    GDCS_SOURCE_BOOT_DISK=BOOT_DISK_NAME
    
  4. Create the declarative VirtualMachineImageImport resource referencing the boot disk using source.diskRef (minimumDiskSize must be greater than or equal to the 22GB source boot disk size):

    cat << EOF > "${GDCS_IMPLEMENTATION_HOME}/manifests/rhel-9-6-golden-import.yaml"
    apiVersion: virtualmachine.gdc.goog/v1
    kind: VirtualMachineImageImport
    metadata:
      name: rhel-9-6-golden-import
      namespace: ${GDC_PROJECT}
    spec:
      imageMetadata:
        minimumDiskSize: 22Gi
        name: rhel-9-6-golden
        operatingSystem: garden-linux
      source:
        diskRef:
          name: ${GDCS_SOURCE_BOOT_DISK}
    EOF
    
    kubectl apply \
    --filename="${GDCS_IMPLEMENTATION_HOME}/manifests/rhel-9-6-golden-import.yaml" \
    --namespace="${GDC_PROJECT}"
    
  5. Wait for the golden image import to report Ready=True and verify that the golden VirtualMachineImage is registered in the project:

    kubectl wait virtualmachineimageimport.virtualmachine.gdc.goog "rhel-9-6-golden-import" \
    --for=condition=Ready \
    --namespace="${GDC_PROJECT}" \
    --timeout=3600s
    
    kubectl get virtualmachineimage.virtualmachine.gdc.goog "rhel-9-6-golden" \
    --namespace="${GDC_PROJECT}" \
    --output=jsonpath='{.metadata.name}{" "}{.spec.minimumDiskSize}{"\n"}'
    

    The output is similar to the following:

    rhel-9-6-golden 22Gi
    
  6. Delete the test virtual machine instance and the temporary ProjectNetworkPolicy:

    gdcloud compute instances delete "${GDCS_TEST_VM_NAME}" \
    --project="${GDC_PROJECT}" \
    --quiet
    
    kubectl delete projectnetworkpolicy.networking.gdc.goog "${GDCS_TEST_VM_SSH_PNP_NAME}" \
    --ignore-not-found=true \
    --namespace="${GDC_PROJECT}"
    

Troubleshoot VM access

If virtual machine access fails, review the following troubleshooting checks:

  • GuestEnvironmentSynced remains False (GuestEnvironmentNotConnected): For RHEL 8 native import, confirm that the image import reported Ready=True and that the guest-agent.service unit started on first boot. For RHEL 9 manual mode, confirm that the gdc-guest-agent RPM was installed during offline preparation and that the guest-agent.service unit is enabled. On manual-mode deployments, you can connect by using the baked administrative SSH key (${GDCS_VM_ADMIN_SSH_KEY_FILE}) or sign in on the serial console (gdcloud compute connect-to-serial-port "${GDCS_TEST_VM_NAME}") with your emergency password to inspect logs with the journalctl -u guest-agent command. On native-import VMs, neither the baked SSH key nor a local serial console password is preconfigured unless you added a local user through a startup script.
  • External ingress IP address is unreachable from your workstation: The ingress IP address from the VirtualMachineExternalAccess custom resource (the status.ingressIP field) is reachable only from networks that are routed to the organization's external data network. If your workstation resides on a separate management network, packets to the ingress IP address aren't routed even when the virtual machine is operational. To verify virtual machine health independently of external routing, deploy an in-project pod or virtual machine and test connectivity directly to the virtual machine's internal IP address (the status.network.interfaces[0].ipAddresses[0] field). Containerized SSH clients running on GDC nodes in FIPS mode reject ed25519 keys; generate an ECDSA P-256 or RSA 3072 key pair when connecting from containers on FIPS-enforced nodes.
  • SSH connection times out: Confirm that the virtual machine was created with --enable-external-access, that VirtualMachineExternalAccess shows an IP address in status.ingressIP, and that TCP port 22 is listed in spec.ports. Verify that the ProjectNetworkPolicy custom resource is active in the project namespace and that ${GDCS_TEST_VM_ADMIN_CIDR} includes your workstation source IP address.
  • Permission denied (publickey): When connecting with gdcloud compute ssh, verify that your user identity has project-vm-admin privileges and that GuestEnvironmentSynced=True. When connecting with the baked key fallback on RHEL 9, confirm that ${GDCS_VM_ADMIN_SSH_KEY_FILE}.pub was injected into the image with virt-customize and that file permissions on the private key are set to 0600 (chmod u=rw,go=).

What's next