title: CloudCompare fails to launch with error: "QXcbConnection: Could not connect to display :0"
body: <p>In the last week, CloudCompare has suddenly stopped launching. When trying to launch via desktop icon, nothing happens. When trying to launch via commandline (e.g. <code>$ cloudcompare.CloudCompare</code>) nothing happens and I get the following error:</p>
  
  <pre><code>QXcbConnection: Could not connect to display :0
  Aborted (core dumped)
  </code></pre>
  
  <p>Trying to launch CloudCompare with <code>sudo</code>/as root user returns a slightly different error message:</p>
  
  <pre><code>mkdir: cannot create directory '/run/user/0': Permission denied
  QXcbConnection: Could not connect to display :0
  </code></pre>
  
  <p>Having looked around Github, here and various other forums, this seems to be a problem that people have encountered with other programs that use Qt and/or OpenGL (see <a href="https://stackoverflow.com/questions/39478208/qxcbconnection-could-not-connect-to-display-when-trying-to-debug-linux-app-wit">1</a>, <a href="https://stackoverflow.com/questions/17979185/qt-5-1-qapplication-without-display-qxcbconnection-could-not-connect-to-displ">2</a>, <a href="https://stackoverflow.com/questions/29924997/pyqt5-could-not-connect-to-display">3</a>). I also realise that this isn't really enough information to debug the problem, so if there is any other diagnostic info I can/should provide, let me know and I will add it.</p>
  
  <p><strong>EDIT:</strong> I can actually get CloudCompare working again by completely uninstalling it and then re-installing it. However that doesn't explain the original problem or how to solve it.</p>
  
  <h2>My Environment</h2>
  
  <ul>
  <li><strong>OS &amp; Version:</strong> Ubuntu 14.04 LTS</li>
  <li><strong>CC Version:</strong> v2.8.1 (latest)</li>
  <li><strong>Graphics card:</strong> Intel Haswell Mobile</li>
  <li><strong>Qt version:</strong> 5.2.1</li>
  </ul>