Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

X11

Hello,


When I lunch some window from the Command window, the window does not display.


For example, I tried what they recommended me in X11 error - Apple Community (write  /opt/X11/bin/xclock on the command window) but the following error occurs:

Error: Can't open display


The error is that the X11 Driver is unable to open X windows connection.


Any help?


Thank you.



MacBook Air 13″, macOS 12.4

Posted on Sep 7, 2022 4:03 AM

Reply

Similar questions

11 replies
Sort By: 

Sep 12, 2022 3:54 AM in response to BeatrizBlanco

BeatrizBlanco wrote:

Hello,

When I write 'export DISPLAY=:0' , and then 'xclocks' , the clock appears. However, if I close the terminal and I open again, I have to do the process again because xclocks does not show without DISPLAY:=0.

Any help to automate the process?

Thanks


You can add that line to your .bashrc or .zshrc file and each time you open a Terminal window it will be set. But this begs the question, why isn't this being set beforehand? It seems that either your Terminal session configuration, your account, or both are not correctly setup. I've had XQuartz installed for ages and it runs from within a Terminal session window fine and it has the correct DISPLAY set, i.e. /private/tmp/com.apple.launchd.3RPH97KqP0/org.xquartz:0


You can create a new user account on you Mac and login using this account and see how XQuartz behaves under it. This could help point to where in your current account there is an issue.


My own Terminal preferences are as follows

Reply

Sep 7, 2022 4:55 AM in response to BeatrizBlanco

From the Command window do you see something similar to the below?

$ echo $DISPLAY

/private/tmp/com.apple.launchd.wJKxq2xH0c/org.xquartz:0

 $ file /private/tmp/com.apple.launchd.wJKxq2xH0c/org.xquartz:0

/private/tmp/com.apple.launchd.wJKxq2xH0c/org.xquartz:0: socket



Reply

Sep 7, 2022 6:20 AM in response to BeatrizBlanco

If echo $DISPLAY is empty, then while very unlikely, maybe something unset DISPLAY or set it to an empty string, maybe in your shell initialization scripts. Again unlikely.


Or XQuartz is on old version or a broken version, or needs to be reinstalled (and then reboot)


I’ve used XQuartz on my Macs for 15 or 16 years, including under Monterey on an M1 Pro CPU model. I know it works, and xclock is always my test app to make sure I have a connection.


Generally I’m using an ssh -Y X11 tunnel to a Linux system, but DISPLAY must be valid for that to work.


So you need to be able to see a DISPLAY value being automatically set when you login to your Mac account and start your terminal session.


NOTE: You DO NOT set DISPLAY, it is automatically set by a working XQuartz when you first login to your Mac.

Reply

Sep 7, 2022 6:25 AM in response to BeatrizBlanco

BeatrizBlanco wrote:

When I write $ echo $DISPLAY
I get nothing


That's your problem there. Without a DISPLAY variable defined, and listing a valid socket, then you won't get X11 working. So, it seems that your XQuartz installation isn't fully completed, or configured correctly. Does XQuartz show under your Utilities? If it does, then what happens when you open it from there?

Reply

X11

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.