Forwarding X from a command line only server
Greetings, first post here, but it seems to be obscure enough that I couldn't find an answer anywhere else, so here goes:
I'm about to finish up my new homebuilt server (mostly serving media over the LAN). I'll be installing Slackware 13(64) this weekend. My initial thought was to make this a headless server that could sit in the closet with only power and ethernet cords to worry about. As such, I'd have no need for any graphical interface. I've had experience with Slackware 12.2 as a headless, command-line only box (accessed via SSH) so this part won't be a problem.
One of the things I wanted to be able to do it remotely control all of my Windows machines that are on the same LAN from elsewhere by using SSH to log into the Slackware machine and then remote desktop into one of the Windows machines. I've used rdesktop to do the second part (it was actually on Fedora, but it should work on Slackware as well), and I've used a program called eXcursion to forward X to a Windows machine.
So my question is can I get this to work?
I know my way around a Linux system fairly well, but I'm less familiar with everything about X windows or window managers or whatever, so I apologize if some of my terminology is unclear. I would think it'd be relatively straight forward to get this working if the Slackware machine was running KDE or some other window system, but I'd rather not even install a window manager if at all possible. Are there certain software groups I need to install? Am I correct in assuming that even with no GUI, the server would have to be running an X server in order to relay the graphical data from one Windows machine to another?
Now, I was wanting to keep this setup as simple as possible, which I figured would mean doing everything via SSH. But is there another way to accomplish this that would be less hassle? I'd like to maintain some semblance of a secure system.
One last thing to consider: my current ISP upload speed is only around 480kbps, so I don't envision transferring files over such a connection, just remote access. Is this too slow to even attempt X forwarding? What about running a straight up VPN server, or would that be even more outrageous?
I haven't attempted anything yet beyond simple SSH, but I'm open to pretty much anything here. My priorities are probably security and performance (but I realize there's only so much my connection can handle).
Welcome to LinuxQuestions :)
You can run X programs on a headless server, displaying the result on a desktop that's accessing it through ssh.
You will need to install the normal 'x' packages on your headless server, but you do not need to configure it there.
In 'X' terminology, the "X-Server" is the machine that displays the result, so in your case it's not the headless server, but your desktop.
Your desktop acts as a 'graphical server' for the programs hosted on your headless server :)
On your headless server, you need to configure ssh to "forward" X information:
- simply edit /etc/ssh/sshd_config and change the line reading "#X11Forwarding no" to "X11Forwarding yes" (don't forget to remove the '#')
- restart ssh (you can do this while logged on): "/etc/rc.d/rc.sshd restart"
- on your desktop, close the ssh connection and connect again with "ssh -Y <your-server-ip>"
- test it by running "xcalc" on your server - it should display on your desktop.
This works fine for simple X programs, but programs needing a lot of KDE things running might give different results.
Like the saying goes: YMMV ...
I forgot to mention using X forwarding over the internet...
My example works fine on a local network. Using this over the internet is possible, but the results might not be satisfactory... A simple xcalc will go fine, but do not try to run a CAD program this way over an ADSL line (I recently did...) It's impossible to work with.
If you need to do this over the internet, try solutions like VNC, but then you need to configure & run X on your server as well.
The arrangement you describe is like what I use to access Windows machines on an intranet behind a Slackware server at work from my home PC.
I use a ssh connection with X11 forwarding enabled to the work Slackware server, and then use Firefox to connect to the Windows machines that have VNC (I use RealVNC) installed. The work Slackware server does not have X running.
My connection is via ADSL with 1.5Mb/s download and 256Kb/s upload. I use the -C option to ssh, which gives a usable connection for my needs (mostly running Windows updates).
Thanks a bunch guys. It seems I should be able to get this working relatively easily.
So when I go to install Slackware, I should be able to get by with only installing the A, AP, L, and N software sets, right? I obviously won't need the KDE, KDEI, X, and XAP sets. And then if at some point down the road I decide to repurpose this machine I could add some of the other packages to gain their functionality.
This will be going on an 80 GB RAID 1 array. Is there any trick to installing on this type of setup? This is actually the first time I've even tried RAID on any OS, so I'm not sure what to expect.
If you want to start any X application on your server, even displaying them remotely on your desktop, you'll need to install the X and XAP series.
The same goes for KDE - if you want to run any KDE app.
The question about RAID is a whole different story - probably worthy of a separate thread ;)
|All times are GMT -5. The time now is 11:09 PM.|