You are not logged in.

#1 2010-09-25 09:43:16

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 637

[SOLVED] Problem with running GUI apps as root

Hi,

I have a serious problem with running any kind of software having GUI as root, which is indispensable for editing system files. For example I want to edit /etc/pacman.conf file with KWrite, and here's what I get

[zbyszek@barca ~]$ xhost +
access control disabled, clients can connect from any host
[root@barca zbyszek]# kwrite /etc/pacman.conf
kwrite(11282): Session bus not found

KCrash: Application 'kwrite' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/root/.kde4/socket-barca/kdeinit4__0
Warning: connect() failed: : Nie ma takiego pliku ani katalogu
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi directly
drkonqi(11284): Session bus not found

Can anyone help me with this? Can anyone tell me how to login as root?

Thank you in advance.

Last edited by Zibi1981 (2010-10-05 19:30:20)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#2 2010-09-25 09:45:10

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED] Problem with running GUI apps as root

What's wrong with nano, pico, vim?

Don't tell me you really need a GUI to edit a few system files, being an Arch user...


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2010-09-25 09:55:18

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 637

Re: [SOLVED] Problem with running GUI apps as root

Well, I'd prefer KWrite, it's far more convenient. Linux is all about choosing the software you prefer, doesn't it? I used to use Vim, but now it seems more complicated. For example when I open a file and press i or INSERT vim does not go to "edit mode". Strange, but whatever, as I have always preferred KWrite, which is my favourite application for editing system files.
So how to run KWrite as root and how to login as root? Can someone explain that to me?


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#4 2010-09-25 09:59:22

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Problem with running GUI apps as root

Try running 'xhost +' as root.
https://bbs.archlinux.org/viewtopic.php?pid=817674

Maybe vim is in edit mode when you press 'i' but it doesn't show '-- INSERT --' at the bottom of the screen.

Last edited by karol (2010-09-25 10:02:29)

Offline

#5 2010-09-25 10:08:00

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] Problem with running GUI apps as root

karol wrote:

Maybe vim is in edit mode when you press 'i' but it doesn't show '-- INSERT --' at the bottom of the screen.

That's how classical vi works and not how vim works. I can only guess Zibi1981's vim stuff is corrupt.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#6 2010-09-25 10:11:02

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Problem with running GUI apps as root

fsckd wrote:
karol wrote:

Maybe vim is in edit mode when you press 'i' but it doesn't show '-- INSERT --' at the bottom of the screen.

That's how classical vi works and not how vim works. I can only guess Zibi1981's vim stuff is corrupt.

Put 'set noshowmode' in your .vimrc and try it yourself.

Offline

#7 2010-09-25 10:13:02

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] Problem with running GUI apps as root

I stand corrected. smile


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#8 2010-09-25 10:18:05

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 637

Re: [SOLVED] Problem with running GUI apps as root

O.K., but how to run KWrite as root on my account??? That was my main question wink

karol wrote:

Try running 'xhost +' as root.
https://bbs.archlinux.org/viewtopic.php?pid=817674

Maybe vim is in edit mode when you press 'i' but it doesn't show '-- INSERT --' at the bottom of the screen.

Here you are

[root@barca zbyszek]# xhost +
access control disabled, clients can connect from any host
[root@barca zbyszek]# kwrite /etc/pacman.conf
kwrite(12941): Session bus not found 

KCrash: Application 'kwrite' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/root/.kde4/socket-barca/kdeinit4__0
Warning: connect() failed: : Nie ma takiego pliku ani katalogu
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi directly
drkonqi(12942): Session bus not found 

Last edited by Zibi1981 (2010-09-25 10:19:50)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#9 2010-09-25 10:20:34

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Problem with running GUI apps as root

Zibi1981 wrote:

O.K., but how to run KWrite as root on my account??? That was my main question wink

You run either as root or as a user. You can sudo to get more privileges as a user, if that's what you're asking.

Offline

#10 2010-09-25 10:23:20

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 637

Re: [SOLVED] Problem with running GUI apps as root

What I want is:
1. login as a normal user to my account, as I am right now in fact
2. open terminal
3. change to root account in the terminal
4. and finally run KWrite from there
The command xhost + used to do the job before, but now it doesn't work any more.


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#11 2010-09-25 10:25:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Problem with running GUI apps as root

Zibi1981 wrote:

The command xhost + used to do the job before, but now it doesn't work any more.

Maybe https://bbs.archlinux.org/viewtopic.php … 52#p817752

Offline

#12 2010-09-25 16:35:53

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] Problem with running GUI apps as root

When using KDE logging in as root is possible if you make a change in kdmrc.

The file to change is in..... /usr/share/config/kdm/kdmrc...

Scroll down to ...Allow login as root=

Enter : Allow log-in as root=true....

This will provide a log-in as root with a root password.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#13 2010-09-25 16:47:12

ichbinesderelch
Member
Registered: 2008-01-17
Posts: 203

Re: [SOLVED] Problem with running GUI apps as root

i suppose you are running kde, you can open gui programs with sudo when using "kdesu" command instead of the "sudo" command.

Last edited by ichbinesderelch (2010-09-25 16:47:43)

Offline

#14 2010-09-25 16:51:26

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [SOLVED] Problem with running GUI apps as root

How do you become root in the terminal, by "su -" or "su"?

If you used "su -" you changed the environment to the root user's one. This may cause the problems you encounter (at least it does so here). I haven't used "xhost +" since years so I cannot tell whether its behaviour has changed lately. But I usually become root by the "su" only command in case I have to run a command as root from the terminal in my current user's environment.

I cannot test this with kwrite currently as I do not have kde installed. But similar actions worked earlier all the years before.

Last edited by bernarcher (2010-09-25 16:52:46)


To know or not to know ...
... the questions remain forever.

Offline

#15 2010-09-25 16:52:14

SteveK
Member
Registered: 2010-06-11
Posts: 80

Re: [SOLVED] Problem with running GUI apps as root

Often GUI apps won't run as root in KDE unless you prefix it with dbus-launch.

Try running:

root@barca zbyszek]# dbus-launch kwrite /etc/pacman.conf

Last edited by SteveK (2010-09-25 16:55:18)

Offline

#16 2010-10-04 19:46:10

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 637

Re: [SOLVED] Problem with running GUI apps as root

I still cannot run KWrite as root in terminal, when being logged as a normal user sad

[zbyszek@barca ~]$ xhost +
bash: xhost: nie znaleziono polecenia
[zbyszek@barca ~]$ su
Hasło: 
[root@barca zbyszek]# dbus-launch kwrite /etc/pacman.conf
No protocol specified
No protocol specified
kwrite: cannot connect to X server :0.0

"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#17 2010-10-04 20:06:31

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: [SOLVED] Problem with running GUI apps as root

Zibi1981 wrote:

I still cannot run KWrite as root in terminal, when being logged as a normal user sad

[zbyszek@barca ~]$ xhost +
bash: xhost: nie znaleziono polecenia
[zbyszek@barca ~]$ su
Hasło: 
[root@barca zbyszek]# dbus-launch kwrite /etc/pacman.conf
No protocol specified
No protocol specified
kwrite: cannot connect to X server :0.0

Don't use root.

Did you read the link karol gave you? That should have solved your sudo X errors...

EDIT: By the way, that statement is self-contradicting. Unless you meant from a normal user's X session. wink

Last edited by cesura (2010-10-04 20:09:03)

Offline

#18 2010-10-04 20:08:40

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,543

Re: [SOLVED] Problem with running GUI apps as root

kdesu kwrite /etc/pacman.conf

Last edited by skunktrader (2010-10-04 20:10:18)

Offline

#19 2010-10-04 20:10:56

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 637

Re: [SOLVED] Problem with running GUI apps as root

Yes, I have read it, but it doesn't help me at all, as I don't have /etc/sudoers in my system.

skunktrader wrote:
kdesu kwrite /etc/pacman.conf

Finally! Briefly and to the point. Thank you very much skunktrader big_smile

Last edited by Zibi1981 (2010-10-04 20:15:39)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#20 2010-10-04 20:15:00

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: [SOLVED] Problem with running GUI apps as root

Zibi1981 wrote:

Yes, I have read it, but it doesn't help me at all, as I don't have /etc/sudoers in my system.

Wha? yikes
I thought you have sudo installed?

Offline

#21 2010-10-04 20:17:11

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: [SOLVED] Problem with running GUI apps as root

Zibi1981 wrote:

Finally! Briefly and to the point. Thank you very much skunktrader big_smile

ichbinesderelch wrote:

i suppose you are running kde, you can open gui programs with sudo when using "kdesu" command instead of the "sudo" command.

Offline

#22 2010-10-05 19:29:54

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 637

Re: [SOLVED] Problem with running GUI apps as root

Yea, sorry, must have missed that...
Problem solved.


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#23 2010-10-05 20:50:26

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,772

Re: [SOLVED] Problem with running GUI apps as root

Zibi1981 wrote:

... running any kind of software having GUI as root...

<Shudder>Yikes</Shudder>


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#24 2010-10-05 21:32:03

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: [SOLVED] Problem with running GUI apps as root

Zibi1981 wrote:

Yea, sorry, must have missed that...
Problem solved.

Nah, it's fine. smile
Hope I didn't come off as an ass or something.

Offline

#25 2010-10-05 22:16:30

Texas
Member
From: Dallas, Texas
Registered: 2010-09-10
Posts: 131

Re: [SOLVED] Problem with running GUI apps as root

Save yourself much grief... never login as root, use sudo.  I say this from personal experience early in my Linux 'life'.

Offline

Board footer

Powered by FluxBB