It is common for IT companies (at least in Germany, automotive field) to use Ubuntu Linux LTS in a VirtualBox on Windows or Mac hosts. This way the employee can use Microsoft Outlook / Office, Microsoft Skype, Cisco Spark, or other proprietary collaboration tools, and at the same time use the supplied virtual machine for development.
By default VirtualBox doesn’t configure any 3D acceleration or multi-core CPU for the guest. One needs to change these settings in order to have a more responsive desktop environment and to compile faster Also important not to forget about the installation of the VirtualBox Guest Additions.
glxinfo on a Ubuntu Linux 16.04 LTS in VirtualBox 5.1.18 gives back this information:
As it turns out this is not enough to run Qt Creator 4.2.1. Qt Creator simply displays a black welcome screen on Ubuntu Linux 16.04 LTS, or simply crash on Ubuntu 14.04 / 12.04 LTS:
If Qt Creator is run from command line, it will give out these messages (Ubuntu 16.04 LTS):
If you do a web search after “Qt Creator VirtualBox crash” you will find out how to fix this problem – either disabling the welcome plug-in, or disable the 3D acceleration of your VirtualBox.
Disabling the 3D acceleration means that the system will use a software OpenGL driver.
But then again why not simply use a software OpenGL driver just for Qt Creator and not for the whole system?
Qt Creator ships on Windows with a software OpenGL driver you can find it under
Qt Creator’s bin directory and it’s named
opengl32sw.dll. If you rename the file
opengl32.dll you will force Qt Creator to use the software OpenGL driver.
What about Linux? Unfortunately Qt Creator doesn’t ship the equivalent OpenGL driver, so you will have to build it yourself, or download the precompiled binaries that I will provide at the end of the article.
If you look at Mesa 3D’s llvmpipe page you will see how easy it is to build the software driver:
- Install the prerequisites
sudo apt install g++ scons llvm-dev
- Get the source code
- And compile with
scons build=release libgl-xlib
This is true if you have all the prerequisites! If you don’t have them, then it’s a process of compile, break on error, install missing package, and then try again.
After a few attempts I’ve managed to have this build script:
Simply unpack with
tar xJf ubuntu...tar.gz -C ~/qtcreator-4.2.1/lib/qtcreator/ and
Qt Creator should pick the software OpenGL driver on the next start.
Ubuntu 12.04 is a bit dated and it requires a few workarounds in order to run Qt Creator 4.2.1
If you get the following error:
Simply delete the
libqgtk3.so file. Qt Creator will then start.
The next runtime error will be, displayed as the reason for not being able to load many plugins:
Which gets fixed by installing the following ppa and a reboot for good measure:
Software OpenGL Driver
You can use the Software OpenGL driver for other x86_64 programs, not only Qt Creator