After my upgrade from Debian testing/unstable to Debian GNU/Linux wheezy/sid I started experiencing an annoying message after each user login saying:
Cannot open display "default display"
After a bit of investigation online I’ve figured out that the possible causes for the message Cannot open display “default display” are definitions in either /etc/profile, /home/myuserdir/.profile or /home/myuserdir/.bashrc .
According to some people suggestions online in some of the above mentioned files I was about to look for some commands which are related to deal with the X server.
After checking up the suggested files, I’ve found in my .bashrc some old xsetkbmap commands set in order to enable my CTRL+ALT+BACKSPACE to work in X.
I remember some long time ago I’ve played with the xsetkbmap tool in order to enable my X kill with the magic buttons to work as expected with the well known button combination ctrl + alt + backspace.
The exact code which was causing me the error/warning message Cannot open display “default display” was:
setxkbmap -option terminate:ctrl_alt_bksp
Using the commands:
noah:/home/hipo# which setxkbmap
/usr/bin/setxkbmap
noah:/home/hipo# dpkg -S /usr/bin/setxkbmap
x11-xkb-utils: /usr/bin/setxkbmap
noah:/home/hipo#
I’ve found out the setxkbmap is part of the x11-xkb-utils debian package. As I suspected something might be wrong with this package I gave a try to reinstall the package using the command as shown below:
noah:/home/hipo# apt-get install --reinstall x11-xkb-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reinstallation of x11-xkb-utils is not possible, it cannot be downloaded.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
noah:/home/hipo#
However as it could be seen in the above output it is impossible to reinstall the x11-xkb-utils package probably either because the package name is changed in Debian wheezy/sid or because the package is missing from my debian sources repository.
Next I loged in my gnome in X and tried the magic buttons CTRL+ALT+BACKSPACE and they seem to work even without the setxkbmap below definitions which means I no longer needed the setxkbmap -option terminate:ctrl_alt_bksp definitions in my ~/.bashrc thus I completely scraped out the command from my .bashrc and the annoying message is now finally! gone, thanks God.
I’ve found
More helpful Articles
Tags: Solving (Getting Rid of) - Cannot open display "default display" after user login on Debian Squeeze
Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.160 Safari/537.22
Thank you.
View CommentView CommentMozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0
This does not solve anyones problem. Ofc I can remove the line in .bashrc, but there is a reason I initially created that line.
You should remove “Soliving” And state at the start that you only deleted the line.
View CommentView CommentMozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Thank you! This helped me diagnose why I couldn't connect to my x2goserver session. For some reason, disabling capslock with setxkb map in my .bash_profile was the problem.
View CommentView CommentMozilla/5.0 (Linux; Android 9; ONEPLUS A5010) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36
The reason why this happens is bashrc commands are suppose to work even on console. You are trying to add commands to console that doesn’t work inside console
View CommentView CommentThus cannot open “default desktop”. Just put the command where it belongs for example .xinitrc setxkbmap xx. Then it loads the command when X11 starts.