X server


#1

For the Linux gurus out there:

I’d like to edit my files directly on the schweppes.dreamhost server using emacs or xedit (not vi!).

I would think I could set up my xserver with:

xhost +schweppes.dreamhost.com

And then use -Y with ssh:

ssh -Y dlbruce@schweppes.dreamhost.com

emacs runs but no display. xedit gives:

Error: Can’t open display:

I’m using a home LAN with a router on a cable isp, so I have no idea how I would set up the $DISPLAY variable.

export DISPLAY=comcast.net.mymachine:0

doesn’t work.

But, I don’t think I need the DISPLAY variable with ssh anyway.

Anybody editing files directly on a DH server?


#2

[quote]Anybody editing files directly on a DH server?

[/quote]

Yes, using vi. :stuck_out_tongue: Emacs, text-based also works from plain ssh command line.

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#3

uh … thanks. :wink:


#4

As you’re on cable… I think you’re Nated… I really don’t know if X forwarding works trought a NAT, also if your home LAN implements NAT would be a trouble…

you can execute say xterm?

Maybe more confusing or useful http://www.webservertalk.com/message56680.html


#5

More plainly, did you try, from a terminal window:

ssh dlbruce@schweppes.dreamhost.com

then

emacs

?

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#6

vicm3:

[quote]you can execute say xterm?
[/quote]


Not from schweppes.dreamhost. I didn’t find xterm on the system. I did find emacs and xedit.


[quote]More plainly, did you try, from a terminal window:

ssh dlbruce@schweppes.dreamhost.com

then

emacs
[/quote]


ananymous2:
Yes. I was running ssh from an xterm session from my local machine.


#7

[quote]Yes. I was running ssh from an xterm session from my local machine.

[/quote]

But you said you were using:

[quote]ssh -Y dlbruce@schweppes.dreamhost.com

[/quote]

So you’ve tried without the -Y ? Emacs works fine for me that way, on a similar lan, other than the “difficult” commands :slight_smile:

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#8

[quote]So you’ve tried without the -Y ? Emacs works fine for me that way, on a similar lan, other than the “difficult” commands :slight_smile:
[/quote]


No, I was using the -Y. I just tried it without the -Y and got the same result.

I do get X to work with ssh on LANs, both at work and home, but I’ve never tried to go outside the LAN to the www before. I’m betting it is the way I have to specify the remote client in the xhost command. Or, maybe I do need the $DISPLAY variable and I am not specifying the local host correctly. Any idea what the fully qualified name would be for a machine on a LAN connected to comcast.net that would be recognizable across the www? But, on the LAN I don’t set $DISPLAY with ssh and it works fine. I only seem to need $DISPLAY with rsh.


#9

Just download putty and do a regular ssh. It will fix the display correctly. Not sure what OS your on but:

Windows:
http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe

Linux:
http://ftp.debian.org/debian/pool/main/p/putty/putty_0.58.orig.tar.gz

Save [color=#CC0000]$97[/color] on Dreamhost plans by using promo code: [color=#CC0000]SRVR97[/color]


#10

Debian, Ubuntu, etc.:
apt-get install putty :smiley:

[quote]I do get X to work with ssh on LANs,

[/quote]

All I was trying to say was I ssh from a similar LAN to DreamHost.

I ssh to the server in a xterm without doing anything extra, and emacs and vi :slight_smile: just work.

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#11

[quote]I ssh to the server in a xterm without doing anything extra, and emacs and vi :slight_smile: just work.

[/quote]

But you only get emacs to work in command line mode, right? You don’t get it to open in its own window by typing emacs& , do you?
It seems like it should work. And, I would like to understand why it doesn’t, rather than just installing another package.
I’ll email DH support. Thanks everybody. I’ll let you know if I get it figured out. It’s probably some router firewall issue.


#12

[quote]But you only get emacs to work in command line mode, right?

[/quote]

Right.

[quote]You don’t get it to open in its own window by typing emacs& , do you?

[/quote]

Right, I don’t use &. If I want another window/terminal, I just open another terminal tab, ssh again, and start another editor or do other things.

[quote]rather than just installing another package.

[/quote]

Putty might make these things work better, but I doubt it.

[quote]It’s probably some router firewall issue.

[/quote]

Possibly router forwarding, but there’s also some environment setup and something might not be “on” on the servers.

http://www.faqs.org/docs/Linux-mini/Remote-X-Apps.html

http://discussion.dreamhost.com/showflat.pl?Cat=&Board=forum_beginners&Number=2159

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#13

X should work fine if the client is behind a NAT/Firewall. The X server on the other hand, needs to be able to accept incoming connections at the required ports, which is probably not the case for DreamHost servers. Dreamhost is a web hosting company, the primary purpose of their servers is to serve web pages, not graphical user interfaces.

Dreamhost probably did not install the required packages on their servers, because running an X server with active clients only works to increase server load (dramatically). Regardless though, the first thing you should do before you start spending time on troubleshooting the problem is to contact Dreamhost support and ask if an X server is available.

I’m guessing you want to log on with X so it’s easier to edit documents directly without having to upload the document after each ‘save’ operation.
One solution is to simply log on to your dreamhost account via SSH from your local PC, if you’re fine using text-based editors to work on your files. Many people, however, myself included, work far more efficiently if GUI-based development tools, such as, for instance, Eclipse are available.
One solution that works great for me on my WIndows machine is a small software program written for Windows called WebDrive. As the name implies, it allows you to mount an FTP/SFTP/WebDav/iDisk server, such as your dreamhost sftp account as a logical disk on your local PC. You access the disk just like any other hard drive, but the contents are the actual files and directories on your server. The file system is presented and updated in real time, so WebDrive effectively gives every application on your computer local access to your remote data on the dreamhost server. You don’t even have to think twice about the fact that your web server is not actually the local machine that you’re working on.

I’m guessing that similar solutions might be available for Linux (if not, this is an open-source project worth pursuing). You can also try and see if you can use existing Linux frameworks, such as NFS for instance, to accomplish this.


Patrick
http://inmyholyopinion.com


#14

[quote]I’m guessing that similar solutions might be available for Linux

[/quote]

Good point. This thread covers that some.

http://discussion.dreamhost.com/showflat.pl?Cat=&Board=forum_troubleshooting&Number=70921

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#15

Here’s the response I got from DH support:

Ah, you’re making that more complicated then it needs to be. :slight_smile: Don’t
try to involve X at all. We don’t have that on any of our servers
because it’s way too much load for our servers and not really worth the trouble to setup. Just connect like normal through a standard ssh
client. Once you’re logged in, just run the command “emacs” and it’ll
pop right up.

So it is looking like they are recommending running emacs from the command line as well.
anonymous2:
And from your most excellent link at http://www.faqs.org/docs/Linux-mini/Remote-X-Apps.html it sounds like my xhost approach is very insecure anyway. Probably a good thing it didn’t work. Your link to Remote-X-Apps.html indicates it is possible to run X securely across the www, but it is more trouble than it is worth.
I played with emacs from the command line a little. It’s not that bad. All the standard emacs key strokes work. And you can still access the shell from within emacs. I think this is the way emacs was originally designed.
freerick:

The X server on the other hand, needs to be able to accept incoming connections at the required ports, which is probably not the case for DreamHost servers. Dreamhost is a web hosting company, the primary purpose of their servers is to serve web pages, not graphical user interfaces.

X is a graphical server that runs on your local machine. DreamHost would be the client that accesses your local X server. It’s backward, I know since DreamHost is the server in all other respects.
Your suggestion to mount the DreamHost machine as a logical drive is a good one. I’ll try that. Looks like BUGabundo got it to work in the thread just quoted by anonymous2. I may have to start a different thread if I have trouble. Stay tuned…
Thanks all.


#16

from a quick look at the command line options it appears that emacs -d display may do what you’re looking for. Have you tried it yet? I don’t see -Y as an option on the command line

Wholly - IS NOT MY PROMO CODE. Even worse, I don’t get any credit for it. Use WhollyMindless for full credit. I’m really disappointed in someone.


#17

[quote]emacs -d display may do what you’re looking for.
[/quote]

It is still trying to start X on my machine. The -d option takes my display as an argument. My problems are:

  1. I don’t know how to fully specify my machine on my LAN connected to comcast.net. I can’t even ping my local machine from my ssh session on schweppes.dreamhost.com.
  2. It looks pretty involved to set up secure access for DH to my local X server.
  3. DH says they disabled their X client(?) anyway.
    I think this is a dead end. But, I have the other options discussed earlier.