LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices



Reply
 
Search this Thread
Old 08-30-2009, 09:49 AM   #1
TsanChung
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Rep: Reputation: 0
"E233: cannot open display" when starting gvim on ubuntu 8.04 root shell


"sudo gvim" is ok on a non-root shell.
$ sudo gvim /etc/fstab
[sudo] password for ts:

However, "E233: cannot open display" error appears when starting gvim on ubuntu 8.04root shell.
# gvim /etc/fstab
E233: cannot open display
Press ENTER or type command to continue
# kdesudo gvim /etc/fstab
kdesudo: cannot connect to X server

Last edited by TsanChung; 08-30-2009 at 04:53 PM.
 
Old 08-30-2009, 11:40 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Use gtksu gvim /etc/fstab or, if running KDE kdesu ....
 
Old 08-31-2009, 08:36 AM   #3
TsanChung
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tredegar View Post
Use gtksu gvim /etc/fstab or, if running KDE kdesu ....
# kdesu gvim x
kdesu: cannot connect to X server
 
Old 08-31-2009, 09:24 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
# kdesu gvim x
kdesu: cannot connect to X server
No, you cannot use kdesu (are you running KDE or Gnome?) like this.
You need to be running as a regular user, then for KDE:
Code:
tred@vaio:~$ kdesu kate x
or for gnome:
Code:
tred@vaio:~$ gtksu kate x
If you are in a "real" terminal like <CTRL><ALT><F1-6> (and not a terminal window in your GUI) then neither method will work for you.
 
Old 09-08-2009, 10:10 AM   #5
TsanChung
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Original Poster
Rep: Reputation: 0
The problem is solved by
$ sudo cp $HOME/.Xauthority /root/.Xauthority
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I "cat" or "grep" a file to ignore lines starting with "#" ??? callagga Linux - Newbie 7 08-16-2013 07:58 AM
Problem starting gui, "$DISPLAY is not set or cannot connect to the x server" GlennsPref Mandriva 14 02-28-2009 07:15 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
when starting linux "cannot open root device" coalchamber361 Linux - Newbie 2 01-29-2006 10:43 AM
Starting Java from shell script (Exception in thread "main") rolf_mueller Linux - Software 5 10-30-2004 03:11 AM


All times are GMT -5. The time now is 05:57 AM.

Main Menu
Advertisement
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