title: How can I get nested virtualization working on e2-micro GCP VM?
body: <p>I'm trying to utilize the nested virtualization feature on Google Cloud Platform (GCP), however I was unsuccessful when attempting to use it. Here's the procedure I followed, according to the <a href="https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances" rel="nofollow noreferrer">GCP documentation</a>:</p>
  <ol>
  <li>Create a new disk, based on Ubuntu 18 LTS image</li>
  <li>Create a new image from the disk, applying the vmx license</li>
  <li>Create a new VM instance from the image</li>
  <li>Check if nested virtualization is supported, using the <code>cpu-checker</code> package in Ubuntu</li>
  </ol>
  <pre><code>gcloud compute disks create disk1 --image-project ubuntu-os-cloud --image-family ubuntu-1804-lts --zone us-central1-a
  gcloud compute images create nested-vm-image --source-disk disk1 --source-disk-zone us-central1-a --licenses &quot;https://compute.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx&quot;
  gcloud compute instances create firecracker --description firecracker --image nested-vm-image --zone us-central1-a --preemptible --machine-type e2-micro
  </code></pre>
  <p>Upon running the <code>sudo kvm-ok</code> command, I received this message:</p>
  <blockquote>
  <p>INFO: Your CPU does not support KVM extensions</p>
  <p>KVM acceleration can NOT be used</p>
  </blockquote>
  <h2>Troubleshooting</h2>
  <h3>Ensure I am Using Haswell CPU</h3>
  <p>I used the <code>gcloud compute instances describe</code> command to confirm that my <code>e2-micro</code> VM was utilizing the Intel Haswell CPU, which is the minimum required for nested virtualization to work, according to the GCP documentation.</p>
  <pre><code>(base) ➜  ~ gcloud compute instances describe firecracker
  No zone specified. Using zone [us-central1-a] for instance: [firecracker].
  canIpForward: false
  cpuPlatform: Intel Haswell
  creationTimestamp: 'xxxxxxxxxxxxxxx'
  deletionProtection: false
  description: firecracker
  disks:
  - autoDelete: true
    boot: true
    deviceName: persistent-disk-0
    guestOsFeatures:
    - type: VIRTIO_SCSI_MULTIQUEUE
    index: 0
    interface: SCSI
    kind: compute#attachedDisk
    licenses:
    - https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/licenses/ubuntu-1804-lts
    - https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx
    mode: READ_WRITE
    source: https://www.googleapis.com/compute/v1/projects/xxxxxxxx/zones/us-central1-a/disks/firecracker
    type: PERSISTENT
  id: 'xxxxxxxxxxxxxxxxxxxxx'
  kind: compute#instance
  labelFingerprint: xxxxxxxxxxxxxx
  machineType: https://www.googleapis.com/compute/v1/projects/xxxxxxxx/zones/us-central1-a/machineTypes/e2-micro
  metadata:
    fingerprint: xxxxxxxxxxxxxxx
    kind: compute#metadata
  name: firecracker
  networkInterfaces:
  - accessConfigs:
    - kind: compute#accessConfig
      name: external-nat
      natIP: xxxxxxxxxxx
      networkTier: PREMIUM
      type: ONE_TO_ONE_NAT
    fingerprint: xxxxxxxxxxxxxx
    kind: compute#networkInterface
    name: nic0
    network: https://www.googleapis.com/compute/v1/projects/xxxxxxxx/global/networks/default
    networkIP: xxxxxxxxxxxxxx
    subnetwork: https://www.googleapis.com/compute/v1/projects/xxxxxxxx/regions/us-central1/subnetworks/default
  scheduling:
    automaticRestart: false
    onHostMaintenance: TERMINATE
    preemptible: true
  selfLink: https://www.googleapis.com/compute/v1/projects/xxxxxxxx/zones/us-central1-a/instances/firecracker
  serviceAccounts:
  - email: xxxxxxxx@developer.gserviceaccount.com
    scopes:
    - https://www.googleapis.com/auth/devstorage.read_only
    - https://www.googleapis.com/auth/logging.write
    - https://www.googleapis.com/auth/monitoring.write
    - https://www.googleapis.com/auth/pubsub
    - https://www.googleapis.com/auth/service.management.readonly
    - https://www.googleapis.com/auth/servicecontrol
    - https://www.googleapis.com/auth/trace.append
  startRestricted: false
  status: RUNNING
  tags:
    fingerprint: xxxxxxxxxxxxxxxx
  zone: https://www.googleapis.com/compute/v1/projects/xxxxxxxx/zones/us-central1-a
  </code></pre>
  <h3>Tried Ubuntu 16.04 LTS</h3>
  <p>I also tried the same process with Ubuntu 16.04 LTS, according to the documentation, and received the same result as with Ubuntu 18.04 LTS.</p>
  <h2>Question</h2>
  <p><strong>Question</strong>: How can I successfully spin up a GCP VM that supports nested virtualization? As far as I can tell, I followed the documentation's requirements, but couldn't get it to work.</p>
  <p>I realize that the documentation doesn't explicitly indicate that they test nested virtualization with Ubuntu 18 LTS, but that doesn't necessarily mean it won't work.</p>