Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create a remote X11 desktop over SSH (revised) Network
This hint is an evolution of another hint, which I had a hard time getting to work. You can read it for the rest of the detail, but the short story is that it allows you run a full remote X11 desktop session in a window on your Mac.

The longer story is that it probably won't work, because your Mac probably doesn't have the same X11 fonts installed as does the remote server. The older hint actually addresses this, but the explanation is confusing, and it only works if there is no firewall between you and the server. The fix is to forward the TPC port of the X font server over the SSH session, so that your local machine can actually talk to it. Here is what the entire setup looks like:
localhost%  ssh -L7100:localhost:7100 -Y user@remotehost

(in another Terminal window)
localhost%  xset +fp tcp/localhost:7100

(back in the first window, after it has ssh'd into the remote host)
remotehost% Xnest ":1" -geometry 1280x810 -query localhost
Discussion:

You have to have the ssh session open, with the port forwarding active, before you will be able to add the remote font server to your local font path. And you have to have the remote server's fonts in your font path before it will be possible for the remote desktop session (CDE on Solaris in my case) to start up.

One of the problems I had with the old hint was that it said to do xset +fp tcp/ip.of.remote.host:7100 and I thought he meant "use the tcp/ip address...", when actually the prefix tcp/ is really part of the syntax. The other problem is that it wasn't clear where you were supposed to run the xset command, or for that matter why you'd be tunneling X in SSH at all if there wasn't a firewall in the way.
    •    
  • Currently 2.43 / 5
  You rated: 2 / 5 (7 votes cast)
 
[51,223 views]  

Create a remote X11 desktop over SSH (revised) | 6 comments | Create New Account
Click here to return to the 'Create a remote X11 desktop over SSH (revised)' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a remote X11 desktop over SSH (revised)
Authored by: n9yty on Aug 23, '05 10:41:21AM

You would tunnel X in ssh even without a firewall, if, for instance, you wanted to make sure your commincations between the server and you, even on your own LAN, were encrypted. ;-)



[ Reply to This | # ]
Create a remote X11 desktop over SSH (revised)
Authored by: zojas on Sep 02, '05 05:56:27PM

if you liked this hint, you should definitely check out FreeNX which is the gpl version of NX (nomachine.com). it allows you to run a remote desktop over ssh, the difference being that it is a custom X server with caching and compression. at home on my cablemodem I can be working on my workstation at work and most of the time I can't tell I'm not local. very nice.



[ Reply to This | # ]
Create a remote X11 desktop over SSH (revised)
Authored by: Choub on Sep 28, '05 07:36:04AM

Hi all,

I tried your issue, but I'm getting a font error.
When i'm setting the new fonts with xset, I'm getting this on client side :
[code]
xset: bad font path element (#87), possible causes are:
Directory does not exist or has wrong permissions
Directory missing fonts.dir
Incorrect font server address or syntax
[/code]

and this on server side :
[code]channel 3: open failed: connect failed: Connection refused[/code]

Does I need to create a .font folder in my ~ or something else ?

---
Mac user since 1984



[ Reply to This | # ]
Create a remote X11 desktop over SSH (revised)
Authored by: palahala on Jan 07, '09 03:04:15PM
A bit late... ;-) On Ubuntu 8.10 (and probably many other releases) the X Font Server is not installed by default, making xset +fp tcp/localhost:7100 fail. To install it:
apt-get install xfs
Next, to enable TCP networking:
sudo vi /etc/X11/fs/config
Here find, and comment-out, the line no-listen = tcp. Finally, restart the font server:
sudo service xfs restart


[ Reply to This | # ]
Create a remote X11 desktop over SSH (revised)
Authored by: makeitsimple on Mar 22, '06 09:03:03PM

Same problem here with the xset command:
$ xset +fp tcp/localhost:7100
xset: bad font path element (#87), possible causes are:
Directory does not exist or has wrong permissions
Directory missing fonts.dir
Incorrect font server address or syntax

Anyone?

The good news is that I *FINALLY* got to see the remote login screen (thanks to steps 1 and 3, above), but after entering my username and password (I can choose CDE, Gnome 2.0, User's Last Desktop or Failsafe Session). If I choose CDE or Failsafe Session, then it looks like it is going to load, but all I see is a funky Solaris hourglass and a black screen and then it pops back to the login screen. I did see these errors when launching the command:
% Xnest ":1" -geometry 1280x810 -query localhost
Permission denied
X_mkdir: Not owner
X_mkdir: Not owner
X_mkdir: Not owner
X_mkdir: Not owner

Grrrr!!!

HOWEVER, if I choose Gnome 2.0, then it shows me the Solaris 9 splash screen, then I see the Gnome icons marching across, and then the desktop loads (there's the foot icon and menus!), BUT, as it's about to put up the desktop icons, it craps out to a black screen and back to the login...
My Xterm has these errors:
% Xnest ":1" -geometry 1280x810 -query localhost
Permission denied
X_mkdir: Not owner
X_mkdir: Not owner
X_mkdir: Not owner
X_mkdir: Not owner
XDM: too many retransmissions, declaring session dead
Permission denied
X_mkdir: Not owner
X_mkdir: Not owner
X_mkdir: Not owner
X_mkdir: Not owner
AUDIT: Wed Mar 22 23:23:32 2006: 2105 Xnest: client 1 rejected from local host
Auth name: MIT-MAGIC-COOKIE-1 ID: -1
AUDIT: Wed Mar 22 23:23:32 2006: 2105 Xnest: client 1 rejected from local host
Auth name: MIT-MAGIC-COOKIE-1 ID: -1
AUDIT: Wed Mar 22 23:23:32 2006: 2105 Xnest: client 1 rejected from local host
Auth name: MIT-MAGIC-COOKIE-1 ID: -1
AUDIT: Wed Mar 22 23:23:32 2006: 2105 Xnest: client 1 rejected from local host
Auth name: MIT-MAGIC-COOKIE-1 ID: -1
AUDIT: Wed Mar 22 23:23:32 2006: 2105 Xnest: client 1 rejected from local host
Auth name: MIT-MAGIC-COOKIE-1 ID: -1
AUDIT: Wed Mar 22 23:23:32 2006: 2105 Xnest: client 1 rejected from local host
Auth name: MIT-MAGIC-COOKIE-1 ID: -1
XDM: too many retransmissions, declaring session dead
Permission denied
X_mkdir: Not owner
X_mkdir: Not owner
X_mkdir: Not owner
X_mkdir: Not owner
...and so on until I kill the login screen (Xnest) window.
What a tease!!!!

On the server, all is quiet for the CDE/Failsafe logins, but Gnome logins seem to have this error logged:
Mar 22 23:22:19 <hostname> gconfd (<user>-2207): [ID 702911 user.info] starting (version 2.1.0), pid 2207 user '<user>'
Mar 22 23:22:19 <hostname> gconfd (<user>-2207): [ID 702911 user.info] Resolved address "xml:readonly:/etc/gconf/gconf.xml.mandatory" to a read-only config source at position 0
Mar 22 23:22:19 <hostname> gconfd (<user>-2207): [ID 702911 user.info] Resolved address "xml:readwrite:<~user>/.gconf" to a writable config source at position 1
Mar 22 23:22:19 <hostname> gconfd (<user>-2207): [ID 702911 user.info] Resolved address "xml:readonly:/etc/gconf/gconf.xml.defaults" to a read-only config source at position 2

I see some of these as well, but now get no new logs (so maybe they're only logged once per X session?):
Mar 22 23:12:20 <hostname> sshd[1766]: [ID 800047 auth.error] error: connect_to localhost port 7100: failed.
Mar 22 23:12:34 <hostname> sshd[1766]: [ID 800047 auth.error] error: connect_to ::1 port 7100: Network is unreachable
Mar 22 23:12:34 <hostname> sshd[1766]: [ID 800047 auth.error] error: connect_to 127.0.0.1 port 7100: Connection refused
Mar 22 23:12:34 <hostname> sshd[1766]: [ID 800047 auth.error] error: connect_to localhost port 7100: failed.

So close, yet so far...
Anyone?



[ Reply to This | # ]
Create a remote X11 desktop over SSH (revised)
Authored by: makeitsimple on Mar 23, '06 06:21:16AM

I opened port 7100 on my firewall(s) as well and imagine that should resolve the sshd issues (and why they may have been logged once, but not since).



[ Reply to This | # ]