Important: Please read the Qt Code of Conduct -

Running Qtcreator as root on ubuntu 13.04

  • So I just installed Ubuntu 13.04 and being a developer, installed the QT SDK.

    The problem is when I try to run the program as root, for example:

    $ sudo qtcreator

    The terminal just hangs and the program, Qt creator does not start up. Is this a problem with QT 5 or is it some bug in ubuntu 13.04? Either ways, anyone come across this before? Any solutions?

    I have completely updated my ubuntu version and Qt sdk. Still cant run it as root.

  • Why would you like to run Qt creator as root in the first place? It is usually not recommended to run GUI programs as root.

  • Moderators

    Please do not do this! Running complex applications like creator as root is a really bad idea. It is not secure and you should not develop as a root user anyway since developing includes doing lots of risky things that may damage your system badly when doing them wrong as root!

    You can set up a "Remote" linux device in Tools>Options>Devices using localhost as the hostname and any username you can log in as using SSH. Then set up a kit using this device (copy the desktop one, replace device type and device).

    Now you can "remote"-deploy, run and debug your applications to the same machine using a different user.

  • Sorry for the late reply.

    The project that I am working on requires me to use the serial interface, namely RS 232 or RS 485.

    Since QT does not have a native library, I use Qextserialport library.
    The problem is, linux (Ubuntu 13.04) does not allow me to access the serial port unless I am running the program or the software as root.

    Does anyone have an idea as to how I can get Qextserialport to work without starting QT as root?

    I use to work on QT 4.8 before and had no problems running it as root.

  • Can I try to change the file permission of the serial port file. Say, for example, the name of the serial file in question is ttyUSB0. So, if I try this:

    $ sudo chmod 777 /dev/ttyUSB0

    Since I am changing the 'rwx' state of the file for access by others apart from 'root', will this approach work?

  • Lifetime Qt Champion


    IIRC, the usb serial devices belong to the dialout group, add your user to this group. It's the cleanest and securest way to access it.

Log in to reply