Editor hangs opening project in VitualBox when 3D acceleration is enabled

While running Unity Editor with Ubuntu emulated inside VirtualBox with 3D acceleration enabled, the editor will hang while trying to open a project.

Following can be seen in editor log:

OpenGL Warning: glXChooseFBConfig returning NULL, due to attrib=0x2, next=0x20
[0607/160612:ERROR:gl_surface_glx.cc(613)] glXChooseFBConfig failed.
[0607/160612:ERROR:gpu_info_collector.cc(27)] gfx::GLContext::CreateOffscreenGLSurface failed
[0607/160612:ERROR:gpu_info_collector.cc(89)] Could not create surface for info collection.
[0607/160612:ERROR:gpu_main.cc(402)] gpu::CollectGraphicsInfo failed (fatal).
[0607/160612:ERROR:sandbox_linux.cc(308)] InitializeSandbox() called with multiple threads in process gpu-process
IsTimeToCheckForNewEditor: Update time 0 current 1465308378

Disabling VirtualBox 3D acceleration solves this problem.

Here is versions of various software involved:

Unity Editor: 5.3.5f1
VirtualBox: 5.0.20 r106931
Guest OS: Ubuntu 16.04
Host OS: Windows 10

Looks like vbox is refusing to give us a valid fbconfig.

You mean that’s an error on vbox/ubuntu’s subsystem side?

It does look that way. The offending error messages look like they’re coming from inside CEF - do you get the same error if you launch with -projectPath or -createProject ?

I get somewhat different error with -projectPath or -createProject:

Desktop is 1920 x 1080 @ 60 Hz
OpenGL Warning: glXChooseVisual: ignoring attribute 0x22
OpenGL Warning: glXChooseVisual: bad attrib=0x186a1, ignoring
OpenGL Warning: glXChooseVisual: bad attrib=0x186a0, ignoring
No valid fbconfig found
OpenGL Warning: XGetVisualInfo returned 0 visuals for 0000000000000000

but the editor still hangs.

I also tried running ‘glmark2’ utility, and it fails with simulator error messages. I guess VirtualBox 3D acceleration is broken.

Ok, so the project window just fails sooner than Unity itself does: No valid fbconfig found is game over.

I’ve had this error in the past too with Manjaro

I just tried disabling 3D acceleration like he said and Unity opened right up. Unfortunately the Scene view is black. Interestingly, the game view works, you just can’t do anything with it because the scene view doesn’t work. Everything else seems to function normally though

I hope you can figure this out, this is the first time I’ve seen Unity running in Linux and it just looks so right!

I have opened this ticket on virtualbox bug tracker: #15540 (Can't run Unity Editor due to openGL errors) – Oracle VM VirtualBox

@Tak ; perhaps you can make small example program that makes the glXChooseFBConfig call with the same arguments as Unity Editor?

It would be nice if there is a simple program that reproduces this problem, so it can be attached to the bug report.

We’re initially passing the following, then filtering the results based on stuff like sample buffers, depth/stencil size, config caveat:

GLX_X_RENDERABLE , True,
GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
GLX_RENDER_TYPE , GLX_RGBA_BIT,
GLX_X_VISUAL_TYPE , GLX_TRUE_COLOR,
GLX_RED_SIZE , 8,
GLX_GREEN_SIZE , 8,
GLX_BLUE_SIZE , 8,
GLX_ALPHA_SIZE , 8,
GLX_SAMPLES_ARB , GLX_DONT_CARE,
GLX_SAMPLE_BUFFERS_ARB , GLX_DONT_CARE,
GLX_DOUBLEBUFFER , True,
GLX_STEREO , enableStereo ? True : False,
None