<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="content-language" content="en" />
<meta name="robots" content="index,follow" />
<meta name="description" content="On your Windows PC, install Cygwin with XFree86 (or Xorg) and copy &lt;cygwin_dir&gt;/usr/X11R6/bin/startxdmcp.bat as &lt;cygwin_dir&gt;/usr/X11R6/bin/desktop.bat.  If you edit startxdmcp.bat directly, all your changes will be lost if you update Cygwin." />
<meta name="keywords" content="Cygwin, CLUG" />
<meta name="language" content="en" />
<meta name="document-type" content="Public" />
<meta name="document-rating" content="General" />

<meta name="PHPWIKI_VERSION" content="1.3.11pre" />
<base href="http://clug.net.nz/index.php/" />
<link rel="shortcut icon" href="http://clug.net.nz/themes/default/images/favicon.ico" />
<link rel="home" title="Canterbury Linux Users Group" href="http://clug.net.nz/index.php/Canterbury%20Linux%20Users%20Group" />
<link rel="help" title="HowToUseWiki" href="http://clug.net.nz/index.php/HowToUseWiki" />
<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1" />
<link rel="author" title="The PhpWiki Programming Team" href="http://phpwiki.sourceforge.net/phpwiki/ThePhpWikiProgrammingTeam" />
<link rel="search" title="FindPage" href="http://clug.net.nz/index.php/FindPage" />
<link rel="alternate" title="View Source: Cygwin" href="http://clug.net.nz/index.php/Cygwin?action=viewsource&amp;version=5" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://clug.net.nz/index.php/RecentChanges?format=rss" />

<link rel="bookmark" title="SandBox" href="http://clug.net.nz/index.php/SandBox" />
<link rel="bookmark" title="WikiWikiWeb" href="http://clug.net.nz/index.php/WikiWikiWeb" />

<link rel="stylesheet" type="text/css" charset="iso-8859-1" href="http://clug.net.nz/themes/MacOSX/MacOSX.css" />
<link rel="stylesheet" type="text/css" charset="iso-8859-1" href="http://clug.net.nz/themes/default/phpwiki-printer.css" media="print" />
<link rel="alternate stylesheet" type="text/css" charset="iso-8859-1" href="http://clug.net.nz/themes/default/phpwiki-printer.css" title="Printer" />
<link rel="alternate stylesheet" type="text/css" charset="iso-8859-1" href="http://clug.net.nz/themes/MacOSX/MacOSX-topbottombars.css" title="Top &amp; bottom toolbars" />
<style type="text/css">
<!--
body {background-image: url(/themes/MacOSX/images/bgpaper8.png);}
-->
</style>
<title>CLUG - Cygwin</title>
</head>
<body>

<div id="header">  <!-- The logo -->
<div align="right" id="logo"><a class="wikilink" 
                  href="Canterbury%20Linux%20Users%20Group" target="_top"
                  ><img src="/themes/default/images/logo.png" id="logo-img"
                        border="0" alt="CLUG: Canterbury Linux Users Group"
                        align="right" /></a></div>

<!-- The top navigation/search bar -->
<div class="toolbar"><!-- The top navigation/search bar -->
<form action="TitleSearch" target="_top"
      method="get" accept-charset="iso-8859-1">
<div id="navbuttons">
<a href="RecentChanges" class="wiki"><img src="/themes/MacOSX/buttons/en/RecentChanges.png" alt="RecentChanges" class="wiki-button" border="0" /></a><a href="FindPage" class="wiki"><img src="/themes/MacOSX/buttons/en/FindPage.png" alt="FindPage" class="wiki-button" border="0" /></a>&nbsp;<input type="hidden" name="auto_redirect" value="1" />
<input type="hidden" name="nocache" value="purge" />
<input type="text"  name="s" size="12" maxlength="256"
       title='Quick Search'
       onmouseover="window.status='Quick Search'; return true;"
       onmouseout="window.status=''; return true;" />
<a href="Cygwin?action=LikePages" class="wiki"><img src="/themes/MacOSX/buttons/en/LikePages.png" alt="LikePages" class="wiki-button" border="0" /></a><a href="Cygwin?action=BackLinks" class="wiki"><img src="/themes/MacOSX/buttons/en/BackLinks.png" alt="BackLinks" class="wiki-button" border="0" /></a></div>
</form>
</div>

<!-- Page title -->
<h1><a href="Cygwin?action=BackLinks" class="backlinks" title="BackLinks for Cygwin" onmouseover="window.status=&quot;BackLinks for Cygwin&quot;; return true;" onmouseout="window.status='';return true;">Cygwin</a></h1>
</div>


<div class="wikitext"><h3>Linux desktop on a Windows PC</h3>
<p class="tightenable top">by <a href="DavidKirk" class="wiki">DavidKirk</a></p>
<p class="tightenable">If you want to display your Linux desktop on your Windows PC, here is how you can go about it.</p>
<p class="tightenable">On your Windows PC, install Cygwin with XFree86 (or Xorg) and copy &lt;cygwin_dir&gt;/usr/X11R6/bin/startxdmcp.bat as &lt;cygwin_dir&gt;/usr/X11R6/bin/desktop.bat.  If you edit startxdmcp.bat directly, all your changes will be lost if you update Cygwin.</p>
<p class="tightenable">Edit desktop.bat and change the following lines:</p>
<pre class="tightenable">
        SET REMOTE_HOST=&lt;ip address of the linux box&gt;

        run XWin -query %REMOTE_HOST% -fullscreen -clipboard -unixkill -nowinkill</pre>
<h4>If you use KDM</h4>
<p class="tightenable top bottom">On your Linux PC, edit kdmrc and enable XDMCP:</p>
<pre class="tightenable top">
        [Xdmcp]
        Enable=true</pre>
<p class="tightenable bottom">Edit Xaccess and uncomment the following lines:</p>
<pre class="tightenable top">
        *                               #Any host can get a login window.
        *       CHOOSER BROADCAST       #Any indirect host can get a chooser</pre>
<p class="tightenable">Restart kdm with the command:</p>
<pre class="tightenable">
        /etc/init.d/kdm restart</pre>
<h4>If you use GDM</h4>
<p class="tightenable top">On my SuSE 9.2 box I just hit ALT-F2 and ran &quot;kdesu gdmsetup&quot;. I enabled XDMCP in the last tab.  Then I logged out and hit CTRL-ALT-Backspace to kill the Display Manager and reload it.</p>
<h4>Give it a try</h4>
<p class="tightenable top">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.</p>
<h3>Linux apps on your Windows Desktop</h3>
<p class="tightenable">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:</p>
<p class="tightenable">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.</p>
<ol><li class="tightenable">Run &lt;cygwin_dir&gt;/usr/X11R6/bin/startxwin.bat.  This will run X in multi-window mode.  You will se an X icon in your system tray.</li>
<li class="tightenable">Now ssh or telnet in to your linux box (with X forwarding enabled) and run your favourite Linux application.  It should start up on your Windows desktop.</li>
<li class="tightenable">To make this easier, you could install the PuTTY suite of programs that includes PuTTY, PSCP, PSFTP, Plink, PAgent and PuTTYgen.</li>
<li class="tightenable">Use PuTTYgen to generate a public and private key.  Copy the public key to the clipboard and paste it in to .ssh/authorized_keys on your linux box.</li>
<li class="tightenable">Now run PAgent and load your private key.  You will be prompted to enter your pass phrase.  Once you have typed it in you won't have to do it again until the next time you load PAgent (which would usually be after a reboot).</li>
<li class="tightenable">Now you can use Plink to run your Linux app:</li>
</ol>
<pre class="tightenable">
        plink.exe -ssh -X -batch -l &lt;your user id&gt; -i &lt;path to your private key&gt; &lt;linux hostname&gt; &lt;application&gt;</pre>
<pre class="tightenable">
-ssh means to use the secure shell protocol
-X enables forwarding X to your PC
-batch disables all interactive prompts
-l &lt;your user id&gt; is the account you log in to the Linux box with
-i &lt;path to your private key&gt; this is the key you generated with PuTTYgen
&lt;linux hostname&gt; this is the name or IP address of your Linux box
&lt;application&gt; this is the command you want to run on the Linux box (with the full path if necessary)</pre>
<p class="tightenable">Here is how I run the Firefox web browser from my Linux box called kahlua:</p>
<pre class="tightenable">
        plink.exe&quot; -ssh -X -batch -l david -i c:\David.ppk kahlua firefox</pre>
<p class="tightenable">You can create a new shortcut called &quot;Firefox&quot; 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.</p>
<p class="tightenable bottom">If you need more information about public-key authentication.  Check out the excellent documentation for PuTTY at <a href="http://the.earth.li/~sgtatham/putty/0.54/htmldoc/Contents.html" class="namedurl"><span style="white-space: nowrap"><img src="/themes/MacOSX/images/http.png" alt="" class="linkicon" border="0" />http://the.earth.li/~sgtatham/putty/0.54/htmldoc/Contents.html</span></a>.</p>
</div>

</body>






</html>