# Running x11 app as root



## dcole (Aug 20, 2012)

Hello,

I am attempting to Run an x11 application as root and I can't seem to figure out exactly how to launch it. (The app is QtCreator)

I have tried to su to root, provide an Xauth cookie, and launch from there, similar to what this thread suggests:

http://www.debian-administration.org/articles/494

This doesnt seem to work though. Is there some setting I have to use? I am trying to use QtCreator to run code on the X11 server box and that code makes system calls which require root. Perhaps this is not possible over x11 and I will be forced to run a vnc server?

Thanks

Derek


----------



## wblock@ (Aug 21, 2012)

What error message does it show?

Why does the application need to run as root?  You may be chasing the wrong problem.


----------



## dcole (Aug 21, 2012)

I didn't get any error from trying to run qtcreator itself, but my code that I'm developing gave me an authorization error from  pcap when trying to change the mode of the interface   I had solved that issue before by running qtcreator as root when I was developing directly on that box.


----------



## tingo (Aug 24, 2012)

Doesn't adding the correct DISPLAY= in front of the program work?
Example: `# DISPLAY=:0.0 xcalc`
That is the way I do it when I have to run x11 apps as root.


----------



## kpedersen (Aug 24, 2012)

Or just use


```
$ su
```

rather than


```
$ su -l
```

To keep the users environment (including DISPLAY).


----------

