The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation


How to Fix the “OpenGL” Problem when Running Dropbox as a Windows Service

What’s the problem with Dropbox?

As we wrote about last week, Dropbox version 81.4.195 often fails to run as a background Windows Service. The telltale sign that Dropbox is in trouble is this wordy alert, which appears in Session 0:

Dropbox OpenGL Error

Dropbox stops dead in its tracks — without synchronizing a single file!

So how do I fix it?

Follow these steps to fix the problem:

  1. Start a Windows command prompt as an Administrator (an elevated command prompt)

  2. Run this command:

    SETX QT_OPENGL software

    SETX QT_OPENGL software
  3. Close the command prompt.

Afterwards, restart Dropbox as a service. The OpenGL prompt should be gone — a relic of an unpleasant past.

Huge thanks go to Dropbox forum user Wilson7777, who alerted the community of this remedy. His original solution is here.

Why does the fix work?

The explanation is a bit technical, but here goes…

Dropbox uses Qt — a popular cross-platform development framework.

In turn, Qt requires OpenGL — a cross-platform API for rendering 2D and 3D vector graphics.

So when you run Dropbox, both Qt and OpenGL will be started.

But for some unknown reason, when Dropbox is started as a Windows Service in Session 0, Qt and OpenGL fail to initialize. That failure causes Dropbox to throw up the “Failed to create OpenGL context for format QSurfaceFormat” error, which suggests that there is a problem with the computer’s graphics card/hardware.

Fortunately there is a way to instruct Qt: “Instead of using the computer’s graphics hardware for OpenGL, use software libraries”. Setting the QT_OPENGL environment variable to “software” is the way to do that.

And with the change to use software instead of hardware, Qt, OpenGL and Dropbox all start properly.

Note that when you ran the SETX command in step 2, it added the QT_OPENGL value to your environment. You can see it listed in your environment variables (available from the Control Panel):

QT_OPENGL environment variable

Will this fix work for future versions of Dropbox?

We certainly hope so! But like you, we’re not sure what magic the next automatic update of Dropbox will bring…

Posted in Dropbox | Tagged , , , , , | 17 Comments

17 Responses to How to Fix the “OpenGL” Problem when Running Dropbox as a Windows Service

  1. Dan Richardson says:

    This works, for selected definitions of “fix”. The error message is gone. However, the Dropbox window doesn’t open. No status, no recents, no settings. Running the Dropbox app gets me a big empty white window.

    How do I reverse it? After the error message Dropbox at least sort of worked.

  2. Core Technologies Consulting says:

    Hi Dan. Glad to hear that the fix got you past the OpenGL error!

    However no longer seeing the Dropbox window (or its tray icon) is completely normal because Dropbox is running in the background in “Session 0” — an isolated desktop for Windows Services.

    You can read about Session 0 on our web site or in the step-by-step tutorial showing how to run Dropbox as a Windows Service with AlwaysUp.

  3. Dan Richardson says:

    Today the error is back, and Dropbox is crashing and restarting, over and over.

    I don’t use AlwaysUp. I’m here from DropBox’s useless support forum, where they are linking your fix as a solution to their problem.

    Deleting the environment variable successfully restored some functionality.

  4. Jeanne says:

    I tried this fix and it didn’t work. When I opened Dropbox again, I got the error and the program crashed. 🙁

  5. Core Technologies Consulting says:

    Sorry to hear that Jeanne!

    What version of Dropbox are you running? And are you running Dropbox as a windows service with AlwaysUp?

  6. Andy says:

    Hi how do you reverse the “ SETX QT_OPENGL software” should this command not work?

    Thanks

    Andy

  7. Core Technologies Consulting says:

    Hi Andy.

    To reverse the SETX command, you can either:

    1. Manually remove the entry from the environment variables in the Control Panel (see the screenshot above), or
    2. Run this Powershell command:
      [Environment]::SetEnvironmentVariable( "QT_OPENGL", $null, "User" )

    Please let us know if the QT_OPENGL fix doesn’t work for you.

  8. Karolina says:

    If this dropbox error window shows, does it mean that there is something wrong with my computer’s graphics card/hardware? and I should get it checked as well?

  9. Core Technologies Consulting says:

    Hi Karolina.

    Do you see the window when you run Dropbox normally on your desktop, without AlwaysUp?

    If so, then you may indeed have a problem with your graphics system that needs attention.

    Please ensure that you have all Windows updates applied — especially those related to your graphics devices.

  10. Pascal CHARDONNET says:

    Dropbox 96.3.159, Problem fixed, thanks

  11. Ronnie H. Edwin says:

    I downloaded the newest version of DisplayLink, problem solved.
    https://www.displaylink.com/downloads/windows

  12. Leo C says:

    I also use DisplayLink, and concur that the upgrade to M9.3 appears to have fixed the problem.
    Dropbox upgrade did not solve the issue for me.

  13. pavlik says:

    totally works for me!
    was getting desperate after re-installing the graphics drivers didn’t help…
    thanks a lot!

  14. John says:

    You”re the man! Thanks!

  15. Joel LaRusic says:

    On version 106 I tried the first fix (SETX QT_OPENGL software) and it did not work. Following the thread, I then tried the DisplayLink software as this PC was a Surface with a docking station. It did not work but then I removed the SETX QT_OPENGL variable and then it worked fine. So maybe just the DisplayLink by itself would have worked. Thanks for keeping this thread… it ranked high in Google and eventually fixed the issue!

  16. Thanks Joel, glad to hear that Dropbox is now working for you.

    Please note that Dropbox version 105 introduced a new problem that was resolved by a variant of the SETX fix. Details in this article.

  17. Raf says:

    DisplayLink USB Graphics worked for me Dropbox 149.4.4568 not the SETX QT_OPENGL software.

Leave a Reply

Your email address will not be published. Required fields are marked *