Compiling Rdesktop for Win32
So you wanna have an opensource RDP client for Windows. Well .. no problem. Here is what you do:
Visit www.cygwin.com and download setup.exe. When downloaded, you must launch setup.exe and install a complete Cygwin environment. Cygwin is only needed when compiling Rdesktop, so don´t worry about the diskspace usage. You will get it all back again, when deleting cygwin.
When Cygwin has been installed, it´s time to visit www.rdesktop.org, and download the latest release of the Rdesktop client. Save the tarball in the cygwin root folder, which defaults to c:\cygwin. At the time of writing, the latest version of Rdesktop is 1.6.0. When the package has been downloaded, it’s time to start the Cygwin XWin Server, and start compiling Rdesktop. Type the following commands into the shell, that starts with the X server:
tar -xf /rdesktop-1.6.0.tar.gz
cd rdesktop-1.6.0/
./configure --with-x --with-sound=oss; make; strip rdesktop.exe
Rdesktop has now been compiled (lucky you), and it’s time to collect all needed files for the RDP client, and create a single .zip file containing the Rdesktop Win32 distribution. Type the following commands into the shell for creating the Rdesktop distribution:
mkdir /Rdesktop-1.6.0-Win32
ldd rdesktop.exe | perl -ane 'print "cp \"$F[2]\" \"/Rdesktop-1.6.0-Win32\"\n" if !/cygdrive/i;' | sh
cp rdesktop.exe /Rdesktop-1.6.0-Win32
cp -r keymaps /Rdesktop-1.6.0-Win32
zip -9rq /Rdesktop-1.6.0-Win32.zip /Rdesktop-1.6.0-Win32/*
By now you should have a Rdesktop distribution in your Cygwin root, named Rdesktop-1.6.0-Win32.zip. This .zip file contains all you need, to connect to your RDP compliant hosts (ie. Windows hosts), from any Win32 computer:
rdesktop.exe [hostname]
Troubleshooting:
If you are having trouble with compiling your own Rdesktop client, you may choose to download the package that I created for this article: Rdesktop-1.6.0-Win32.zip
If you should see the following error message:
ERROR: Failed to open display:
.. then your X-server is not running (download and install Xming if you need one), or your DISPLAY environment variable is not set. Set the needed variable with this command:
set DISPLAY=127.0.0.1:0
New additions to this post:
18/04/2011: Rdesktop-1.7.0-Win32.zip has been compiled using this guide.
30/03/2012: Rdesktop-1.7.1-Win32.zip has been compiled using this guide – and a slightly modified version has been created for creating a Windows Installer MSI: Rdesktop-1.7.1-Win32.msi
30/10/2019: Rdesktop-1.9.0-Win32.zip has been compiled for your benefit, and a Windows Installer MSI has been created as well: Rdesktop-1.9.0-Win32.msi
January 24, 2010 - 19:39
So I followed the instructions to the letter and it goes wrong just here.
bash-3.2$ ./configure
./configure: line 12: $’\r’: command not found
./configure: line 23: syntax error near unexpected token `$’in\r”
‘/configure: line 23: ` case `(set -o) 2>/dev/null` in
bash-3.2$
January 24, 2010 - 20:22
deleted the src and tried again and it worked this time. I must have corrupted the src files when I was looking at it last week.
April 23, 2011 - 05:53
Thanks for being so quick with 1.7.0!
December 2, 2011 - 08:57
Hi,
I have followed your instructions but unfortunately key sequences like Alt-Tab or WinKey are not being passed to the remote desktop…
I have tried it with and without -K switch but it does not help…
Any idea?
April 5, 2013 - 12:49
Hello,
i got problems on Windows 7 using Printer redirect. RDP exit and error STATUS_ACCESS_VIOLATION occur.
I already disabled Windows DEP.
Can you test it? Is it possible to compile rdesktop using this cygwin solution?
http://x-aeon.com/wp/2011/08/05/no-more-status_access_violation-on-cygwin-under-windows7/
Thank you!
February 13, 2014 - 00:02
So, can this be used to add Remote Desktop Capabilities to Windows 2000?
February 13, 2014 - 08:30
Sure thing. :-)
June 5, 2014 - 09:39
Hi, I’ve tried to follow your guide but when I compile the project a error message appears:
CredSSP support requires libgssglue, install the dependency
What am I missing? Could you help?
Thanks in advance!
October 6, 2015 - 16:22
You will need to disable the “Only allow connections from computers running NLA” option under Remote Desktop settings in Windows. This will resolve that issue for you.
June 4, 2020 - 17:17
Have you been able to get the clipboard to work? Everything else seems to work, but the clipboard is dead.
I also get this warning in the console:
Clipboard(warning): xclip_handle_SelectionRequest(), unsupported target format, target=’COMPOUND_TEXT’