title: QXcbConnection: Could not connect to display, when trying to debug Linux app with Qt Creator
body: <p>I am trying to port a set of Windows applications that were built with Qt Creator to Linux. I have installed Qt Creator 4.0.2 based on Qt 5.7.0 in a 64-bit Ubuntu 16.04 virtual machine using VirtualBox. The host PC is 64-bit Windows 7 Professional.</p>
  
  <p>I have successfully built one of the application projects and I am now trying to debug it. If I try to start debugging with F5, Qt insists on trying to compile one of the projects that does not yet compile so I am using "Start and Debug External Application...".</p>
  
  <p>The application immediately crashes in main() at the line:</p>
  
  <pre><code>QApplication app(argc, argv);
  </code></pre>
  
  <p>with the error: QXcbConnection: Could not connect to display.</p>
  
  <p>If I run the executable from a terminal window, the UI is displayed and the application functions normally.</p>
  
  <p>What do I need to do to be able to debug a UI application with Qt.</p>