Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Running Qtcreator as root on ubuntu 13.04
QtWS25 Last Chance

Running Qtcreator as root on ubuntu 13.04

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 4 Posters 11.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vinit320
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • JohanSoloJ Offline
      JohanSoloJ Offline
      JohanSolo
      wrote on last edited by
      #2

      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.

      `They did not know it was impossible, so they did it.'
      -- Mark Twain

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vinit320
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vinit320
            wrote on last edited by
            #5

            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?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved