by DavidKirk
If you want to display your Linux desktop on your Windows PC, here is how you can go about it.
On your Windows PC, install Cygwin with XFree86 (or Xorg) and copy <cygwin_dir>/usr/X11R6/bin/startxdmcp.bat as <cygwin_dir>/usr/X11R6/bin/desktop.bat. If you edit startxdmcp.bat directly, all your changes will be lost if you update Cygwin.
Edit desktop.bat and change the following lines:
SET REMOTE_HOST=<ip address of the linux box>
run XWin -query %REMOTE_HOST% -fullscreen -clipboard -unixkill -nowinkill
On your Linux PC, edit kdmrc and enable XDMCP:
[Xdmcp]
Enable=true
Edit Xaccess and uncomment the following lines:
* #Any host can get a login window.
* CHOOSER BROADCAST #Any indirect host can get a chooser
Restart kdm with the command:
/etc/init.d/kdm restart
On my SuSE 9.2 box I just hit ALT-F2 and ran "kdesu gdmsetup". I enabled XDMCP in the last tab. Then I logged out and hit CTRL-ALT-Backspace to kill the Display Manager and reload it.
Run desktop.bat on the Windows PC. It should start an X server on your Windows PC and display a login prompt from your linux box. Once logged in you will have your normal Linux desktop. The only things that are different are that you can't use things like Alt-Tab, Ctrl-Alt-Del and maybe a few others. Some of these things can be changed in desktop.bat.
I've heard that XDMCP isn't the most secure way of displaying stuff remotely, so it is probably better to run individual Linux applications on your Windows desktop. Here's how I do it:
NOTE: if you already had Cygwin/X running, to display your Linux desktop as described above, you will need to log out and kill it (with CTRL-ALT-Backspace) before doing this next bit.
plink.exe -ssh -X -batch -l <your user id> -i <path to your private key> <linux hostname> <application>
-ssh means to use the secure shell protocol -X enables forwarding X to your PC -batch disables all interactive prompts -l <your user id> is the account you log in to the Linux box with -i <path to your private key> this is the key you generated with PuTTYgen <linux hostname> this is the name or IP address of your Linux box <application> this is the command you want to run on the Linux box (with the full path if necessary)
Here is how I run the Firefox web browser from my Linux box called kahlua:
plink.exe" -ssh -X -batch -l david -i c:\David.ppk kahlua firefox
You can create a new shortcut called "Firefox" on your desktop (or wherever you want) with that command in it so you can run your remote application by double clicking on it. Now you can copy that shortcut as many times as you like and just change the application on the end of the command. Don't forget to rename the shortcut once you have done it.
If you need more information about public-key authentication. Check out the excellent documentation for PuTTY at
http://the.earth.li/~sgtatham/putty/0.54/htmldoc/Contents.html.