c++virtual-machinevirtualboxvmwareopenframeworks

is there a vm that i can do opengl 3+ with? virtualbox and vmware don't


I am trying to write some openFrameworks (C++) code in a VM. My host is Windows 8 and I've tried both Arch Linux and Ubuntu guests. My host computer runs the graphics code just fine with an NVidia Optimus setup and 8GB of RAM.

I do my main development in Visual Studio, however I do prefer to create Android and test packages from Linux. For this reason I just want to fire up a VM and take care of business. The problem is that some of my graphics apps need OpenGL 3+

Has anybody else had the same problem and solved it?


Solution

  • Try VirtualBox and prepend MESA_GL_VERSION_OVERRIDE=3.0 MESA_GLSL_VERSION_OVERRIDE=130 to your linux command line. Some of the opengl3 functions may work. Though not all of them will. I used that to bring up Civ5, the animation did not show up, nor did the on-screen fonts.

    If you want to see the source code:

    VirtualBox uses chromium 1.9 that is opengl 2.1. The info can be verified by the glxinfo command. Use the following commands to track the VirtualBox opengl lib file:

    $ ldd /usr/bin/glxinfo
    $ apt-file search /usr/lib/x86_64-linux-gnu/libGL.so.1.2
    $ LIBGL_DEBUG=verbose glxinfo
    

    Then follow links:

    $ ls -l x86_64-linux-gnu/dri/
    lrwxrwxrwx Apr 14 2014 vboxvideo_dri.so -> ../../VBoxOGL.so
    
    $ apt-file search /usr/lib/VBoxOGL.so
    virtualbox-dbg: /usr/lib/debug/usr/lib/VBoxOGL.so
    virtualbox-guest-x11: /usr/lib/VBoxOGL.so
    
    $ dpkg -l virtualbox*
    ii virtualbox-guest-x11 4.1.18-dfsg-2+deb7 amd64
    
    $ apt-file list virtualbox-guest-x11
    ...
    

    The source code tarball was virtualbox-4.3.10-dfsg.orig.tar.gz from trusty repo. The version string can be grep'ed by $ grep -r CR_OPENGL_VERSION_STRING * and $ grep -r CR_VERSION_STRING * in the source code directory.

    Update 6/1/2017: Someone told me the kvm works for civ5. A quick search turned up this thread titled "GPU Passthrough with KVM: Have Your Cake and Eat it Too". The thread is too long to read, though hope it could be useful to somebody.