Android – Running OpenGL App on Android x86 and VirtualBox

androidopenglvirtualbox

I have successfully installed Android x86 4.0 on VirtualBox, and I am trying to get an OpenGL app to work. I have enabled "3D Acceleration" in VirtualBox settings, but when I open the app it instantly crashes and logs

java.lang.IllegalArgumentException: No configs match configSpec

I tried the 0xbenchmark 3D test (0xbenchmark is a test app that comes with Android-x86). It worked perfectly. EDIT: I'm not sure why it does, because no other OpenGL apps seem to work. Perhaps Android-x86 does not actually support GLES 2.0

What can I do to make all OpenGL apps work on VirtualBox?

EDIT: I neglected to include stack trace before, so here it is (from logcat):

E/AndroidRuntime( 1681): FATAL EXCEPTION: GLThread 146
E/AndroidRuntime( 1681): java.lang.IllegalArgumentException: No configs match configSpec
E/AndroidRuntime( 1681):        at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:863)
E/AndroidRuntime( 1681):        at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1024)
E/AndroidRuntime( 1681):        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1401)
E/AndroidRuntime( 1681):        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

Best Answer

After some extensive searching and testing I found the solution. The problem is that VirtualBox's virtual graphics drivers do not in fact fully support OpenGL. What I need is something that can pass my computer's own GPU into the virtual environment of Android. I found something that can do exactly that, AndroVM. It's version of android has custom written drivers to work seamlessly in VirtualBox, and it comes with it's own player which emulates GLES using the host's physical GPU. Using AndroVM and its player, I was able to successfully run all OpenGL apps.

Related Question