How to enable VT-X/AMD-v on Google Cloud Platform VM's?

7/20/2018

I am trying to install Minikube on a GCP VM. I am running into an issue where the OS is complaining that VT-X/AMD-v needs to be enabled. Are there any specific instructions for setting this up on GCP?

-- cyberbeast
google-cloud-platform
kubernetes
minikube

2 Answers

4/9/2020

Use this link. It works with a warning that environment is outdated, and a solution is given in the warning itself. Basically you may need to upgrade guest environment. I didn't need to do anything; it just worked great. The answer above doesn't work, at least as of now (VM starts and then stops on its own).

-- Apurva Singh
Source: StackOverflow

7/21/2018

Nested Virtualization is supported on GCP and I can confirm the documentation I've linked is up to date and workable.

Quoting the 3 basic points here that you need:

  • A supported OS
    • CentOS 7 with kernel version 3.10
    • Debian 9 with kernel version 4.9
    • Debian 8 with kernel version 3.16
    • RHEL 7 with kernel version 3.10
    • SLES 12.2 with kernel version 4.4
    • SLES 12.1 with kernel version 3.12
    • Ubuntu 16.04 LTS with kernel version 4.4
    • Ubuntu 14.04 LTS with kernel version 3.13
  • Create an image using the special licence https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx (this is offered at no additional cost; it simply signals GCE that you want the feature enabled on instances using this image)
    • Create is using an already existing disk (for example): gcloud compute images create nested-vm-image --source-disk disk1 --source-disk-zone us-central1-a --licenses "https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx" (You will have to create disk1 yourself, for example by starting an instance from an OS image, and deleting the instance afterwards while keeping the boot disk)
    • Create it using an already existing image with (for example): gcloud compute images create nested-vm-image --source-image=debian-10-buster-v20200326 --source-image-project=debian-cloud --licenses="https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
  • Create an instance from a nested virtualization enabled image. Something like: gcloud compute instances create example-nested-vm --zone us-central1-b --image nested-vm-image . Keep in mind that you need to pick a zone that has at least Haswell CPUs.

SSH into the new instance and verify that the feature is enabled by running grep vmx /proc/cpuinfo. If you get any output it means that the feature is enabled successfully.

-- Janos Lenart
Source: StackOverflow