FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I draw a display without logging into the graphics display of a FC2 system?
I am getting:
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
Error: Can't open display: :0.0
I have a number of machines on a LAN that I am trying to run a number of tasks on, and I'd like to not have to log onto each machine locally before running those tasks.
How do I set up a FC2 system to allow me to rlogin to it and draw on that machine's DISPLAY :0.0 without anyone being locally logged in to that machine?
Okay, to rephrase your question, since it still isn't completely clear what you are asking...
You have a host 'A', running an X server, and you want to login from host 'B', possibly running an X server. You want to run an application on host 'A', such that it's X I/O is sent to the X server on host 'A' (and not to the X server on host 'B', as it would in the usual scenario).
If that accurately describes your problem, then:
Login using rlogin (not reccommended) or ssh to host 'A' from 'B'. Optionally verify that there actually is an X server running on host 'A' and what it's display number is (number :0 is a fairly safe bet). Set the DISPLAY environment variable (and export it, if in bash) to 'localhost:0', or '123.123.123.123:0' (substitute IP of host 'A'). Run the program that connects to the 'local' X server. If the X server on host 'A' is accepting connections from it's own IP, then output should appear on the screen, and the keyboard and mouse should be able to control the program.
I just re-read the question and realize there were some bits I didn't answer.
If there is no one logged in, there may not be an X server running. If this is the case, you should be able to start one, by running 'X', possibly using something such as 'startx' to launch a window manager &/or desktop. The essential concept is, the OS doesn't care whether you are sitting in the chair in front of the computer, logged in on a VT console, or logged in from a remote connection. If you have sufficient privelage, you can still run all of the same stuff.
How do I set up host 'A' to permit ssh logins with nobody logged into host 'A'?
For now, I MUST physically go to host 'A', log in, and 'xhost +' to allow other hosts to log in.
Since I have to do this for eight hosts on my LAN, I would prefer to just set up shell scripts to run them all from one location.
Sounds like you may be confusing the difference between ssh logins and X server connections. As long as host 'A' is up and running, it should accept ssh connections. There does not have to be an X server running for any host to accept ssh logins. Two (almost) entirely unrelated systems. I say 'almost', because there is the 'X tunnelling' connection. Similarly, someone else being logged in to host 'A' is not necessary.
I think I understand your problem, now, though. When you run xhost from the local console of host 'A', it will normally have it's $DISPLAY variable set to point at the X server on that local host. If you login to that host remotely, your $DISPLAY variable will be pointing back at the X server on 'B' (so X traffic get sent there for you to see). What you need to do is login to 'A', and change DISPLAY to point at the X server on 'A'. Then, when you run xhost, it will work it's magic on the X server on 'A'.
Code:
export DISPLAY=localhost:0
You may need to verify that the X server on 'A' is actually running, first. There are a few ways to do this, but the simplest might be with ps:
If you are lucky, there will be no X server, and you can simply run X (/usr/X11R6/bin/X, on my example) without all of the 'startx' window dressing.
The output of ps shows that the server is accepting connections as display ':0'. You use that as the last part of the $DISPLAY variable value that must exist whenever you run any application that wants to find an X server to connect to. If host 'A' is at '123.23.3.1', then you could set DISPLAY to '123.23.3.1:0' before running your X client. If you are running the X client ON 'A', you should be able to set it 'localhost:0'. In the latter case, you probably won't need to run xhost, because the X server should always accept connections from localhost. If you want to run your X client(s) on remote computers, that '-nolisten tcp' will get in the way, and you will have to wade through the X startup scripts to figure out how to get rid of that, if it is there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.