Mac X11 Display Error
Contents |
enter a title. You can not post a blank message. Please type your message and try again. This discussion is locked buckydoc Level 1 (0 points) Q: Problems with X11 - Can't open display Hi -I am trying to use X11 from a Mac running 10.5.7 mac x11 forwarding el capitan to remotely access programs on a Linux machine but keep getting the following error when
Error Can't Open Display Linux
I attempt to launch a new xterm.[mac]$ echo $DISPLAY/tmp/launch-XXXX/:0[mac]$ xhost +remoteLinux.com[mac]$ ssh -X user@remoteLinux.com[linux]$ echo $DISPLAYlocalhost:10.0[linux]$ setenv DISPLAY
Error Can't Open Display Localhost
Can't open display:
Xquartz Cannot Open Display
forwarding and it makes no difference. Am I missing something obvious? There must be some configuration setting that needs to be modified but can't find anything anywhere. Any suggestions would be greatly appreciated. Mac OS X (10.5.7) Posted on Jun 19, 2009 1:01 PM I have this question too Close Q: Problems with X11 - Can't open display All replies Helpful answers by etresoft, etresoft Jun 19, 2009 1:08 PM in response to buckydoc Level 7 (29,380 points) el capitan x11 forwarding Mac OS X Jun 19, 2009 1:08 PM in response to buckydoc You are trying too hard. Just set "ForwardX11 yes" in ~/.ssh/configThen ssh into your server.There is no need to set any environment variables. Helpful (0) Reply options Link to this post by buckydoc, buckydoc Jun 19, 2009 1:42 PM in response to etresoft Level 1 (0 points) Jun 19, 2009 1:42 PM in response to etresoft thanks - changing ssh_config does not help. same error Helpful (0) Reply options Link to this post by BobHarris, BobHarris Jun 19, 2009 3:51 PM in response to buckydoc Level 6 (19,662 points) Mac OS X Jun 19, 2009 3:51 PM in response to buckydoc You DO NOT need xhostYou DO NOT need to set your own DISPLAYYou DO NOT need to mess with any config files.The *ssh -X* is doing all the work. The localhost:10.0 was setup by the *ssh -X* option. This is an ssh tunnel for all your X11 traffic back to your Mac.I use *ssh -X* every day at work talking to Linux boxes.At worse, you might need to replace the -X with a -Y if the remote system is untrusted. Helpful (0) Reply options Link to this post by buckydoc, buckydoc Jun 27, 2009 10:38 PM in response to buckydoc Level 1 (0 points) Jun 27, 2009 10:38 PM in response to buckydoc again this is a 10.5.7 p
only want to access the user display of one single X11 program on a remote machine? This is possible on Mac OS X with X11 Forwarding. THIS ARTICLE HAS BEEN REWRITTEN (Manual set of the $DISPLAY variable is insecure!) Prerequisites: X11 error: can't open display: mac environments on both the local and remote machine (see man X). Ensure network access for X11. In error can't open display xming Mac OS X on X11 Quartz check the authorization and client access options under Preferences in the Security pane. Enable X11 Forwarding with the "X11Forwarding error can't open display localhost 10.0 putty yes" option set in "/private/etc/sshd_config" for your SSH Daemon own local X11 host in order to recieve X11 client request back from the remote machine through ‘ssh‘ with the -X option set. Start or restart the Remote Login (SSH) Service under System Preference / Sharing https://discussions.apple.com/thread/2048176?start=0&tstart=0 pane on Mac OS X. The SSH daemon should run on the remote machine as well! See "man ssh", "man ssh_config" and "man sshd_config" for the complete explanation. 3 Simple Steps to X11 Forward on Mac OS X 1. Open "Terminal" in Mac OS X Leopard. 2. ssh -X X11 Forward to your remote host (See "man ssh" for the use of the -X or -Y flag X11 forward): ssh -X johndoe@123.456.789 3. Start your remote X11 program and view the user display on your http://dyhr.com/2009/09/05/how-to-enable-x11-forwarding-with-ssh-on-mac-os-x-leopard/ local machine: xeyes & Voila it works! The X application will start up your X11 environment. Its quite easy to do X11 forwarding when you first get the hang of it. Do elegant X11 stuff with ssh -X -f like: ssh -X -f user@remotehost xcalc -bg black -fg green Caveat Notes: Have the latest and updated versions of Mac OS X, Developer and X11. 3 Clues to successful X11 forwarding: A. When you make changes to /etc/sshd_config remember to restart the Remote Login Service (SSH). B. Remember to allow incoming access to X11 in the X11 preferences and through your firewall(s) and router! C. And you have will of curse have to be accurate about your local and remote machine naming convention i.e. John-Does-iMac.local or privat.happycamper.com. Check with "echo $HOSTNAME". On the remote machine you could also do a check with $REMOTEHOST (if set) to check your own machine name on the remote host. NOT! Sometimes it is necessary to use xhost +remotehost and set the $DISPLAY environment variable manually on Mac OS X (something -X or -Y flag in ssh should normally do for you). Try "echo $DISPLAY" on the local machine and remote to get hints of the $DISPLAY status. You can always check your environment with "env" and "$". On Mac OS X Leopard you use EXPORT with bash shell to set environment variables as opposed to tcsh that uses setenv. You should only set the $DISPLAY variable manually in a secure environment i.e. local network. NEW! Do not set
Forwarding X11 from a Remote Computer to the Mac One of the most useful features of X11 is the ability for the X server (XDarwin on your Mac in this case) to respond not only to local X clients, but also remote X clients. http://oroborosx.sourceforge.net/remotex.html What this means in practice is that there is little difference between running an X11 program on your Mac (with its windows appearing on your Mac's screen) and running an X11 program on any other machine anywhere in the http://stackoverflow.com/questions/784404/how-can-i-specify-a-display world (bandwidth permitting) -the remote X11 client's windows can still appear on your Mac as though you are running locally. Of course, you don't want to allow just anyone to start up X11 clients that connect to your Mac's open display X server -they could do all sorts of things, like collect your keystrokes and even take snapshots of your screen. That's why only an authorised client should be allowed to connect (and why you should never use the command "xhost +"!) While on the subject of unauthorised access to your X server, if you do find you suddenly get a window appearing on your X11 desktop that you did not expect (and which looks like it has can't open display come from an external source), you can use the "xlsclients" command to list currently connected clients (so you might be able to check where it has come from), and then use the "xkill" command to destroy the window (it will ask you to click on the window you wish to destroy). At this point it is probably worth making a note about terminology. It is very easy to confuse clients and servers when talking about X11. The basic rule to remember is that XDarwin on your Mac is the X server and any X11 programs you run, whether remotely or actually on your Mac, are known as X clients. This tends to be slightly counterintuitive, because the remote machine is often thought of as the server. However, in the case of X11, only the local machine (i.e. where you are sitting, the screen you are looking at) can be the server because that is where all the clients put their windows. OK, with that introduction out of the way, we can proceed to ask the vital question... How do I Authorise my Remote Machine to use my Mac's X Server? There are three basic ways to do this, listed here in order of preference: Use "ssh -X"; Use xauth with your DISPLAY environment variable; Use xhost with your DISPLAY environment variable. Each of these methods will be outlined below, along
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How can I specify a display? up vote 35 down vote favorite 16 When I run some programs over SSH, such as firefox &, I get an error Error: no display specified I would like to open many displays, still showing the stdout of each program. Initial Question: How can I specify the display to get a many-displayed program? Pablo Santa Cruz gives me the following code as a solution. I do not understand it. $ export DISPLAY=yourmachine.yourdomain.com:0.0 $ firefox & What are yourmachine and yourdomain.com in the command? x11 share|improve this question edited Jul 25 at 9:26 Yuan Wen 434219 asked Apr 24 '09 at 3:36 Masi 32.7k110335519 add a comment| 6 Answers 6 active oldest votes up vote 44 down vote accepted The way that X works is the same as the way any network program works. You have a server of some description (in this case, the X display server) which runs on a specific machine, and you have X clients (like firefox) that try to connect to that server to get their information displayed. Often (on "home" machines), the client and server run on the same box and there's only one server, but X is powerful enough that this doesn't need to happen. It was built with the server/client separation built in from the start. This allows you to do such wondrous things such as log on to your box (in text mode) halfway around the planet, tell it that the display server is the box you're currently on and, voila, the windows suddenly start appearing locally. In order for a client to interact with a user, it needs to know how to find the server. There are a number of ways to do this. Many clients allow the -display or --displayoption to specify it: xeyes -display paxbox1.paxco.com:0.0 Many will use the DISPLAY environment variable if a display isn't specifically given. You can set this variable like any other: DISPLAY=paxbox1.paxco.com:0.0; export DISPLAY # in .profile export DISPL