[GH-ISSUE #160] Documentation about running docker-android using k8s #114

Open
opened 2026-03-01 15:40:38 +03:00 by kerem · 7 comments
Owner

Originally created by @maauso on GitHub (May 24, 2019).
Original GitHub issue: https://github.com/budtmo/docker-android/issues/160

Operating System:
Kubernetes on to of Amazon Linux 2

Docker Image:
butomo1989/docker-android-x86-7.1.1

Docker Version:
17.06

Docker-compose version (Only if you use it):
we are not using

K8S Yaml to start docker-android:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: android
  namespace: selenium
  labels:
    app: selenium
    environment: stg
    role: qa
    service: selenium
spec:
  replicas: 1
  selector:
    matchLabels:
      app: android
  template:
    metadata:
      labels:
        app: android
    spec:
      containers:
      - name: android
        image: butomo1989/docker-android-x86-7.1.1
        resources:
          limits:
            memory: "2048Mi"
            cpu: "500m"
        securityContext:
          privileged: true
        ports:
        - containerPort: 6080
          name: port1
        - containerPort: 4723
          name: port2
        - containerPort: 5554
          name: port3
        - containerPort: 5555
          name: port4
        - containerPort: 5037
          name: port5
        env:
        - name: DEVICE
          value: "Nexus 5"
        - name: APPIUM
          value: "true"
        - name: CONNECT_TO_GRID
          value: "  true"
        - name: APPIUM_HOST
          value: "android.selenium"
        - name: APPIUM_PORT
          value: "4723"
        - name: SELENIUM_HOST
          value: "selenium-selenium-hub.selenium"
        - name: SELENIUM_PORT
          value: "4444"        

Expected Behavior

Run docker-android on top of EKS

Actual Behavior

The container can connect to the selenium hub, but when we want to launch the test we found the error

emulator: CPU Acceleration: DISABLED
emulator: CPU Acceleration status: KVM requires a CPU that supports vmx or svm
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
root@android-766c9c5f58-2wknl:~#

full log attached
docker-android.stdout.log

Also, When we launch the test then we encountered an error in the appium.log

Could not find a connected Android device

We are running this docker on top of EKS it shouldn't be a problem, but do you have some documentation or workaround to do it?

Originally created by @maauso on GitHub (May 24, 2019). Original GitHub issue: https://github.com/budtmo/docker-android/issues/160 Operating System: Kubernetes on to of Amazon Linux 2 Docker Image: butomo1989/docker-android-x86-7.1.1 Docker Version: 17.06 Docker-compose version (Only if you use it): we are not using K8S Yaml to start docker-android: ``` apiVersion: extensions/v1beta1 kind: Deployment metadata: name: android namespace: selenium labels: app: selenium environment: stg role: qa service: selenium spec: replicas: 1 selector: matchLabels: app: android template: metadata: labels: app: android spec: containers: - name: android image: butomo1989/docker-android-x86-7.1.1 resources: limits: memory: "2048Mi" cpu: "500m" securityContext: privileged: true ports: - containerPort: 6080 name: port1 - containerPort: 4723 name: port2 - containerPort: 5554 name: port3 - containerPort: 5555 name: port4 - containerPort: 5037 name: port5 env: - name: DEVICE value: "Nexus 5" - name: APPIUM value: "true" - name: CONNECT_TO_GRID value: " true" - name: APPIUM_HOST value: "android.selenium" - name: APPIUM_PORT value: "4723" - name: SELENIUM_HOST value: "selenium-selenium-hub.selenium" - name: SELENIUM_PORT value: "4444" ``` ## Expected Behavior Run docker-android on top of EKS ## Actual Behavior The container can connect to the selenium hub, but when we want to launch the test we found the error ``` emulator: CPU Acceleration: DISABLED emulator: CPU Acceleration status: KVM requires a CPU that supports vmx or svm 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 root@android-766c9c5f58-2wknl:~# ``` _full log attached_ [docker-android.stdout.log](https://github.com/budtmo/docker-android/files/3216884/docker-android.stdout.log) Also, When we launch the test then we encountered an error in the `appium.log` ``` Could not find a connected Android device ``` We are running this docker on top of EKS it shouldn't be a problem, but do you have some documentation or workaround to do it?
Author
Owner

@HasBert commented on GitHub (May 25, 2019):

I've not tested the docker container inside with k8s on EKS, but what I tried was running it inside a virtualbox container. There I had the problem, that virtualbox doesn't support hardware virtualization like KVM. In the error message you got it says, that Hardware virtualization is disabled and therefore KVM can not come to work. If you try to run this image on a linux machine you own, you can enable Hardware Virtualization inside the BIOS, if your CPU supports it, and KVM can work.

To find out if your CPU supports Hardware Virtualization, you can type in this command to check this:

egrep -c "(svm|vmx)" /proc/cpuinfo

if the output is 0 then your CPU doesn't supoort it.

However you could try to run an arm image instead of a x86 image of the emulator. Like asked here: #88 . If you manage it to run the arm image, then you'll probably need like 10 minutes to start the container, which is in the most cases not what you want.

I don't want to disappoint you, but the only thing in mind, how to solve this issue, is to try the EKS does a KVM for you, maybe there is an option somewhere? VMWare does it too, which is in fact no cloud service. I don't even know if this is possible, just a thought.
Hopefully there is someone out there who can give you a more precise answer on your problem.

<!-- gh-comment-id:495826334 --> @HasBert commented on GitHub (May 25, 2019): I've not tested the docker container inside with k8s on EKS, but what I tried was running it inside a virtualbox container. There I had the problem, that virtualbox doesn't support hardware virtualization like KVM. In the error message you got it says, that Hardware virtualization is disabled and therefore KVM can not come to work. If you try to run this image on a linux machine you own, you can enable Hardware Virtualization inside the BIOS, if your CPU supports it, and KVM can work. To find out if your CPU supports Hardware Virtualization, you can type in this command to check this: ```bash egrep -c "(svm|vmx)" /proc/cpuinfo ``` if the output is _0_ then your CPU doesn't supoort it. However you could try to run an arm image instead of a x86 image of the emulator. Like asked here: #88 . If you manage it to run the arm image, then you'll probably need like 10 minutes to start the container, which is in the most cases not what you want. I don't want to disappoint you, but the only thing in mind, how to solve this issue, is to try the EKS does a KVM for you, maybe there is an option somewhere? VMWare does it too, which is in fact no cloud service. I don't even know if this is possible, just a thought. Hopefully there is someone out there who can give you a more precise answer on your problem.
Author
Owner

@budtmo commented on GitHub (May 29, 2019):

You need to make sure that the machine support virtualization. I will close the ticket and please feel free to reopen it.

<!-- gh-comment-id:496914974 --> @budtmo commented on GitHub (May 29, 2019): You need to make sure that the machine support virtualization. I will close the ticket and please feel free to reopen it.
Author
Owner

@maauso commented on GitHub (May 29, 2019):

Thanks for all guys

<!-- gh-comment-id:496915581 --> @maauso commented on GitHub (May 29, 2019): Thanks for all guys
Author
Owner

@budtmo commented on GitHub (May 29, 2019):

It would be great if you can send a PR about your deployment template (e.g. terraform or any other tool), so other can benefit from it and we share the information. @maauso

<!-- gh-comment-id:496919533 --> @budtmo commented on GitHub (May 29, 2019): It would be great if you can send a PR about your deployment template (e.g. terraform or any other tool), so other can benefit from it and we share the information. @maauso
Author
Owner

@maauso commented on GitHub (May 29, 2019):

Sure, but at the moment we are looking for the best approach to have a cheaper metal server on aws

<!-- gh-comment-id:496920391 --> @maauso commented on GitHub (May 29, 2019): Sure, but at the moment we are looking for the best approach to have a cheaper metal server on aws
Author
Owner

@budtmo commented on GitHub (May 29, 2019):

awesome, Thanks a lot @maauso , I will open the issue and change the title than so we dont forget about it.

<!-- gh-comment-id:496923178 --> @budtmo commented on GitHub (May 29, 2019): awesome, Thanks a lot @maauso , I will open the issue and change the title than so we dont forget about it.
Author
Owner

@v0n0 commented on GitHub (Jul 22, 2020):

So how does Genymotion run the emulator on non-metal instances? If they can, everyone should be able to. Or did they write custom virtualization?

<!-- gh-comment-id:662258486 --> @v0n0 commented on GitHub (Jul 22, 2020): So how does Genymotion run the emulator on non-metal instances? If they can, everyone should be able to. Or did they write custom virtualization?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-android#114
No description provided.