Use putty and vnc to forward a linux desktop to a Window in XP

For this you will need the VNC viewer, I use vnc-4.0-x86_win32_viewer.exe.  I configure putty for port forwarding and then I open a window to the server that I want to connect to:

Next I set up the vnc viewer to use my forwarded port:

 

Finally, I have to make sure vnc on the server is lined up with the port I think it is:

This command must be run:

vncserver -geometry 1280×1024 -localhost

When I ran it, it actually connected to port 5, not 2. You only know this by looking in a log file.  Kill the session on 5 and clean up on /tmp files (or change your putty forwarding to be 5905 instead of 5902:


vncserver -geometry 1280x1024 -localhost

Warning: nad0019linux01:1 is taken because of /tmp/.X11-unix/X1
Remove this file if there is no X server nad0019linux01:1

New 'X' desktop is nad0019linux01:2

Starting applications specified in /home/jrigler/.vnc/xstartup
Log file is /home/jrigler/.vnc/nad0019linux01:2.log

 

 

~/.vnc/xstartup  (this gets run remotely when you connect, in this case, it starts gnome)


#!/bin/sh

xrdb $HOME/.Xresources
gnome 

You may also have to reset your vnc password on the server with the vncpasswd command.

Thats it.  It allows me to have a linux graphical environment (gnome) hosted on a pSeries Partition that I can get at from my Windows laptop.  I have two screens and can fill one with linux and when my mouse goes over there, everything works.  The only thing I can’t do is cut and paste into Windows:

 

More about colors

It seems like colors work a little different in AIX, the script below shows the output above:


#!/bin/bash
#
#   This file echoes a bunch of color codes to the
#   terminal to demonstrate what's available.  Each
#   line is the color code of one forground color,
#   out of 17 (default + 16 escapes), followed by a
#   test use of that color on all nine background
#   colors (default + 8 escapes).
#

T='gYw'   # The test text

echo -e "\n                 40m     41m     42m     43m\
     44m     45m     46m     47m";

for FGs in '    m' '   1m' '  30m' '1;30m' '  31m' '1;31m' '  32m' \
           '1;32m' '  33m' '1;33m' '  34m' '1;34m' '  35m' '1;35m' \
           '  36m' '1;36m' '  37m' '1;37m';
  do FG=${FGs// /}
  echo -en " $FGs \033[$FG  $T  "
  for BG in 40m 41m 42m 43m 44m 45m 46m 47m;
    do echo -en "$EINS \033[$FG\033[$BG  $T  \033[0m";
  done
  echo;
done
echo

Colors in bash

systhread.net

Name the following .dir_colors in your home directory, this overrides the obnoxious blue on black directory color (for this to work you have to have a special ls and alias it (alias ls=’ls –color=tty’)

OPTIONS -F -T 0
# Below, there should be one TERM entry for each termtype that is colorizable
TERM linux
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM cons25
TERM xterm
TERM rxvt
TERM xterm-color
TERM color-xterm
TERM vt100
TERM dtterm
TERM color_xterm
TERM ansi
TERM screen
TERM screen.linux
TERM kon
TERM kterm
TERM gnome
TERM konsole

EIGHTBIT 1

# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00   # global default, although everything should be something.
FILE 00     # normal file
DIR 00;36   # directory
LINK 00;35  # symbolic link
FIFO 40;33  # pipe
SOCK 01;35  # socket
BLK 40;32;00    # block device driver
CHR 40;32;00    # character device driver
ORPHAN 01;05;37;41  # orphaned syminks
MISSING 01;05;37;41 # ... and the files they point to
# This is for files with execute permission:
EXEC 00;33

# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
.cmd 00;32 # executables (bright green)
.exe 00;32
.com 00;32
.btm 00;32
.bat 00;32
.sh  00;32
.csh 00;32
.tar 00;31 # archives or compressed (bright red)
.tgz 00;31
.arj 00;31
.taz 00;31
.lzh 00;31
.zip 00;31
.z   00;31
.Z   00;31
.gz  00;31
.bz2 00;31
.bz  00;31
.tz  00;31
.rpm 00;31
.cpio 00;31
.jpg 00;35 # image formats
.gif 00;35
.bmp 00;35
.xbm 00;35
.xpm 00;35
.png 00;35
.tif 00;35