Written by James McDonald

May 15, 2008

PuTTY is an excellent Telnet and SSH client for Windows and Unix. I have used it for all my IT Career to access my Home and Work Linux boxes.

I now exclusively use Linux at home, but found the GTK1.2 PuTTY client to be a bit aged. However, while not listed as a download on the main website there are links to the GTK2 version which has been ported. Update: The Putty GTK2 client is now part of the main trunk for development. I have updated the svn paths below to reflect this.

To compile your own copy:
Install requirements as noted in comment from Thomas Novin below:

sudo apt-get install gcc-3.4 # thanks to comment from Loren below
sudo apt-get install build-essential libgtk2.0-dev halibut
sudo apt-get build-dep putty
sudo apt-get install libkrb5-dev

Halibut is required or you will get the error listed below

svn co svn://svn.tartarus.org/sgt/putty
cd putty
./mkfiles.pl # you need to run this to generate the Makefile.gtk used below 

Generate the documentation

cd doc
make
cd ../unix

Ubuntu 9.04 compile: Just tried to compile and didn’t need to change compiler versions using sed as below however did remove the -Werror from the CFLAGS line.

Ubuntu 8.10 compile: Thanks to the comment by Jayson for Ubuntu 8.10 you need to explicity define an older compiler version by finding and replacing “CC = $(TOOLPATH)cc” with “CC = $(TOOLPATH)gcc-3.4” which you can do with sed as follows.

sed -i.bak 's/)cc/)gcc-3.4/' Makefile.gtk 

The above sed command means perform an inplace edit of Makefile.gtk but first make a backup copy with a .bak extension look for )cc and replace it with )gcc-3.4.

cd putty/unix

Compile putty and associated binaries

make -f Makefile.gtk

The result should be plink, pscp, psftp, pterm, putty, puttygen and puttytel binaries in the unix directory.

You can then get root and run

make -f Makefile.gtk install

to move the binaries to /usr/local/bin.

Obviously you must have the gcc tool chain and the Gtk2 development libraries installed. Mine compiled first go so I’m not sure of what the exact dependencies are required to compile it. To find out run make -f Makefile.gtk and read the error messages for clues on what may be missing.

putty-gtk2

Problems:
Dcoumentation Error
When running:

sudo make -f Makefile.gtk install

from $putty_root/unix
Error:

cannot stat `../doc/plink.1': No such file or directory

Fix:

sudo apt-get install halibut
cd ../doc
make
cd ../unix
sudo make -f Makefile.gtk

14 Comments

  1. cwraig

    Wow, i have used this for years on windows to get a shell on my Linux servers but i never thought to give the Linux version a shot.
    Thanks for the hint

    Reply
  2. Moony

    I downloaded a dev snapshot of PuTTY with gtk2 enabled, however, it operates really slowly when selecting, scrolling, and doing listings. Basically, anything that moves a lot of text around on the screen. Has anybody else noticed this behavior?

    Reply
  3. Moony

    Let me also mention that this applies only when using antialiased fonts (the main reason IMO to have GTK2 support). Normal bitmap fonts seem to work at full speed in the GTK2 enabled version.

    Reply
  4. James

    I will have to try this myself. I set the anti-alias option when using it but maybe I wasn’t using the aa’d fonts.

    Reply
  5. Thomas Novin

    In Ubuntu, all you need to install in addition to build-essentials is libgtk2.0-dev (and dependencies) to be able to compile it.

    Reply
  6. Whoopie

    Hi,

    Are you working on getting this upstream?

    Reply
  7. Altuhov Dmitriy

    What about adding compiled package PuTTY with GTK2 into Ubuntu Intrepid packages?

    Reply
  8. Konstantin Schekotoff

    Can’t compile on Ubuntu Interpid:

    ks@ks-nb:~/svn/putty/unix$ make -f Makefile.gtk
    cc -O2 -Wall -Werror -g -I.././ -I../charset/ -I../windows/ -I../unix/ -I../mac/ -I../macosx/ `sh -c ‘pkg-config gtk+-2.0 $0 2>/dev/null || gtk-config $0’ –cflags` -D _FILE_OFFSET_BITS=64 `krb5-config –cflags gssapi` -c ../logging.c
    cc1: warnings being treated as errors
    ../logging.c: In function ‘logwrite’:
    ../logging.c:46: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
    make: *** [logging.o] Error 1

    Any suggestions?

    Reply
  9. james

    For Ubuntu 8.10 I ended up opening Makefile.gtk and removing “-Werror” from the “CFLAGS = -O2 -Wall -Werror …” line

    Then running make -f Makefile.gtk completes. The resulting binary seems to work fine.

    Reply
  10. james

    @Whoopie
    No, sorry. I haven’t the Debian/Redhat packaging abilities (as yet) to attempt to get it injected into the Ubuntu repositories.

    Reply
  11. Jayson Reis

    Great job.
    To compile in ubuntu enter in unix directory and execute ‘cat Makefile.gtk |sed ‘s/)cc/)gcc-3.4/’>temp&&mv temp Makefile.gtk’ without quotes and don’t forget to install gcc-3.4
    Cheers
    Jayson

    Reply
  12. Loren M. Lang

    For Ubuntu 8.10, don’t forget to also sudo apt-get install gcc-3.4 in addition to the previously mentioned sed script.

    Reply
  13. wknight

    Following your instructions, I was able to compile putty, on the first try. in Ubuntu Jaunty,and it does look better. But I was hopping this would solve a problem I am having with putty since I installed Ubuntu Jaunty on my 64 bit laptop, and that is in putty’s terminal display, it seams as if my display is split in half horizontally, when I scroll lines of text disappear and reappear in the middle sometimes twice, if I use vi or some other application in the terminal, when I exit them the terminal only refreshes the upper half of the display. This might be a problem with some other component putty uses I am not sure. If someone could give me a hand it would be greatly appreciated.

    Reply
  14. Steve

    @wknight, I see this behavior as well. I think it is related to my choice of vi color scheme + vt100 16 color + gnu screen. Not sure which handle is screwing this up. Contact me at slestak989 – at – gm…l.com <– (you know the company) if you want to compare notes.

    Reply

Leave a Reply to Whoopie Cancel reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…