(HOWTO) Remote X11 desktop and SSH X11 forwarding in Puppy

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
Goble
Posts: 21
Joined: Fri 30 Jun 2006, 07:28

(HOWTO) Remote X11 desktop and SSH X11 forwarding in Puppy

#1 Post by Goble »

Hi,

If you want to use your Puppy X11 applications remotely from another workstation (your Windows or other X11 environment) then this is what I had to do with Puppy 2.12 to get it working.

This allows you to use Puppy machine without keyboard and display. I'm building HTPC box with Puppy OS and this box doesnt have keyboard and X11 window manager running. The system is running in console framebuffer mode outputting DVB television mpeg streams through s-video to television.

However, sometimes I'd like to use X11 apps to modify configuration files or download files. Remote X11 desktop is very handy in this situation because I can open Geany, Dillo, GFTP Puppy apps from remote Windows desktop through secured SSH tunnel.

In Puppy I have installed following additional apps

* SSHD server
Use PupGet app to install pre-compiled binary. Search this forum with OpenSSH keyword to find more info.

Another option is to re-compile it from sources. I have installed development Puppy environment so I downloaded www.openssh.org source codes re-compiled the server from latest sources.

Go through config options in /etc/ssh/sshd_config file and enable AllowTcpForwarding and X11Forwarding options (value yes).

Uncomment "X11DisplayOffset 10" and "X11UseLocalhost yes" lines.

Add sshd startup command to /etc/rc.d/rc.local script to start SSHD server automatically when Puppy system boots
/usr/sbin/sshd


* XAUTH application
XAuth is missing from Puppy distro so I used one from Debian package.
Use packages.debian.org and search for a Debian package with xauth keyword (latest is xbase-clients_4.3.0.dfsg.1-14sarge2_i386.deb package).

xauth application is required in X11 to enable secured "X11 forwarding" feature of SSH. If you don't need (believe me, you do need) secured SSH tunnelled remote X11 desktop then you don't need xauth. However, after you SSH login to Puppy system, you need to manually set DISPLAY option. Xauth does this automatically plus it allows you to use secured SSH tunneling.


* UNDEB application to extract the debian package
Search this forum to find UNDEB Puppy package. Install it with Puppy's RoxFiler tool and you'll get undeb and unrpm applications.

Undeb the Debian xbase-clients package to temporary directory
mkdir /tmp/xbase
cd /tmp/xbase
undeb /your-download-dir/xbase-clients-xxxx_i386.deb
cp /tmp/xbase/usr/X11R6/bin/xauth /usr/X11R7/bin
(yes, I used X11R6 xauth binary but it works with X11R7 too, at least in Puppy 2.12)

- If you use secure SSH tunnels (highly recommended) with remote X11 desktops then you must set password for root account in Puppy
passwd root


That's it. Puppy side is ready to rock.

I have WinXP workstation which I mainly use to browser net and so on. I have installed Xming application for Windows from http://www.straightrunning.com/XmingNotes/ web site. This implements remote X11 desktop for Windozes.

To use secure remote tunnels, I recommend to you SSH client in remote workstation. I use Putty (use Google to find home page of Putty SSH Windows client and install it).

- Install XMing application (follow apps install notes. I used pretty much default values)
- Start up xming app (bottom right corner gets a little X icon)

- Install Putty application and startup Putty.exe app.
- Use SSH protocol to login to Puppy system and enable "X11 forwarding" option from Putty options.
- enter root/yourRootPassword and you should see command prompt from Puppy system.
- Try to give "Geany &" command and you should see the Geany window on your Windows desktop even when it is running in Puppy system.
- For some reason "seamonkey" command doesnt work through remote X11, but Dillo browser does work.

If you don't use secured SSH X11 forwarding then you have to add the remote Puppy IP address to X0.hosts file in Xing application directory. By default there is only localhost and it works with SSH forwarding.

I find this great to do remote configuration or app installations in my keyboardless HTPC Puppy system. However, remote X11 is useful in many other areas too, so I hope you find this how-to usefull (well, this was sort of out-of-memory howto so I might have forgot something).

Goble
Posts: 21
Joined: Fri 30 Jun 2006, 07:28

#2 Post by Goble »

Ooops. Sorry. Posted this accidentally to wrong forum. I meant to post this to HOWTO forum, not in AdditionaSoftware. Maybe admins can move this thread?

User avatar
WiseOwl9000
Posts: 15
Joined: Mon 17 Apr 2006, 06:10
Location: Melbourne, Victoria, Australia
Contact:

Thanks

#3 Post by WiseOwl9000 »

That really helped me a lot. :D I'm using puppy 2.16 now and it has xauth so it was even easier!

Cheers.

Ben.

goncal
Posts: 71
Joined: Sun 09 Oct 2005, 18:11
Location: Girona, Spain
Contact:

Puppy 2.16 not X11 forwarding

#4 Post by goncal »

Hello

Thanks for your detailed, long post re X11 forwarding on Puppy.

I tried everything in your post and can now ssh remotely, but Puppy 2.16 sshd v.4.4 will not forward X11 no matter what I do to /etc/ssh/sshd_config

It is all the more frustrating as I did manage to get X11 forwarding working on a Macintosh G3 running Yellowdog 3.01 so that my two Puppy machines (1.0.5 and 2.16) ssh and the Mac will forward X11 to them.

After I ssh my Puppy 2.16 I log in remotely and everything is fine - it even says it is forwarding X11 in its debug log - but echo $DISPLAY outputs a blank line and of course executing any X11 application will open that application on the 2.16 machine, not on the remote terminal.

I am attaching a screenshot with two windows run on the same machine, the one on the right belongs to a successful ssh with X11 forwarding from Yellowdog, and the one on the left is what I get when I ssh Puppy 2.16 - you can barely see that echo $DISPLAY does not give the right result.

echo $DISPLAY on Yellowdog (after logging in through ssh) gives localhost:10.0 and executing xterm & will open an xterm window (with Yellowdog's graphical interface even which is slightly different from Puppy's). But echo $DISPLAY on Puppy 2.16 post ssh login gives - nothing. And setting DISPLAY manually like export DISPLAY=localhost:10.0 will not work - "could not open display" every time. I have tried everything - 192.168.0.9:0.0 (IP is that of the machine where ssh client originates), then <same>:0.0, :0, etc, nothing works.

I also tried everything re xauth -b and xhost + and setting /etc/hosts to 127.0.0.1 localhost puppypc, I even added the rest of computers on the LAN - but to no effect.

I thought I would get it running after everything was OK with my Mac - but I have spent some evenings and a full afternoon and been unable to get 2.16 to X11 forward even if I read everything I could get on the Internet regarding X11 forwarding. Well, it does not work. So I thought I would post this in case anyone could help me out.

Any help would be greatly appreciated!

Thanks and cheers

Gonçal

Post Reply