I have just created a server in GCP. It is a Ubuntu that i want to use with GNS3. The problem is that machines created in GCP does not have KVM support. Is there sone way to use it in GCP? Regards!!
The GCP Compute Engine supports KVM virtualization module but isn't super clear about how to actually create the instance. Here is a concrete way to create a cloud instance that supports KVM.
gcloud compute instances create kvm1 \
--zone=us-central1-a \
--min-cpu-platform="Intel Haswell" \
--image-project=ubuntu-os-cloud \
--image=ubuntu-2004-focal-v20220610 \
--boot-disk-size 200GB \
--machine-type=n1-standard-16 \
--enable-nested-virtualization
After creating the instance I SSHd into the machine to verify that KVM can be used:
>> ls /dev/kvm
/dev/kvm
>> egrep -c '(vmx|svm)' /proc/cpuinfo
32
>> sudo apt install cpu-checker
>> sudo kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
This worked for my use-case of building AOSP.
For now GCP Compute Engine supports KVM based nested virtualization - check docs here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With