cannot connect to X server, in the konsole terminal as root
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
cannot connect to X server, in the konsole terminal as root
I get this; "cannot connect to X server", when in the konsole terminal as root user attempting to edit my xorg.conf file. So with; su -l, to get as the root, I then typed in; "kwrite /etc/X11/xorg.conf" to open this file to edit it for display resolution, but it would only give that error. So in Slackware 12.1 with KDE 3.5.9, and logged in as a regular user in the GUI run level, what text editor do I use, and how to make it able to connect to X server with a terminal as root? (su, or su -, or su -l, or this; su -c)? Thanks for help.
Or, even better, when you open the file in your KDE application (Kate,Kwrite,Knotes,Quanta,Kedit,Kwhatever), type this in your location bar:
fish://root@localhost/
It will ask for your root password, and you can the proceed to edit the file. If it takes a while to edit, your password cache will have flushed, and you will have to retype it.
Very handy because it doesn't leave you with a program running with root privileges.
Last edited by x_terminat_or_3; 11-21-2008 at 04:33 PM.
Reason: Spelling again must be my old(!) age
Or use the CLI editors in a terminal like vi, nano, pico, joe, mcedit, ...
It would also be better to use `kdesu ...` as suggested by brianL instead of doing anything with xhost...there are possible security implications with xhost. kdesu at least only allows root access to that one specific X program and not the whole X server (and it only allows access for root and not every other user on the system in the case of multiuser systems).
Thanks for all the help. I just logged into Slackware as root user, then I did the edit to my xorg.conf file, then I re-booted back in as standard user to make the display settings changes with the; NVIDIA X Server Settings tool, and saved to xorg.conf, and ran as root; nvidia-xconfig just to be sure. Then in the KDE display configuration I selected that box for the; "apply settings on KDE startup" option, which now does keep my 17" LCD at a native 1280 x 1024 resolution when I do a re-boot. So then the other Linux major distros work different than Slackware does for editing a system file as root user with a terminal, because I have used in the others; su -l , and it did work to edit my boot grub menu.lst file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.