You are not logged in.

#1 2013-07-02 22:30:25

shadeless
Member
Registered: 2013-05-26
Posts: 83

[Solved] Error: cannot open display :0 after connecting to ethernet

Hi guys,
I connect to the ethernet using dhcpcd "blah". When I try to open an x application (e.g. firefox or gvim), I get the following error:
No protocol specified
No protocol specified
Error: cannot open display :0

I have to log out of xorg and then log back in and then everything is fine again.

Can someone help me debug this problem?

Thank you smile

Last edited by shadeless (2013-07-14 00:23:54)

Offline

#2 2013-07-02 22:36:42

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

How do you start X? What are you running, a DE or WM? What is in your xorg.log?

Why do you think the two issues are related?

Please read How To Ask Questions The Smart Way.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-07-02 23:01:01

shadeless
Member
Registered: 2013-05-26
Posts: 83

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

Here is my xorg log. I don't think it has anything useful for this partilar problem though.
https://docs.google.com/document/d/1BLk … sp=sharing

I am using Awesome WM. I start X using the startx command. My .xinitrc file has the

exec awesome 

However, if I remove my .xinit file, then when I do startx, it gives me one large terminal, 2 smaller ones, and an xclock. Whatever environment it is, it's definitely not Awesome WM. I then try to connect to the ethernet using dhcpcd and get the same error when I try to run firefox. Logging out and back into the environment solves the problem. The problem isn't there when I connect to the ethernet on the console and then do startx.

Also the error specifies that it can't open display. That's why I think it's a problem with X.

Offline

#4 2013-07-03 00:31:58

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

Why are you starting dhcpcd manually instead of using the dhcpcd service: https://wiki.archlinux.org/index.php/Dh … CP_at_boot ?

Are you using an xorg.conf file?

Last edited by 2ManyDogs (2013-07-03 00:34:50)


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#5 2013-07-03 00:43:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

You wouldn't happen to 'su' to get a root terminal to run dhcpcd would you?  If so, do you exit that session before trying to run other programs?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2013-07-03 00:51:17

shadeless
Member
Registered: 2013-05-26
Posts: 83

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

I'm using sudo, not su.

I had the same problem when I had the service working.

I'm not using a xorg.conf. I'm just using .xinitrc if that makes a difference.

Offline

#7 2013-07-03 00:56:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

After dhcpcd, and before trying to launch firefox, what is the output from `echo $DISPLAY`


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2013-07-03 02:44:58

shadeless
Member
Registered: 2013-05-26
Posts: 83

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

It says :0. It says :0 before I do dhcpcd, after I do dhcpcd, and even after I restart Awesome.

Offline

#9 2013-07-03 11:02:24

valr
Member
From: Belgium
Registered: 2012-01-08
Posts: 62

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

I've seen that problem once in the past (reported by another user). It was a problem of hostname.
Can you check your hostname definition ?
Check also in terminal what 'echo $HOSTNAME' gives you.

Offline

#10 2013-07-03 18:51:48

shadeless
Member
Registered: 2013-05-26
Posts: 83

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

When my computer starts up, HOSTNAME is localhost. After I do dhcpcd, it's still localhost. This setting causes my x applications to crash. I log out and back in again. My hostname is now rcervantes2.

Offline

#11 2013-07-04 00:10:07

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

Did you configure a hostname in /etc/hostname when you followed the Beginners' Guide to install Arch?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#12 2013-07-05 14:30:30

shadeless
Member
Registered: 2013-05-26
Posts: 83

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

I actually didn't because I didn't know it was important tongue

I'll be able to confirm whether or not specifying a hostname solves my problems this coming Wednesday.

Offline

#13 2013-07-05 14:39:13

zezadas
Member
Registered: 2013-04-11
Posts: 35

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

try "xhost +" and then open the applcation

Offline

#14 2013-07-14 00:19:34

shadeless
Member
Registered: 2013-05-26
Posts: 83

Re: [Solved] Error: cannot open display :0 after connecting to ethernet

The problem was that I didn't configure a hostname in /etc/hostname when I installed Arch. Thanx cfr!

Offline

Board footer

Powered by FluxBB