LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can not load gparted without typing xhost + first. (https://www.linuxquestions.org/questions/linux-software-2/can-not-load-gparted-without-typing-xhost-first-4175645368/)

sdowney717 01-02-2019 03:32 AM

Can not load gparted without typing xhost + first.
 
Code:

scott@scott-MS-7596:~$ sudo gparted
[sudo] password for scott:
Unit tmp.mount does not exist, proceeding anyway.
No protocol specified

(gpartedbin:4338): Gtk-WARNING **: 04:26:40.215: cannot open display: :0
scott@scott-MS-7596:~$ xhost +
access control disabled, clients can connect from any host
scott@scott-MS-7596:~$ sudo gparted
Unit tmp.mount does not exist, proceeding anyway.
======================
libparted : 3.2
======================

I just installed ubuntu 18.10 and now any program that is run as root user will say cant open display. So how can I fix this?

berndbausch 01-02-2019 04:36 AM

For example: https://askubuntu.com/questions/1756...-app-with-sudo

Many other search results.

sdowney717 01-02-2019 10:53 AM

I modified the file, but does it need a reboot to take effect cause it still wont open properly unless I use xhost +

I added this to that file using visudo
Defaults env_keep="XAUTHORITY"

AND WHY does Ubuntu ship this way? Is it deliberate? Or an error on their part.

https://bbs.archlinux.org/viewtopic.php?id=199880

pan64 01-02-2019 11:16 AM

this is not related to ubuntu at all. It is how the X server works. Only the user who logged in is allowed to use. Obviously it is you, as regular user and not the root user. If you wish to allow the "other" user to access the GUI you need to specify it (this is the variable DISPLAY) and also you need to authenticate it (XAUTHORITY).

sdowney717 01-02-2019 11:35 AM

I do many fresh installs of Ubuntu and mint continue to upgrade the os over many years and this has not happened before!
Obviously something changed.


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