LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-02-2005, 01:00 AM   #1
roxxe1
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Rep: Reputation: 0
can't start program from shell


why cant i do this no more?

Code:
root@1[~]# synaptic

(synaptic:11973): Gtk-WARNING **: cannot open display:
actually all programs i run in shell give that
is there a way to fix it?
 
Old 04-02-2005, 01:18 AM   #2
hallamigo
Member
 
Registered: Feb 2004
Location: Utah, USA
Distribution: Debian
Posts: 230

Rep: Reputation: 31
Looks like you are trying to run the program as root. Did you log into Xwindows as root? If not (you got to root via 'su') then by default root (su) cannot run Xwindows inferfaces (Gtk or Qt). I'm not sure how to allow root (su) to do so while logged in with a user account but if you need to run it as root then I'd suggest restarting Xwindows as root (assuming the answer to my initial question is no).
 
Old 04-02-2005, 01:29 AM   #3
roxxe1
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Original Poster
Rep: Reputation: 0
weird
when i'm logged in as a normal user, and i type "synaptic", the shell says i should be logged in as superuser :s

and if i log as root, it wont open :s
 
Old 04-02-2005, 01:32 AM   #4
hallamigo
Member
 
Registered: Feb 2004
Location: Utah, USA
Distribution: Debian
Posts: 230

Rep: Reputation: 31
So when you log into Kde/Gnome (or whatever your GUI is) as root (not using 'su') it still won't let you open it? If so, that's the error it throws? What is your distro and what windows/desktop manager are you using?
 
Old 04-02-2005, 01:34 AM   #5
mike33
Member
 
Registered: Jul 2004
Location: Houston Tx
Distribution: kubuntu, Debian, Suse 10.2
Posts: 31

Rep: Reputation: 15
as an ordinary user type the command:
xhost +
Then root will be able to open windows in X.
 
Old 04-02-2005, 02:24 AM   #6
roxxe1
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by hallamigo
So when you log into Kde/Gnome (or whatever your GUI is) as root (not using 'su') it still won't let you open it? If so, that's the error it throws? What is your distro and what windows/desktop manager are you using?
it wont, you can see the error above, i'm using simple mepis (debian), using kde

Quote:
xhost +
thanx it works, but do i have to type that everytime?, if not how can i make my system do it everytime i login?
 
Old 04-02-2005, 02:33 AM   #7
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: Ubuntu, FreeBSD, NetBSD
Posts: 1,449

Rep: Reputation: 47
Quote:
Originally posted by mike33
as an ordinary user type the command:
xhost +
Then root will be able to open windows in X.
xhost + does work but is terribly insecure. It allows any computer to control your X display remotely. It is wiser to use
Code:
xhost +127.0.0.1
which will just allow access from the local machine. It assumes that anyone running a command while logged into the machine should have permission to access the display. This is a fairly reasonable assumption for a home machine.

You don't need to do this all the time (just if you want to run a program as a different user and if you have restarted the window system since the last time you ran it). If you want to make it permanent (and you probably do) just edit your
startup files (~/.xsession & ~/.xinitrc) and add that line before the last line in the file.
 
Old 04-02-2005, 07:01 AM   #8
roxxe1
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Original Poster
Rep: Reputation: 0
uhm, noobie question, where is my xinitrc located?
tried searching for it with konqueror, but no result
my xession was located in my /etc/x11
 
Old 04-02-2005, 08:12 AM   #9
AxeZ
Member
 
Registered: Sep 2002
Location: Novi Sad, Vojvodina
Distribution: Slackware, FreeBSD
Posts: 386

Rep: Reputation: 32
Quote:
Originally posted by roxxe1
uhm, noobie question, where is my xinitrc located?
tried searching for it with konqueror, but no result
my xession was located in my /etc/x11
~/.xinitrc

~ means it is in the root of your home directory, something like /home/roxxe1/.xinitrc
 
Old 04-02-2005, 10:52 PM   #10
pAn1k
Member
 
Registered: Jun 2004
Location: Cala city
Distribution: Suse 10.0; Debian 5.0 (Lenny) Fluxbox
Posts: 240

Rep: Reputation: 30
A good solution might be to type in kdesu <command> it should run properly.
 
Old 04-24-2005, 03:41 PM   #11
roxxe1
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Original Poster
Rep: Reputation: 0
is kdesu the same as gnomesu?
 
Old 04-24-2005, 07:58 PM   #12
pAn1k
Member
 
Registered: Jun 2004
Location: Cala city
Distribution: Suse 10.0; Debian 5.0 (Lenny) Fluxbox
Posts: 240

Rep: Reputation: 30
uhhmm... probably. I don't use gnome, but I'm sure it is.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I automatically start a program at start up? victordh Linux - General 7 10-27-2013 06:02 AM
SHell program in c SatYr_84 Linux - Software 1 10-03-2005 05:49 PM
HELP!! I need to program a shell pleowulf Programming 2 02-11-2005 01:12 PM
Shell Program Veteq Programming 12 08-18-2004 07:20 AM
Shell program error, can anyone see it? hamster Programming 2 04-16-2003 03:10 PM


All times are GMT -5. The time now is 03:39 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration