Error while running Robotscripts using QEMU on top of Docker

We are currently trying to run Android mobile automation scripts on top of dockers with ubuntu as base image , so i created a dockerfile with the below configurations :

Android Studio: Android Studio Dolphin | 2021.3.1 Patch 1
Appium: App Version 1.19.1
Node.js: v18.12.1
Java: openjdk 17.0.2 2022-01-18 LTS
OpenJDK Runtime Environment Corretto- (build 17.0.2+8-LTS)
OpenJDK 64-Bit Server VM Corretto- (build 17.0.2+8-LTS, mixed mode, sharing)
Python: 3.10.5

Below Are the configuration which we have used to create the AVD


Installed required depedencies

RUN npm install -g appium@latest @appium/doctor &&
appium-doctor --android &&
appium driver install uiautomator2 &&
appium plugin install execute-driver &&
appium plugin install images &&
appium plugin install relaxed-caps

And also installed required SDK tools

RUN wget -O /tmp/ &&
mkdir -p /opt/android-sdk/cmdline-tools &&
unzip -d /opt/android-sdk/cmdline-tools /tmp/ &&
rm /tmp/

And i have included the Android system image for QEMU *86_64
RUN mkdir -p /root/android/system-images &&
wget -O /root/android/system-images/ \

And copied our mobile scripts & required APK’s which are based on Robotframework into the container

We were sucessfully in getting the test case pass(robotframework) by spinning the android emulator using SDK tools .

However we would need to replicate the scenario by using QEMU , So instead of spinning the android emulator from SDK tools we can use QEMU to do it .

I am unable get the QEMU emulator up to run trh scripts , Our ultimate goal is to Work on using a newer light-weight emulator (QEMU) that will avoid any infrastructure changes required for the scripts to run. This facilitates usage of AWS serverless compute engine Fargate.

I am unable to boot the emulator using QEMU , I am manually starting the ADB server & appium server using adb start-server --port=5037 however the ADB server is not getting started .Below is the error which iam coming across

Error :

  • daemon not running; starting now at tcp:5037
  • daemon started successfully
    [Appium] Welcome to Appium v2.11.1
    [Appium] Non-default server args:
    [Appium] {
    address: ‘’,
    basePath: ‘/wd/hub’
    [Appium] The autodetected Appium home path: /root/.appium
    [Appium] Attempting to load driver uiautomator2…
    [Appium] Requiring driver at /root/.appium/node_modules/appium-uiautomator2-driver/build/index.js
    [Appium] AndroidUiautomator2Driver has been successfully loaded in 1.334s
    [Appium] Appium REST http interface listener started on
    [Appium] Available drivers:
    [Appium] - uiautomator2@3.7.1 (automationName ‘UiAutomator2’)
    [Appium] Available plugins:
    [Appium] - execute-driver@3.0.31
    [Appium] - images@3.0.16
    [Appium] - relaxed-caps@1.0.6
    [Appium] No plugins activated. Use the --use-plugins flag with names of plugins to activate
    Starting emulator using QEMU…
    Waiting for emulator to start…
    WARNING: Image format was not specified for ‘/root/android/system-images/x86_64/system.img’ and probing guessed raw.
    Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
    Specify the ‘raw’ format explicitly to remove the restrictions.
    Waiting for emulator to boot…
    Waiting for emulator to boot…
    Waiting for emulator to boot…
    Waiting for emulator to boot…
    Waiting for emulator to boot…
    Waiting for emulator to boot…
    Waiting for emulator to boot…
    Waiting for emulator to boot…
    Waiting for emulator to boot…
    Waiting for emulator to boot…
    Waiting for emulator to boot…

Emulator did not boot in expected time. Exiting…
qemu-system-x86_64: terminating on signal 1

Any suggestions are helpful !!

Hopefully this post on stack overflow will resolve or at least help:

But as it’s a warning I’m not sure if that is stopping the emulator starting but the warning up from it does mention it cannot find the system.img, so it’s possible that may resolve it, but least it’s worth trying.

Other than that, it’s not something spun up myself before so I probably won’t be able to help further than a google of the error.


1 Like