x-windows for dummies?
I have a bunch of users that log on remotely via command line normally. Some of them want to do some graphics programming... what programs should I install on the server and what kind of client should they use to access the graphics functionality (like for Java programming with basic graphics). I know x-windows is involved, but I've always been a bit hazy on how to make this work.
I figure I normal ssh client won't work... but maybe I'm wrong. I'm using Debian (Lenny). EDIT Btw, I'm looking for the most basic possible x functionality. I don't need users to have a whole desktop environment. I'm reading up on X now to see if I can figure out the best way to do this myself. EDIT Also, I'm looking to install a client on Windows. |
Hi David!
If you ssh with the -Y option on the command line, you can "forward" the X session being run on the computer you are ssh'ing in to the computer you are ssh'ing from. This must be enabled in the destiny computer; in the /etc/ssh/sshd_config file, the following line must exist: X11Forwarding=Yes (If you have to add/change this line, you must restart your sshd daemon). Then you just ssh in with the -Y option, and run the graphical program of your choice. Cheers! |
Hmm, it seems to be more complicated than that. On these servers, I have no desktop environment installed at all, so I have to somehow install x. I'm not sure which packages I need. On a test server I've just done:
apt-get install xterm apt-get install xinit apt-get install xorg For a regular user I get "X: user not authorized to run the X server, aborting." if I try to run xinit. It's probably not a good idea to run it as root, but even so it hangs on: Code:
web:/home/davidst# xinit |
That's a whole new problem - and a bigger one I'm afraid.
To be honest, I love compiling stuff from source, or installing packages manually, but I have 100% failure rates on three things I have attempted several times: installing X from sources/packages, glibc from source, and installing LFS (Linux From Scratch). Hopefully someone else will step in to help you. However, let's assume that the apt-get for xinit has installed all minimum software for you. You must now config your X server. You should try the instructions on this page (or ay other google hits for "configure Xorg"): http://www.brunolinux.com/06-Fine_Tu...nfigure_X.html I noticed your X is outputing some lines about radeon. If you have discreet gpus on these servers, you might want to install their proprietary drivers from the board manufacturer's site. I know that the ATI linux drivers I use automatically configure X, so this could be handy for you too. |
Thanks, I will try that.
|
The server does not need most of Xorg, the client does.
X11 is a Network protocol. It use TCP/IP to transport the graphic elements. Those element are produced by an X client, your Java apps, in this case. The X server, on the client, then translate the protocol into graphic, then send back that input event (keyboard, mouse, touchscreen). As long as the client (on the server) have the necessarty libraries to send the data, it will work. So install Xorg or Xming on the computer your users are working on and ssh with -X or -Y (-X is less secure, but faster). |
The X server does not need to be running on the application server. The server runs on the remote terminal. You can have the application server running in the multiuser terminal mode (init 3 on other distros) yet use "ssh -X" to log in and run remote apps.
You will probably need xorg installed as a dependency of the graphical apps however. I just went into init level 3 on my openSuSE desktop, and started up kpat remotely from my desktop. Recently KDE and Gnome applications use dbus. E.G. KDE uses it instead of dcop now. I found I needed to add these lines to my .bashrc script (on the ssh-server machine). It tests for a remote ssh connection and starts the dbus server: Code:
if [[ -n "$DISPLAY" ]] && [[ -n "$SSH_CLIENT" ]] && [[ -z "$DBUS_SESSION_BUS_ADDRESS" ]] ; then You can create desktop shortcuts or menu items that start with ssh -X in them to run remote applications. For example, I just added InkScape to my desktop folder in KDE. I edited the properties so the command is: ssh -X elite 'inkscape %F' Clicking on the icon on my laptop starts the program remotely on my desktop. The desktop is running in init level 3. |
Is there a recommended program to function as the x-server in a windows environment (clients are windows machines; the server is debian linux; so I install the client on the server and then I need some kind of server functioning on each of the windows desktops in a lab (or else on the users laptops or home PCs))).
Xorg in Cygwin perhaps? |
Xorg in Cygwin or xming
|
Ok, I'm finally getting the hang of this. I install an x-server (like the X11 packages in Cygwin for Windows) on the client machine, and various x capable software on the server such as the x11-apps package.
I logged in and ran xemacs and that works. I'm trying to do some basic java graphics programming and running into trouble. Example programs for java graphics have no "main" function and my environment tells me "exception" when it can't find main. What am I missing here? Code:
import java.awt.*; EDIT Maybe I should mention I run from Cygwin: startxwin And this creates a single terminal like window with a white background. Then from there I'm running: ssh -X user@server Then if I run xemacs file.java I can use xemacs in a separately opened window. But so far all my java programs fail to open any kind of windows for graphics. EDIT Looks like this is a problem with my java programming rather than the server. The user needing the x-windows has gotten some FLTK stuff running. Also, if anyone needs to run x-windows in a lab environment with multiple non-privileged users, you may have a problem with permissions. The first user creates log and lock files and then if they are not removed properly, no other users can create the files on top. I fixed it by scheduling a windows task to run a batch file (as admin) whenever anyone logs in. The batch file removes the conflicting log file in c:/cygwin/var/log and renames the folder in c:/cygwin/tmp (using %RANDOM%) where the socket file descriptor is stored (since windows can't manage to delete it). And for good measure it shuts down any rogue XWin.exe that is hanging on in the background. |
All times are GMT -5. The time now is 09:18 PM. |