You are not logged in.
This is happening with multiple commands but here are some examples:
$ sudo gparted
Authorization required, but no authorization protocol specified
(gpartedbin:3754): Gtk-WARNING **: 17:52:38.185: cannot open display: :0
$ baobab
Authorization required, but no authorization protocol specified
(baobab:3793): Gtk-WARNING **: 17:53:54.993: cannot open display: :0
Even xclip doesn't work:
$ echo "hello arch forums" | xclip -sel clip
Authorization required, but no authorization protocol specified
Error: Can't open display: :0
I tried this but it doesn't seem to work
$ export DISPLAY'":0.0"
$ xhost +
Authorization required, but no authorization protocol specified
xhost: unable to open display ":0.0"
I haven't been able to find a solution online so if anyone has suggestions I'd really appreciate it.
Last edited by anthanor2 (2021-12-23 21:11:09)
Offline
How do you start X? Post any xinitrc or other startup file that's used.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks for the quick response.
I forgot to mention that I do have a graphical desktop running bspwm.
This is my xinitrc:
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
exec bspwm
sxhkd & > ~/.sxhkd.log 2>&1
In my /etc/X11/xinit/xinitrc.d there are two files.
/etc/X11/xinit/xinitrc.d/40-libcanberra-gtk-module.sh:
#!/bin/sh
case "${DESKTOP_SESSION-}" in
gnome*) # Done by gnome-settings-daemon
;;
*)
# Extra check in case DESKTOP_SESSION is not set correctly
if [ -z "${GNOME_DESKTOP_SESSION_ID-}" ]; then
GTK_MODULES="${GTK_MODULES:+$GTK_MODULES:}canberra-gtk-module"
export GTK_MODULES
fi
;;
esac
/etc/X11/xinit/xinitrc.d/50-systemd-user.sh:
systemctl --user import-environment DISPLAY XAUTHORITY
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment DISPLAY XAUTHORITY
fi
Offline
Are you trying to run these commands from another tty or another machine?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Output of
hostnamectl
?
Online
Here's the output of hostnamectl
Static hostname: n/a
Transient hostname: thinkpad
Icon name: computer-laptop
Chassis: laptop
Operating System: Arch Linux
Kernel: Linux 5.15.10-arch1-1
Architecture: x86-64
Hardware Vendor: Lenovo
Hardware Model: ThinkPad X260
Offline
Static hostname: n/a
Online
Sorry I didn't make it clear, I I have an X session running in tty1. I was able to initially launch two terminator windows in my ~/.config/bspwm/bspwmrc and am only able to launch firefox after rebooting some of the time. I have a graphical interface (I have a mouse icon and polybar up for example). I just cant open any new windows besides the three I currently have open (two terminals one firefox).
Offline
You don't have a static hostname so (likely) networkmanager gets you a transient one and the new hostname isn't in the
xauth list
Set a static hostname, the issue will be gone.
Then review the other parts of the installation guide you might have skipped.
Online
I figured it out just needed to run pacman -Syu! Marking this as solved. Thanks for your help!
Offline
No, that didn't solve anything.
Do you actually read replies?
Online
Just for the record:
You don't have a static hostname so (likely) networkmanager gets you a transient one and the new hostname isn't in the
xauth list
^ This is incorrect. The transient hostname is added to 'xauth list'. I can run gparted (in openbox) just fine with no /etc/hostname (yes, I did reboot after removing the file):
$ hostnamectl hostname --static
$ hostnamectl hostname --transient
archlinux
$ xauth list
archlinux/unix: MIT-MAGIC-COOKIE-1 413def54a75683b38dd43a9d96b2c27c
#ffff#617263686c696e7578#: MIT-MAGIC-COOKIE-1 413def54a75683b38dd43a9d96b2c27c
$ cat /etc/hostname
cat: /etc/hostname: No such file or directory
$
No idea what caused the problem though
Para todos todo, para nosotros nada
Offline
Using networkmanager?
It's absolutely possible to add the/any hostname but historically NM hasn't done this and it used to be the cause for losing access to the server and the symptom description of the OP fits that scenario perfectly.
Also, very important: if NM (or whatever) has and sets the transient hostname *before* X11 starts (check your log) this becomes irrelevant.
The problem isn't that the hostname is transient, it's that it changes against the X11 server.
Online
Using networkmanager?
No, just iwd:
$ find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f
btrfs-scrub@-.timer | timers.target.wants
ctrl-alt-del.target | system
dbus-org.freedesktop.resolve1.service | system
dbus-org.freedesktop.timesync1.service | system
default.target | system
dirmngr.socket | sockets.target.wants
display-manager.service | system
fstrim.timer | timers.target.wants
gcr-ssh-agent.socket | sockets.target.wants
getty@tty1.service | getty.target.wants
gpg-agent-browser.socket | sockets.target.wants
gpg-agent-extra.socket | sockets.target.wants
gpg-agent.socket | sockets.target.wants
gpg-agent-ssh.socket | sockets.target.wants
iwd.service | multi-user.target.wants
nftables.service | multi-user.target.wants
p11-kit-server.socket | sockets.target.wants
pipewire-pulse.socket | sockets.target.wants
pipewire-session-manager.service | user
pipewire.socket | sockets.target.wants
systemd-resolved.service | multi-user.target.wants
systemd-timesyncd.service | sysinit.target.wants
wireplumber.service | pipewire.service.wants
xdg-user-dirs-update.service | default.target.wants
$
Para todos todo, para nosotros nada
Offline
seth wrote:Using networkmanager?
No, just iwd:
OP using gnome -desktop from the looks of logs... so i see why nm needs be relevant to the sitch in context
Offline
You only have the transient hostname and "archlinux" is probably even system provided and never changed at all.
https://man.archlinux.org/man/extra/net … IN_SECTION suggests that
hostname-mode
Set the management mode of the hostname. This parameter will affect only the transient hostname. If a valid static hostname is set, NetworkManager will skip the update of the hostname despite the value of this option. An hostname empty or equal to 'localhost', 'localhost6', 'localhost.localdomain' or 'localhost6.localdomain' is considered invalid.
default: NetworkManager will update the hostname with the one provided via DHCP or reverse DNS lookup of the IP address on the connection with the default route or on any connection with the property hostname.only-from-default set to 'false'. Connections are considered in order of increasing value of the hostname.priority property. In case multiple connections have the same priority, connections activated earlier are considered first. If no hostname can be determined in such way, the hostname will be updated to the last one set outside NetworkManager or to 'localhost.localdomain'.dhcp: this is similar to 'default', with the difference that after trying to get the DHCP hostname, reverse DNS lookup is not done. Note that selecting this option is equivalent to setting the property 'hostname.from-dns-lookup' to 'false' globally for all connections in NetworkManager.conf.
none: NetworkManager will not manage the transient hostname and will never set it.
it still does that.
Online
Tried again with just NM running (disabled both iwd & systemd-resolved) and I can still run gparted without a static hostname set. The transient hostname is still "archlinux" even though the IP addresses haven't changed and the router identifies the machine as "archie".
From the NM logs:
hostname: hostname: using hostnamed
So it looks like it's deferring to systemd.
Anyway this is going nowhere fast now that the OP has checked out so I'll stop making noise now.
Para todos todo, para nosotros nada
Offline
Hi, I Know this is from a while ago, but I wanted to apologize for my ignorance and dismissal. I had a family emergency that drew me away from my personal life for a while which caused me to complete forget about this thread. You all spend your free time helping less informed noobs like me for which I and many many others are very appreciative. I want to say that I am sorry and it wont happen again. Trillby was completely correct and I never set a hostname. I have fixed this and this won't repeat itself. Thanks again for everything you guys do.
Offline