You are not logged in.

#1 2009-10-11 19:34:38

jeff story
Member
Registered: 2009-05-31
Posts: 237
Website

SSH and REMOTE X......Not X Forwarding

I've setup several web servers at home for myself, a website, and WordPress on both virtual and real hardware to learn more about servers.

They have varied from just installing Apache on a Ubuntu desktop to installing my website and Wordpress on a lamp server without X.

I quickly learned the benefits of a server without X and a GUI, so I set a goal to setup and configure a lamp server without installing a GUI......and I finally accomplished it!!

Now I'll be the first to admit that I'm still more comfortable in a GUI environment compared to the command line. However, I have no problem using the command line when needed, and am comfortable navigating the file system and editing config files using nano, while still learning and trying to remember commands!!!

My question is where to get more info on how to access my current server without X installed, via SSH and remote X from my Arch desktop to use GUI apps.

I already use the "connect to remote SSH server" to remotely manipulate the file system over my local network using Nautilus.

If Nautilus will work via remote X, then all GUI apps in theory will work. I'm just having problems actually figuring out how to it!!!

I've read that, "By default, this feature is disabled (for security reasons)". So I need to

startx -listen_tcp

But to do that, I need to:

If this server is no longer running, remove /tmp/.X0-lock and start again.

But when the X server is not running, the tmp file referred to is not there!!

Any ideas on how to "toggle" this function on and off easily?

Security risks?

I would also appreciate any additional refrence material on remote X.

Last edited by jeff story (2009-10-11 19:42:15)


Check out my website for info on the Arch Linux Installer

Offline

#2 2009-10-11 22:20:41

mcover
Member
From: Germany
Registered: 2007-01-25
Posts: 134

Re: SSH and REMOTE X......Not X Forwarding

Well I'm not quite sure what you mean by

I already use the "connect to remote SSH server" to remotely manipulate the file system over my local network using Nautilus.
If Nautilus will work via remote X, then all GUI apps in theory will work.

But the remote-SSH feature of Nautilus is in no way remote X or X-Forwarding.

What you want to do is, run a bunch of GUI apps remotely on your server (let's call it machine B) and forward their X output to your machine (machine A). That certainly defeats the purpose of a server, but heck.. it's all possible.

The listen option of the X server enables remote apps on B to use that particular X server on A as their DISPLAY. Well, first you'd need to start a listening X server on your machine A (the one you want to see the output on). To separate your local X display from the one your remote machine B will be using, you could start Xephyr (nested X). Note that '-nolisten tcp' is simply omitted, same applies to any other X server. On machine A enter:

Xephyr :1 -ac -dpi 96
# Optionally append -fullscreen

Now Xephyr is listening on port 6000 + 1 (Display number 1).

To disable access control, enter on machine A:

DISPLAY=:1 xhost +
#DISPLAY=:1 is optional, when you run this command from e.g. an xterm that's running inside DISPLAY 1.0; substitute accordingly (0 for your primary X Display)

On your machine B you can start GUI apps by entering:

export DISPLAY=ip_A:1.0 # 1.0 is Display number
xterm # this will start xterm on your X server on machine A, in my example the nested X window

But all this becomes irrelevant when you appreciate ssh X-forwarding. Just connect to machine B via 'ssh -X someuser@ip_B' and you can start any GUI app you want, without specifying the DISPLAY and your X server on machine A can safely keep -nolisten. You can do anything via X-forwarding, including starting an entire Desktop Environment, given you installed X+some DE on your headless server B.

You can use X-forwarding and Xephyr to start a remote X session on machine B like this:

Xephyr :1 -ac -dpi 96 -fullscreen -nolisten tcp
DISPLAY=:1 ssh -X user@ip_B
# On B:
screen -d -m startxfce4 # to start Xfce

All this works fairly fast in a LAN, and it certainly looks better than VNC. But once you are trying to access machine B via a WAN, X-forwarding will become a pain. Then you'd have to look into VNC or NX.

But I do suggest you get comfortable with the command line, as one can be far more productive by just using the commandline, especially remotely.

Last edited by mcover (2009-10-11 22:27:24)

Offline

#3 2009-10-11 23:26:46

jeff story
Member
Registered: 2009-05-31
Posts: 237
Website

Re: SSH and REMOTE X......Not X Forwarding

mcover,

First, I'd like to ask you something. Did I really say something so wrong that you have to be a rude f#&ker in your reply and try to belittle me for not knowing as much about how Linux works as you?? Did I unknowingly insult you in some way? Sorry if I did.

mcover said:

What you want to do is, run a bunch of GUI apps remotely on your server (let's call it machine B) and forward their X output to your machine (machine A). That certainly defeats the purpose of a server, but heck.. it's all possible.

OK, based on that statement, either you aren't getting what I'm wanting to do, or perhaps you can explain why you feel that way.
No, I don't want to run GUI apps on my server and forward X.....Thats exactly what I don't want to do.

Quote mcover:

That certainly defeats the purpose of a server

When I'm NOT going to install anything additional on my server to do what I want, and ask for security considerations?

Wow....

Quote mcover:

But the remote-SSH feature of Nautilus is in no way remote X or X-Forwarding.

So lets see.....server has no X installed, no Nautilus installed, and I use Nautilus (remotely from the OS and file system I'm manipulating)
Nautilus front end (GUI) can't display without X .....
....hmmm, Sorry if i'm not being clear enough for you. Did I screw up on some Linux terminology or something???? Please elaborate...



Quote mcover:

But I do suggest you get comfortable with the command line

Oh, you obviously missed this paragraph I wrote in the original post then:

Now I'll be the first to admit that I'm still more comfortable in a GUI environment compared to the command line. However, I have no problem using the command line when needed, and am comfortable navigating the file system and editing config files using nano, while still learning and trying to remember commands!!!

Quote mcover:

Then you'd have to look into VNC or NX.

As I said, I don't want to add anything (packages) to my server, so VNC works without X installed?

So thanks for your reply, but no thanks, I'll wait until either someone who understands what I am asking replies, or I'll just do more research on this subject on my own.

BTW: This is the first time I have ever lashed out at someone on a public forum.....but then again, you kinda deserve it don't you.

Last edited by jeff story (2009-10-11 23:56:19)


Check out my website for info on the Arch Linux Installer

Offline

#4 2009-10-12 00:06:50

mcover
Member
From: Germany
Registered: 2007-01-25
Posts: 134

Re: SSH and REMOTE X......Not X Forwarding

Ok then just use sshfs and use your GUI apps and access the filesystem that way. But that has nothing to to do with "remote X".

This line was the key line (though not that clear either -> bold stuff), but it did get lost in the vast number of other stuff you said about X:

My question is where to get more info on how to access my current server without X installed, via SSH and remote X from my Arch desktop to use GUI apps.

But everything else was about remote X and how nautilus is a "remote X app". I quote:

If Nautilus will work via remote X[...]

You were talking about remote X, and listen tcp, therefore I assume you want to display remote X apps on your DISPLAY via forwarding, because that's all the listen option does.

The fact that nautilus offers remote access via ssh may or may not be unique to Nautilus. Other apps may have a similar implementation, but that's purely application specific.


I could comment on _your_ rude behavior, I was genuinely trying to help (making too many assumptions, maybe I should have asked). And no, I wasn't the one offended by anything, you are the one offended by a reply different from what you expected.

Offline

#5 2009-10-12 02:08:54

jeff story
Member
Registered: 2009-05-31
Posts: 237
Website

Re: SSH and REMOTE X......Not X Forwarding

OK.........perhaps an apology is in order.

You said:

I was genuinely trying to help

That got me thinking rather than feeling insulted. And yes I was offended, but could it possibly be due to miscommunication?
I'm not going to let my ego get in the way of apologizing to you mcover, if indeed I am wrong with what I believed was remote X.

Due to my limited Linux experience of just a few years of playing with it at home, and no one to talk to face to face about it, I believe I may be missing something very important regarding X. My "perceived" definition of X forwarding and remote X are two completely different things. This may be my bad and please let me know.

I didn't understand that Nautilus functioning in the way I am using it was application specific. I thought it was using "remote X (my wrong definition)" and therefore, possibly once X or "whatever" was properly configured, other GUI apps would behave similarly.I jumped to the conclusion that if Nautilus "displays" via remotely, that, that was an example of remote X.

Now I'm thinking that X forwarding is directly related to remote X.  Is remote X is just receiving the X output of another external OS's X forwarding and displaying it?

So perhaps what I was asking above is in fact impossible....

I thought that due to the "modularity" of Linux, that you could possibly, without adding anything to my above example server without X installed, run graphical applications "remotely" using the "remote OS's X installation" to display on it's monitor.

My thinking behind this idea is (strictly laymen terms, think Homer Simpson)  X has some kind of "input" and some kind of "output".

So the "input" could be some kind of "raw GUI info" from a remote computers (application a) (backend?) without X installed (computer1)"

and then sent to the other computer (computer2) with X installed, and the same (application's a) (frontend?) to process the "raw GUI info" with X to be displayed on it's attached monitor.

I'm admittedly not knowledgeable in any way on the subject I'm attempting to describe and I seem to suck with Linux terminology...and understanding obviously in this case.

Hopefully someone will understand what I'm trying to describe, and will translate my "Homer Simpson" version into Linux speak.

Last edited by jeff story (2009-10-12 21:16:58)


Check out my website for info on the Arch Linux Installer

Offline

#6 2009-10-12 04:01:27

userlander
Member
Registered: 2008-08-23
Posts: 413

Re: SSH and REMOTE X......Not X Forwarding

X forwarding and "remote X" refer to the same thing, afaik.

The idea is that you have a computer (computer 1) with X installed, and then you log into that computer from another one (computer 2) and run compute 1's X applications from computer 2, for example over ssh.

If you don't have X installed on computer 1, you obviously can't forward anything to computer 2. wink But on a server, X is not usually necessary anyway (imho). So you can just log in with ssh and not forward X at all.

Btw, I didn't read mcover's answers as being rude in the least - just the opposite, in fact.

Hth

Offline

#7 2009-10-12 05:50:20

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: SSH and REMOTE X......Not X Forwarding

userlander wrote:

Btw, I didn't read mcover's answers as being rude in the least - just the opposite, in fact.

Agreed, mcover put a lot of effort into his post.


neutral

Offline

Board footer

Powered by FluxBB