PDA

View Full Version : How do I login to a windowserver on a remote machine?


hschickel
02-15-2002, 07:06 PM
I've used fink to install X windows on several machines. I understand its possible to serve windows remotely. How is this done?

Thanks,
Hugh

sao
02-16-2002, 04:15 AM
Maybe, you can try:

Xvnc

<<VNC stands for Virtual Network Computing.* VNC allows you to view a virtual desktop not only from the machine on which it is running, but from anywhere on the internet.* By using Xvnc for MacOS X you may run X-windows apps on your Mac and view them locally within the MacOS X Aqua GUI, or from any computer on with a TCP/IP connection to the internet.>>

http://www.cdc.noaa.gov/~jsw/macosx_xvnc/

or maybe:

WiredX

<<WiredX.net is an ASP, which provides pure JavaTM X Window System servers, WiredX and WiredX-Lite, to your web browser directly. Those X servers enable access to Unix applications on your LAN from Windows machines via web browsers>>

http://www.jcraft.com/wiredx/


Cheers...

Craig R. Arko
02-16-2002, 06:12 PM
Typically you might log in to the remote machine using ssh, and then type:

setenv DISPLAY your.Mac's.IP.number:0.0

and then maybe:

xterm &

and that should pop up an xterm on your local machine. From there just launch clients through the xterm or, depending on what window manager you have, a program launcher.

xvnc is certainly an alternative and OSXVnc another; the former does X11 and the latter does Aqua.

sao
02-17-2002, 01:23 AM
This is the information I keep from some posts about openssh in the fink lists:

------------------------
Is it possible to connect to a Mac OS X box via ssh -X to run xclients on a remote display? I have no problems in the other direction. Let me give an example of what I want to do:

Mac's name is: work_macosx.work.com
My home mac's name is: home_macosx
My work FreeBsd's name is: work_bsd.work.com

If I am running XDarwin I can do this

home_macosx> ssh -X work_bsd.work.com
home_macosx> ... blah blah blah
home_macosx> xterm #this works fine

I would like to be able to do this:
home_macosx> ssh -X work_macosx.work.com
home_macosx> ... blah blah blah
home_macosx> xterm #this does not work.

In fact if I try
work_bsd> ssh -X work_macosx.work.com
I eventually get a message "host denied X11 forwarding".

Should I be able to get this to work?
-------------------------
Yep, same as any other installation of openssh. It defaults to denying X
forwarding. Set "X11Forwarding yes" in /etc/sshd_config
------------------------
Did you actually get this to work?

I am asking because I have tried this for a long time and it never
worked, and the only reports I have seen on this subject on MacOSX
mailing lists were all negative.

The target machine writes typically

Dec 27 10:36:41 localhost lookupd[226]: _lookup_all(query) failed
Dec 27 10:36:41 localhost sshd[6462]: error: socket: Protocol not supported

into /var/log/system.log.

If it works for you, what version of openssh are you running? I am using
the one from Apple which is OpenSSH_2.9p2.
-------------------------
Well, that one won't work, but thanks to Matthias Neeracher, it should work with the fink version of OpenSSH.
The problem was/is that OpenSSH tries to use IPv6 and that breaks on OS X (OS X claims it supports IPv6, but apparently it doesn't or something alike)
-------------------------
Yeah, but OpenSSH knows how to deal with that situation. Or at least, it
should. When it tries to open a forwarding channel and fails, it checks
errno for EAFNOSUPPORT.
So I'm curious... How is Darwin broken this time? What workaround is
fink using? --with-ipv4-default?
-------------------------

Amazing, but true: This works!

Before this information, I hadn't seen the interest of replacing Apple's
ssh by Fink's, but this makes it mandatory.
-------------------------

Plus, I am looking into packaging OpenSSH 3.0.2p1 right now, which you don't get from Apple so far :)
------------------------

Use the Fink package 'openssh'. Edit '/sw/ssh/sshd_config', do a 'daemonic enable ssh', and restart.
-----------------------
It works, even through VPN. This is fantastic! What would I do without fink?
----------------------
Sorry to interrupt this thread and move it offtopic, but I was curious about this -- is the VPN you're tunneling through PPTP ? I'd like to ssh to my work computer as well, but to get through the Microsoft PPTP VPN I need to use a Windows box. There's a FreeBSD port of pptpclient from linux, but apparently it doesn't support encrypted VPNs (see pptp.monitzer.net). Another project, http://www.gracion.com/vpn/ promises to enable Mac OS X connectivity to encrypted PPTP VPNs but isn't ready yet.
----------------------
The original pptp client claims to support Linux and FreeBSD:
http://pptpclient.sourceforge.net/. I can't find pptp.monitzer.net...
However, it requires that you patch pppd in order to support encrypted
VPN's. You would at least have to track down Apple's pppd source and
patch that.
---------------------

Current openssh packages with fink:

In 0.3.2a-stable: *** Version 2.9.9p2-1
In current-stable: *** Version 2.9.9p2-1
In current-unstable: *** Version 3.0.2p1-1

Also, there is a good article "Building OpenSSH 3.0.2 on Mac OS X 10.1.1"
By: Scott Anguish (date: February 01, 2002) at:

http://www.stepwise.com/Articles/Workbench/2001-12-17.01.html


Sorry about the long post, hope it helps.

Cheers...

hschickel
02-19-2002, 01:06 AM
Thanks all for the advice. I'm currently typing this remotely to you from an OSXvnc served box via fink'd vnc through xterm. The system works but is very slow.

The OSXvnc makes an excellent server. Fink's version has one but I'm having some trouble with the config file. Specifically a file should be set up called .XAUTHORITY. I'm guessing in ~/ but this is not clear.This file needs to be set to ${HOME}/.vnc/.XAUTHORITY. I'm not sure of the syntax and would appreciate any help.

Edit and addition:

These are the instructions from fink: Usage Notes: User must add /usr/X11R6/bin to PATH in order to run
vncserver. XAUTHORITY environment variable must be set to
${HOME}/.vnc/.Xauthority in xstartup file. Detailed usage instructions at
http://www.uk.research.att.com/vnc.

The file that needs to be modified seems to be ~/.vnc/xstartup: [localhost:~/.vnc] hs2admin% pwd
/Users/hs2admin/.vnc
[localhost:~/.vnc] hs2admin% more xstartup
#!/bin/sh

export XAUTHORITY=/Users/hs2admin/.vnc/.Xauthority
xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
[localhost:~/.vnc] hs2admin%


Perhaps someone knows the proper syntax to change the environment variable in this file. Also, I use GNUStep's Window Maker for a window manager. twm is crashing everytime I launch the vncserver. Is this a coincidence or should I change twm to windowmaker somehow?

Thanks,
Hugh

sao
02-19-2002, 06:51 AM
Hi hschickel,

"The system works but is very slow"

In the "VNC Frequently Asked Questions (FAQ)" at :

http://www.uk.research.att.com/vnc/faq.html#q21

look to the question "How do I make VNC go faster?"

The offer some good tips that might help you to speed up VNC.

Also, have you checked "TightVNC" at :

http://www.tightvnc.com/

--------------

"twm is crashing everytime I launch the vncserver"

<<In the Xfree packages in stable, the twm window manager does not work,
probably due to some incompatiblity between the old base xfree86 package
which is version 4.1.0 and the server package which is 4.1.99. The
packages in unstable are both 4.2.0, and the problem should be solved
there.>>

What this means is that twm is crashing at launch, unless you use the current version of Xfree 4.2 in unstable which solves the problem.

--------------

Can't help you with Xauthority.

Cheers...

hschickel
02-19-2002, 09:43 AM
Sao,

I appreciate the prompt and very helpful replies. I tried out the Mac OS9 versions of vnc and did not get an appreciable speed boost. Then I checked the link you mentioned and it had some extensive information about the graphics requirements of vnc. Dropping the display to 16bit color resolution made everything faster.

Tight vnc looks very interesting - I don't see that option via fink's aptget or dselect but perhaps it could be compiled. I will look at that root.

As far as upgrading to the unstable and unfinked versions of Xfree - I think I will hold off until they are finkified or until my Unix skills are much higher. The OSXvnc is such a good server (that also serves aqua) that it does not make sense to move to an unstable version of xFree for me. I will, however, pursue running the server through windowmaker as opposed to twm.

Thanks again for all of your help. I'm enjoying remote control.

Hugh

sao
02-19-2002, 10:41 AM
You already can install "tightvnc with fink :

Please do a "sudo fink list", it should appear there.

Package tightvnc

In 0.3.2a-stable: *** Version 1.1p9-2
In current-stable: *** Version 1.2.2-1
In current-unstable: *** Version 1.2.2-1

Then you can do "fink install tightvnc"

For the packages of XFree86 4.2.0 from unstable you can just :

<<If you only want one or two specific packages, it is safer to copy those .info files (and their associated .patch files, if there are any) from /sw/fink/dists/unstable/main/finkinfo to /sw/fink/dists/local/main/finkinfo.>>

Then run "fink install packagename"

Cheers...

sao
02-19-2002, 12:26 PM
Although you didn't mention it, I decided to post the following because it might be of help to others:

Can I cut and paste between the viewer and the server?

VNC supports copying and pasting of ASCII text in both directions, provided the viewer and server allow it. When the clipboard changes on the machine running the viewer, the changes are copied to the server and vice versa.

Here is where you can use fink to install autocusel:

<<This tool regularly scans the primary selection and the cutbuffer 0. If one of them is changed, it updates the other one.
I don't need xcutsel anymore and have a working cut and paste between GTK (through VNC) and Windows>>

<<To transfer text from Aqua to X11, use Cmd-C in Aqua, then bring the destination window to the front and use the middle mouse button to paste. To transfer text from X11 to Aqua, simply select the text with the mouse in X11, then use Cmd-V in Aqua to paste it.

The X11 system actually has several separate clipboards (called "cut buffers" in X11 speak), and some applications have weird views which one should be used. In particular, pasting into GNU Emacs or XEmacs sometimes doesn't work because of this. The program autocutsel can help here; it automatically synchronizes the two main cut buffers. To run it, install the autocutsel Fink package and add the following line to your .xinitrc:

autocutsel &

(Make sure it's before the line that exec's the window manager and never returns! Don't just add it at the end, it won't be executed.)>>

Cheers...