Configure booting

This document is for platform administrators and application owners that run virtual machines (VMs) in VM Runtime on Google Distributed Cloud. This document shows you how to enable the Unified Extensible Firmware Interface (UEFI) boot process instead of the default BIOS booting process for virtual machines (VMs) that use Anthos VM Runtime. This document also shows how to enable Secure Boot and how to set up emulated smbios fields.

Before you begin

To complete this document, you need access to the following resources:

Enable UEFI booting

You can enable UEFI booting for both new and existing VMs. To enable UEFI booting in an existing VM, the VM must have an EFI partition.

  1. Create a manifest that defines a VirtualMachine or edit the manifest of an existing VirtualMachine.
  2. Add the firmware field to the VirtualMachine manifest as shown in the example below:

    apiVersion: vm.cluster.gke.io/v1
    kind: VirtualMachine
    metadata:
      labels:
        kubevirt.io/vm: vm1
      name: vm1
      namespace: test-vm-ns
    spec:
      compute:
        cpu:
          vcpus: 2
        memory:
          capacity: 4Gi
      interfaces:
      - name: eth0
        networkName: pod-network
        default: true
      firmware:
        bootloader:
          type: "uefi"
          enableSecureBoot: false
      disks:
      - virtualMachineDiskName: disk-from-gcs
        boot: true
        readOnly: true
    

Enable secure boot

If UEFI booting is enabled for a VM you can also enable Secure Boot by setting the enableSecureBoot field to true as shown below:

  firmware:
    bootloader:
      type: "uefi"
      enableSecureBoot: true

For more information about Secure Boot, see Secure Boot in the Compute Engine documentation.

Provide emulated smbios fields

You can set up emulated smbios fields like uuid and serial by adding them in the firmware field of the VirtualMachine manifest as shown in the example below:

  firmware:
    FIELD_NAME: FIELD_VALUE
    FIELD_NAME: FIELD_VALUE

Replace FIELD_NAME and FIELD_VALUE with the smbios field names and values that your application requires.

You can set up emulated smbios fields when using either UEFI or BIOS booting.