Reputation: 7772
I am trying to run a Genymotion 2.8 emulator from the command line without displaying any UI at all.
I am executing the following instructions:
VBoxManage guestproperty set <vm-name> hardware_opengl 0
VBoxManage startvm <vm-name> --type headless
The VM boots up and I am able to connect to it using adb
, but then I get a bunch of errors like this:
E/EGL_emulation: Failed to establish connection with the host
W/libEGL: eglInitialize(0xf708e040) failed (EGL_SUCCESS)
E/gralloc_vbox86: gralloc: Failed to get host connection
E/SurfaceFlinger: hwcomposer module not found
E/SurfaceFlinger: ERROR: failed to open framebuffer (I/O error), aborting
I was able to get this working on the previous Genymotion version.
Any help on this would be much appreciated.
Upvotes: 3
Views: 2090
Reputation: 61
With Linux, you can emulate a graphical interface using Xvfb.
Here is a script to automate this task for a given VM:
#!/bin/bash
if [ $# == 0 ]; then
echo "You must provide a vm uid"
echo "You can list vm uid with VBomaxManage list vms"
ids=$(VBoxManage list vms)
if [ $? == 0 ]; then
echo "Available VM:"
echo "$ids"
fi
exit 1
fi
SCREEN=3
Xvfb :$SCREEN -nolisten tcp -screen :$SCREEN 1280x800x24 &
xvfb="$!"
DISPLAY=:3 genymotion-player --vm-name $1
kill -9 $xvfb
Upvotes: 2
Reputation: 7116
TL;DR
Genymotion virtual devices does not support headless mode. It cannot be launched simply from vbox.
Here is an explanation from this previous answer:
When you start a Genymotion device on the standard way from Genymotion Soft, the Android OS is starting inside a VirtualBox VM but all the UI processing (which uses OpenGL) is done outside the VM to make the rendering pipeline uses your computer's GPU. Using this hardware acceleration makes the Genymotion devices fairly smooth and fast.
When you start the Genymotion VMs directly from VirtualBox, the OS will start but the rendering won't be hardware accelerated. From 2.3 to 4.2 there is a fallback solution: the rendering will be computed by the CPU, from inside the VM. From 4.3, the soft rendering is not a good solution as it will slow down the OS too much to be acceptable, that's the reason why we've disabled it and it cannot be enabled.
Upvotes: 3