Results 1 to 6 of 6

Thread: Getting "cannot connect to xserver" with sudo

  1. #1
    oceanexplorer NNTP User

    Default Getting "cannot connect to xserver" with sudo

    Hi,

    when I open bash and enter the following:-

    sudo kwrite /etc/fstab

    I get the following error:

    kwrite: cannot connect to X server

    This happens for anything opened with sudo, does anyone perhaps know of what is wrong? This is a new installation of openSUSE 11.1

    Many thanks

    Paul

  2. #2
    Join Date
    Jul 2008
    Location
    Netherlands
    Posts
    1,139

    Default Re: Getting "cannot connect to xserver" with sudo

    Try the following command instead:
    kdesu kwrite /etc/fstab
    Special effects <- KDE 4.2 Showing off
    More KDE -> PINK KDE

  3. #3
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    25,196
    Blog Entries
    15

    Default Re: Getting "cannot connect to xserver" with sudo

    Quote Originally Posted by oceanexplorer
    Hi,

    when I open bash and enter the following:-

    sudo kwrite /etc/fstab

    I get the following error:

    kwrite: cannot connect to X server

    This happens for anything opened with sudo, does anyone perhaps know of
    what is wrong? This is a new installation of openSUSE 11.1

    Many thanks

    Paul
    Hi
    Try kdesu kwrite /etc/fstab. Maybe it's a good time to learn vi or
    vim

    --
    Cheers Malcolm (Linux Counter #276890)
    openSUSE 11.1 x86 Kernel 2.6.27.7-9-default
    up 18:31, 2 users, load average: 0.06, 0.09, 0.08
    GPU GeForce 6600 TE/6200 TE - Driver Version: 180.22


  4. #4
    oceanexplorer NNTP User

    Default Re: Getting "cannot connect to xserver" with sudo

    thanks that worked a treat

    I will take a look at vi and vim as well.

    Paul

  5. #5

    Default Re: Getting "cannot connect to xserver" with sudo

    I used to could use sudo but now I also have to use this kdesu. What could have changed in my system?

  6. #6
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    19,372
    Blog Entries
    1

    Default Re: Getting "cannot connect to xserver" with sudo

    I used to could use sudo but now I also have to use this kdesu. What could have changed in my system?
    That may have been the case a few versions of openSUSE ago, but not now. In general, for graphical KDE/QT applications (requiring root privileges), kdesu <name of app> is used.

    man kdesu

    Alternatively, you can do
    Code:
    su -
    then
    Code:
    kwrite
    Last edited by deano_ferrari; 25-Jul-2011 at 23:29. Reason: corrected mistakes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •