Results 1 to 5 of 5

Thread: sudo firefox throws GDK Backend Error

  1. #1

    Default sudo firefox throws GDK Backend Error

    I have been on it for the past couple of days and can't get my head around it.
    Why does OpenSuse throw error when firefox is tried to run with "sudo" privileges(just write "sudo firefox" in terminal).
    The error thrown is - "GDK- BACKEND ERROR. No displays found."
    I have changed the permission and checked the display drivers, gave root permission to user through "sudoers" file.
    Also checked the DISPLAY are same for "su" and user through "echo $DISPLAY" (both are 0)(Tried giving screen as well, DISPLAY = 0.0, still not working)
    Even uninstalled and installed firefox again(used yum and yas).

    Just to be sure, I have 2 different machines with opensuse and both give this error

    Can anyone suggest any solution.
    Thanks in advance

  2. #2

    Default Re: sudo firefox throws GDK Backend Error

    Quote Originally Posted by harshal9 View Post
    Why does OpenSuse throw error when firefox is tried to run with "sudo" privileges(just write "sudo firefox" in terminal).
    Because it just isn't possible to run graphical applications with sudo's default settings in openSUSE.
    For security reasons it filters out most user's environment variables e.g. the $DISPLAY.

    You should not run Firefox as root anyway, and I cannot even think of a reason why you'd want to.

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,394

    Default Re: sudo firefox throws GDK Backend Error

    [QUOTE=harshal9;2812320]just write "sudo firefox" in terminal/QUOTE]
    Apart from Wolfi323's technical explanation and his warning, I want to stress that doing this counts amongst the more stupid actions one can do. And while you can of course do to your system what you want, you should not expect that any of the members here ever did likewise and thus can advise you on such an action.
    Henk van Velden

  4. #4

    Default Re: sudo firefox throws GDK Backend Error

    Quote Originally Posted by wolfi323 View Post
    Because it just isn't possible to run graphical applications with sudo's default settings in openSUSE.
    For security reasons it filters out most user's environment variables e.g. the $DISPLAY.

    You should not run Firefox as root anyway, and I cannot even think of a reason why you'd want to.
    Thank you.
    Actually, the reason I have to open firefox with "sudo" is because it is triggered by a python program(this program needs to modify, create and delete some directories as well for which we need to give it "sudo" privileges )(this program runs on win and mac too so i cannot add sudo when modifying the file system).
    It works fine on Ubuntu and Mint OS so I was hoping that opensuse will not throw any problem.
    Is there any way to bypass the security measure and give $DISPLAY variable to sudo? That would help a lot.

    Please let me know if you need any other detail.

    Quote Originally Posted by hcvv View Post
    Apart from Wolfi323's technical explanation and his warning, I want to stress that doing this counts amongst the more stupid actions one can do. And while you can of course do to your system what you want, you should not expect that any of the members here ever did likewise and thus can advise you on such an action.
    Thankyou for your time.

  5. #5
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: sudo firefox throws GDK Backend Error

    if you really want to run firefox as root you need to do it with kdesu or gnomesu
    there is a way to edit sudo's configuration so you can run X applications with it but I've forgotten what it was it's here in the forums you can search for it, but kdesu Firefox will work fine
    just note that this will create files in /root/.firefox and that is not a good idea

Posting Permissions

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