Enable VMX/SVM on Google Kubernetes Engine Cluster

3/24/2020

I have GKE cluster (Master version: 1.14.10-gke.24).

I'm trying to run the following container (Android-Emulator): https://github.com/budtmo/docker-android .

*I just create yaml deployment file for this.

After I running my deploy and try to run new android emulator inside the pod using:

emulator @samsung_galaxy_s8_8.0

I got the following error:

emulator: ERROR: x86 emulation currently requires hardware acceleration!

Please ensure KVM is properly installed and usable.

CPU acceleration status: KVM requires a CPU that supports vmx or svm

More info on configuring VM acceleration on Linux: https://developer.android.com/studio/run/emulator-acceleration#vm-linux

General information on acceleration: https://developer.android.com/studio/run/emulator-acceleration.

How can I solve it? Should I enable VMX on cluster, If so, how can I do it?

-- samisaviv
android
emulation
google-cloud-platform
google-kubernetes-engine
kubernetes

1 Answer

3/26/2020

Currently nested virtualization is available only on GCE as per this docs.

There is already a question regarding supporting of Nested Virtualization on GKE. I'd say it's not introduced yet, thats why you cannot find proper documentation about GKE and nested virtualization.

So far I can see only one workaround:

As a workaround, I've been doing what this user was doing which is to clone the existing GKE node image and add the license, and copy-and-edit the instance group's template to the image:

https://groups.google.com/d/msg/kubernetes-users/Lq0ttadDOYI/1y1RVQMCBgAJ

Obviously it's not 100% supported but I still get a lot of the GKE benefits AND nested virtualization.

Hope that helps.

-- Nick
Source: StackOverflow