windows.html 47.9 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="content-type">
  <title>Windows XP in Emulab</title>
</head>
<body>
<!--
   EMULAB-COPYRIGHT
Leigh B. Stoller's avatar
Leigh B. Stoller committed
11
   Copyright (c) 2000-2005 University of Utah and the Flux Group.
12
13
14
15
16
17
18
19
20
   All rights reserved.
  -->
<h2>Windows XP in Emulab</h2>
<h3>Table of Contents:</h3>
<ol>
  <li> <a href="#Overview"> Overview </a></li>
  <li> <a href="#Differences">Differences from FreeBSD and Linux in Emulab </a></li>
  <ul>
    <li> <a href="#Windows_Passwords"> Windows Passwords </a></li>
21
    <li> <a href="#Experiment_setup"> Experiment setup for Windows nodes </a></li>
22
    <li> <a href="#Network_config"> Network config </a></li>
Russ Fish's avatar
Russ Fish committed
23
24
25
    <li> <a href="#Routing"> Routing </a></li>
    <li> <a href="#Firewalls"> Firewalls </a>
         <img src="../new.gif" alt="&lt;NEW&gt;"></li>
26
27
    <li> <a href="#Boots_twice"> Windows nodes boot twice </a></li>
    <li> <a href="#Login_connections"> Login connections to Windows </a></li>
28
    <li> <a href="#RDP_details"> RDP details </a></li>
29
    <li> <a href="#Custom_images"> Making custom Windows OS images </a></li>
30
31
32
  </ul>
  <li> <a href="#Cygwin"> Cygwin </a> </li>
  <ul>
33
    <li> <a href="#Cygwin_documentation"> Cygwin documentation </a></li>
34
    <li> <a href="#Cygwin_packages"> Cygwin packages </a></li>
35
36
37
38
    <li> <a href="#SMB_mounts"> SMB mounts and Samba </a>
         <img src="../new.gif" alt="&lt;NEW&gt;"></li>
    <li> <a href="#Cygwin_arcana"> Cygwin arcana </a>
         <img src="../new.gif" alt="&lt;NEW&gt;"></li>
39
40
  </ul>
  <li> <a href="#NtEmacs"> NtEmacs </a></li>
41
  <li> <a href="#DotNet"> Microsoft .Net Runtime </a></li>
Russ Fish's avatar
Tweaks.    
Russ Fish committed
42
43
  <li> <a href="#Changes"> Change Log </a>
         <img src="../new.gif" alt="&lt;NEW&gt;"></li>
44
  <li> <a href="#Future"> Future Work </a></li>
45
46
47
48
49
</ol>

<hr style="width: 100%; height: 2px;">
<h3><a name="Overview"> </a> Overview </h3>

50
51
Microsoft <i>Windows XP</i> is now supported as one of the operating system
types for experiment nodes in Emulab, in addition to FreeBSD and Linux.
Russ Fish's avatar
Russ Fish committed
52
<a href="../kb-show.php3?xref_tag=SWS-WIN2K">Windows 2000</a> is not supported. <p>
53

Russ Fish's avatar
Russ Fish committed
54
55
As much as possible, we have left Windows XP "stock".  Some Windows services
are shut down: Messenger, SSDP Discovery Service, Universal Plug and Play
Russ Fish's avatar
Russ Fish committed
56
57
58
Device Host, and Remote Registry.  Other setting changes are described under 
<a href="#Network_config"> Network config </a> and
<a href="#Routing"> Routing </a> below.  <p>
59
60
61
62

Before booting the node at swap-in time, Emulab loads a 
<a href="#Experiment_setup"> fresh image of Windows XP </a>
onto the experiment nodes in parallel, using our <code>frisbee</code> service.
Russ Fish's avatar
Russ Fish committed
63
Emulab software automatically configures each Windows XP node, providing the
64
65
expected experiment user environment including: user accounts and Emulab SSH
keys; remote home, project, and shared directories; and network connections.
Russ Fish's avatar
Russ Fish committed
66
67
All of the Emulab experiment automation and monitoring services have been ported
to run on Windows.
68
<p>
69

70
71
The <a href="#Cygwin"> Cygwin GNU </a> environment is provided, 
including Bash and TCSH shells, the
72
73
74
C/C++, Perl and Python programming languages, and several editors including
Emacs, vim, nano and ed.  <p>

75
76
The Emulab web interface manages a separate <a href="#Windows_Passwords"> 
Windows password </a> in the user
Russ Fish's avatar
Russ Fish committed
77
profile, as well as making <a href="#Login_connections"> login
78
connections </a> to the experiment nodes.
79
Remote Desktop Protocol service supports Windows Desktop logins from the
Russ Fish's avatar
Russ Fish committed
80
81
user's workstation screen to the experiment node.  SSH and Serial Console
command-line connections are also supported.  <p>
82

83
<i>Windows XP</i> installations are more hardware dependent than Linux or
Russ Fish's avatar
Russ Fish committed
84
85
86
FreeBSD.  At present, this <i>Windows XP</i> image only runs on the Emulab <a
href="../shownodetype.php3?node_type=pc850"> pc850 </a> and <a
href="docwrapper.php3?docname=pc3000.html"> pc3000 </a>node types.  <p>
87
88
89
90
91

<hr style="width: 100%; height: 2px;">
<h3><a name="Differences"></a> Differences from FreeBSD and Linux in Emulab </h3>

The biggest difference of course, is that this is <b>Windows</b> (!), with
Russ Fish's avatar
Russ Fish committed
92
93
94
Cygwin layered on top, and Emulab management services added.  In particular,
this is Windows XP (NT 5.1), with various levels of service packs and updates
(see <a href="#Experiment_setup">below</a>.) <p>
95
96
97
98
99

The second-biggest difference is that shared directories are provided not by
the NFS (Network File System) protocol, but instead by the <b>SMB</b> (Server
Message Block) protocol, otherwise known as Windows File Sharing.  The Client
for Microsoft Networks software contacts the SMB server, in this case
Russ Fish's avatar
Russ Fish committed
100
101
<b>Samba</b> running on the file server known as <b>Fs</b> (an alias for
<b>Users</b>.)  The SMB protocol
102
103
authenticates using a plain-text user name and password, encrypted as they go
across the network.  (These Windows Shares are then accessed by UNC paths
Russ Fish's avatar
Russ Fish committed
104
under Cygwin mounts, <a href="#SMB_mounts">described below</a>.) <p>
105
106
107
108

<h4><a name="Windows_Passwords"> </a> Windows Passwords </h4>

A separate <b>Windows password</b> is kept for use only with experiment nodes
Russ Fish's avatar
Russ Fish committed
109
110
111
112
113
114
running Windows.  It is presented behind-the-scenes to <code>rdesktop</code>
for RDP logins by our Web interface under Unix, and for the Samba mount of
shared directories like your home directory under an ssh login, so you don't
have to type it in those cases.  You <u>will</u> have to type it each time if
you use the <a href="#Login_connections"> Microsoft RDC (Remote Desktop
Connector) client program</a> from a Windows machine.<p>
115
116
117
118
119

The default Windows password is randomly generated.  It's easy to change it to
something easier to remember. <p>

To see or edit your Windows password, log in to Emulab, and click <b>Manage
Russ Fish's avatar
Russ Fish committed
120
User Profile</b> and then <b>Edit Profile</b> under <b>User Options</b>.  You
121
122
123
124
125
126
127
128
129
130
will see <b>Windows Password</b> fields in addition to the regular Emulab
<b>Password</b> fields. <p>

When you change your Windows password, you will also have to re-type it as a
check.  The new Windows password should propagate to the Samba server on Fs
instantly, so you can swap in an experiment and log in to its Windows nodes
with the new password. <p>

If you have already swapped-in experiment nodes and change your Windows
password, the account information including passwords will be updated at the
Russ Fish's avatar
Russ Fish committed
131
132
next Emulab watchdog daemon <code>isalive</code> interval.  This should be in
3 to 6 minutes. <p>
133

134
<h4><a name="Experiment_setup"> </a> Experiment setup for Windows nodes </h4>
135
136

All you have to do is put a line specifying a WINXP OS image in your
Russ Fish's avatar
Russ Fish committed
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
experiment .ns file, like this:
<pre>
    tb-set-node-os $node WINXP-UPDATE
    tb-set-hardware $node pc850
</pre>

Notice that the above image only runs on the <a
href="../shownodetype.php3?node_type=pc850"> pc850 </a> Emulab node type.  At
present, you have to explicitly specify a different image name and hardware
type to run on the <a href="docwrapper.php3?docname=pc3000.html"> pc3000's
</a>.  For example:
<pre>
    tb-set-node-os $node WINXP-UPDATE-pc3000
    tb-set-hardware $node pc3000
</pre>

153

154
Currently available Windows XP images are:
155
156
157

<ul>

Russ Fish's avatar
Russ Fish committed
158
159
160
161
162
163
  <li><b>WINXP-UPDATE</b> (pc850), and <b>WINXP-UPDATE-pc3000</b> - Windows
  XP-SP2+.  These are updated periodically from Windows Update, typically after
  a Microsoft "Patch Tuesday", the second Tuesday of each month.  All critical
  and security fixes are installed, up through the date we pull the image
  file. (See the date created field on the individual WINXP <a
  href="https://www.emulab.net/showimageid_list.php3"> Image ID's </a>).  <p>
164

Russ Fish's avatar
Russ Fish committed
165
  Note: The Windows Firewall is disabled by default (as it will inform you
Russ Fish's avatar
Russ Fish committed
166
  repeatedly!)
167
168
  </li>

Russ Fish's avatar
Russ Fish committed
169
170
171
172
173
174
175
  <li><b>WINXP-SP2(-pc3000)</b> - Windows XP-SP2.  This has the original SP2 on it,
  with no Windows Update modifications beyond that.  (SP2 includes SP1.)
  </li>

  <li><b>WINXP-SP1(-pc3000)</b> - Windows XP-SP1a.  This is intended for
  software (in)security work, and has only the updated version of SP1
  (a.k.a. SP1a) installed.
176
177
  </li>

Russ Fish's avatar
Russ Fish committed
178
179
180
181
182
183
184
185
186
  <li><b>WINXP-SP0(-pc3000)</b> - Windows XP, from the original 2001 MSDN CD,
  with the Emulab client-side management code ported to it.  This is intended
  for software (in)security work, and has no service packs at all.
  </li>

  <li><b>WINXP-BASE(-pc3000)</b> - Raw Windows XP, from the original 2001 MSDN
  CD.  There is no Emulab client-side <a href="#Overview"> management code
  </a> to set up and operate the node, or even Cygwin.  This is only useful
  for building custom images completely from scratch.
187
  </li>
188
189
190

</ul>

Russ Fish's avatar
Russ Fish committed
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<h4><a name="Network_config"> </a> Network config </h4>

Some default Windows networking features are disabled.  <i>NetBT (NetBios over
TCP)</i> (<a
href="http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/DepKit/40c09844-a669-463c-94dc-7ccf7214083d.mspx">
NetbiosOptions=2 </a>) and <i>DNS auto-registration</i> (<a
href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;q246804">
DisableDynamicUpdate=1 </a>) are disabled to allow network <a
href="../docwrapper.php3?docname=swapping.html#idleness"> idle detection </a>
by the <code>slothd</code> service.  <i>TCP/IP address autoconfiguration</i>
is disabled (<a
href="http://www.microsoft.com/resources/documentation/Windows/2000/server/reskit/en-us/Default.asp?url=/resources/documentation/Windows/2000/server/reskit/en-us/regentry/58861.asp">
IPAutoconfigurationEnabled=0 </a>) so that unswitched interfaces like the
sixth NICs on the pc3000's don't get bogus Microsoft class B network
169.254.0.0 addresses assigned.  <p>

The Emulab pc850 node type has five network interfaces, and the pc3000 has
six.  However, the Windows <b><code>ipconfig /all</code></b> command only
shows the configuration information for the enabled network interfaces.  There
will always be one enabled <a
href="../tutorial/docwrapper.php3?docname=tutorial.html#ControlNet"> control net
</a> interface on the 155.98.36 network.  The others are disabled if not used
in your experiment.  <p>

If you specified links or LANs in your experiment <a
href="../tutorial/docwrapper.php3?docname=tutorial.html#Designing"> network
topology </a>, other interfaces will be enabled, with an IP address, subnet
mask, and gateway that you can specify in the NS file.

Notice that the Windows names of the interfaces start with <b><code>Local Area
Connection</code></b> and have a number appended.  You can't count on what this
number is, since it depends on the order the NIC's are probed as Windows
boots. <p>

<div style="margin-left: 40px;"> <b>NOTE:</b> Sometimes we have seen
<code>ipconfig</code> report an ip address and mask of <code>0.0.0.0</code>,
while the TCP/IP properties dialog boxes show the proper values.
<code>ipconfig</code> is wrong.  </div>

230
231
<h4><a name="Routing"> </a> Routing </h4>

Russ Fish's avatar
Russ Fish committed
232
233
234
235
236
237
238
Full-blown router nodes can not run Windows, i.e. <b><code>rtproto
Session</code></b> is not supported.  However, basic routing between connected
network components of your experiment topology works.  The Windows command to
see the routing tables is <b><code>route print</code></b>.  The <a
href="http://www.microsoft.com/windows2000/en/advanced/help/default.asp?url=/windows2000/en/advanced/help/sag_TCPIP_pro_EnableForwarding.htm">
IPEnableRouter=1 </a> registry key is set on multi-homed hosts in the
experiment network, before they are rebooted to change the hostname.<p>
239

Russ Fish's avatar
Russ Fish committed
240
241
<b><code>rtproto Static</code></b> is supported in all recent WINXP images,
but not in WINXP-02-16 or before. <p>
242
243
244

<b><code>rtproto Static-old</code></b> or <b><code>rtproto Manual</code></b>
will work in any image.<p>
245

246
There is more information on routing in the <a
247
href="../tutorial/docwrapper.php3?docname=tutorial.html#Routing">
248
249
Routing Section of the Emulab Tutorial. </a><p>

Russ Fish's avatar
Russ Fish committed
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<h4><a name="Firewalls"> </a> Firewalls </h4>

Emulab.net is outside the University of Utah firewall, with only a minimal <a
href="../kb-show.php3?xref_tag=SI-FW"> outer firewall </a>, to allow free network
experimentation.  Even though we have closed most low-numbered ports, your
Windows XP experiment nodes are still exposed to the wider Internet on higher
port numbers.  <p>

If your experiment does not require that full freedom, consider adding a <a
href="../tutorial/docwrapper.php3?docname=firewall.html"> control net firewall
node </a> statement to your experiment ns file.  This allows you to control
the <a href="../tutorial/docwrapper.php3?docname=secure.html"> security level
</a> of your connection to the Internet by a <a
href="../tutorial/docwrapper.php3?docname=firewall.html#Use"> style keyword
</a>, for example:
<pre>
    set fw [new Firewall $ns]
    $fw set-type ipfw2-vlan
    $fw set-style basic
</pre>
270

271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<div style="margin-left: 40px;"> <b>NOTE:</b> There is currently a problem
which makes swapping-in Windows nodes behind a control-net firewall take
longer or fail, especially on the pc850's.  <p>

Details: DHCP packets aren't passed until the firewall node is loaded with
FreeBSD and started up.  That takes 3-4 minutes on a pc850 and leaves the
Windows nodes in the FreeBSD PXE-loader image waiting for DHCP.  Periodically,
they time-out and reload the PXE-loader, which adds up to another minute after
the firewall node is up, if you're unlucky.  <p>

After 10 minutes in the reloading state, Emulab gives up and reboots the node
to try again, even if Frisbee is working hard and nearly done.  5-6 minutes is
hardly enough time to Frisbee a WINXP image into a pc850.  Either the image
load time-out needs to be extended in experiments that have a firewall
configured, or the load timer shouldn't start ticking until the firewall is
up. </div>

Russ Fish's avatar
Russ Fish committed
288
289
290
The <i>Windows Firewall</i> software is installed in WINXP-SP2 and
WINXP-UPDATE images, but disabled to allow RDP and SSH access to Windows
nodes.  <p>
291

292
<h4><a name="Boots_twice"> </a> Windows nodes boot twice </h4>
293

294
295
296
297
298
299
300
301
302
303
304
305
306
307
Notice that Windows reboots an extra time after being loaded onto a node
during swap-in.  It has to reboot after changing the node name to set up the
network stack properly.  Be patient, Windows doesn't boot fast. <p>

It's best not to log in to the nodes until the experiment is fully swapped-in.
(You may be able to log in briefly between the first two reboots; if you see
the wrong pcXXX name, you'll know that a reboot is imminent.)  You can know
that the swap-in process is finished by any of these methods:
<ul>
  <li> Waiting until you get the "experiment swapped in" email from Emulab.
  <li> Checking the node status on the experiment status page in Emulab.
       (You have to refresh the page to see node status change.)
  <li> Watching the realtime swap-in log to monitor its progress.
</ul>
308
309
310
311
312
313
314
315

<div style="margin-left: 40px;"> <b>NOTE:</b> Sometimes we have seen Windows
XP fail to do the second reboot.  We're working on it.  If you try to login
after swap-in and your Windows password isn't honored, use this command on Ops
to remotely reboot the node:<pre>    node_reboot pcxxx</pre>

If you are able to log in but your remote home directory isn't mounted, you
have the additional option of executing this command on
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
the node itself: <pre>    /sbin/reboot</pre>

The EmulabStartup service runs <code>/usr/local/etc/emulab/rc/rc.bootsetup</code>,
logging output to <code>/var/log/bootsetup.log</code>.  If you're having swap-in
problems and rc.bootsetup doesn't finish sending <code>ISUP</code> to Emulab within
10 minutes, the node will be rebooted.  After a couple of reboot cycles without a
<code>ISUP</code>, Emulab gives up on the node.  <p>

If you want to prevent swap-in failure, whether to diagnose the problem or to continue
manually, you may add this line to your
<a href="../tutorial/docwrapper.php3?docname=nscommands.html"> ns file </a>
for each Windows node: <br>
&nbsp; &nbsp; &nbsp; &nbsp; <code>
    <a href="../tutorial/docwrapper.php3?docname=nscommands.html#tb-set-node-failure-action"> 
    tb-set-node-failure-action</a> <i>$node</i> "nonfatal"
</code>  <br>
(where <code><i>$node</i></code> is replaced with the node variable, of course.)
<p>

It will still complain if it doesn't get the ISUP signal at the end of rc.bootsetup,
but the swap-in will proceed and allow you to figure out what's happening.  </div>
337

338
<h4><a name="Login_connections"> </a> Login connections to Windows </h4>
339

Russ Fish's avatar
Russ Fish committed
340
341
You can manually start up the SSH or RDP client programs to connect and log in
to nodes in your experiment, or use the <code>console</code> command on Ops.
342
343
You will have to type your <a href="#Windows_Passwords"> Windows
Password </a> when logging in, except for SSH when you have ssh-agent keys loaded. <p>
344
345

Or you can set up your browser to automatically connect in one click from the
Russ Fish's avatar
Russ Fish committed
346
Emulab web interface and pop up a connection window.
347
Once you start swapping in an experiment, the Emulab Experiment
348
Information page contains a table of the physical node ID and logical node
349
name, status, and connection buttons.  The captions at the top of the button columns link
350
351
352
353
354
to pages explaining how to set up up mime-types in your browser to make the
buttons work, from FreeBSD, Linux, and Windows workstations:

<ul>
       
355
  <li> <b>SSH</b> <a href="../docwrapper.php3?docname=ssh-mime.html">
Russ Fish's avatar
Russ Fish committed
356
357
358
359
       (setup) </a> - The <b>SSH</b> connection button gives a Bash or TCSH
       shell, as usual.  Your Emulab ssh keys are installed on the
       node in a /sshkeys subdirectory.  </li>

Russ Fish's avatar
Russ Fish committed
360
361
362
363
364
365
  <li> <b>Console</b> <a href="../kb-show.php3?xref_tag=tiptunnel"> (setup)
       </a> - The serial console is supported for Cygwin shell logins using
       the <code>agetty</code> and <code>sysvinit</code> packages.  This is
       the only way in when network connections are closed down!  You can
       also monitor the Frisbee loading and booting of the Windows image on
       the console.  </li>
366

367
  <li> <b>RDP</b> <a href="../docwrapper.php3?docname=rdp-mime.html">
Russ Fish's avatar
Russ Fish committed
368
       (setup) </a> - The <b>RDP</b> button starts up a Remote Desktop
369
       Protocol connection, giving a Windows Desktop login from the user's
Russ Fish's avatar
Russ Fish committed
370
371
372
       workstation screen to the experiment node.  
       <ul>

Russ Fish's avatar
Russ Fish committed
373
	 <li> The <b><code>rdesktop</code></b> client software is used from Linux and Unix 
Russ Fish's avatar
Russ Fish committed
374
375
	      client workstations. </li>

Russ Fish's avatar
Russ Fish committed
376
	 <li> A Microsoft <b>RDC</b> (Remote Desktop Connector) client program is
Russ Fish's avatar
Russ Fish committed
377
378
379
380
381
382
	      included in Windows XP, and may be installed onto other versions
	      of Windows as well.  It has the cute feature that you can make
	      it full-screen without (too much) confusion, since it hangs a
	      little tab at the top of the screen to switch back.
	      Unfortunately, we have no way to present your Emulab Windows
	      password to RDC, so you'll have to type it on each login.  </li>
383

Russ Fish's avatar
Russ Fish committed
384
       </ul>
385
386
</ul>

Russ Fish's avatar
Russ Fish committed
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<div style="margin-left: 40px;"> <b>NOTE:</b> If you import dot-files into
Emulab that replace the system execution search path rather than add to it,
you will have a problem running Windows system commands in shells.  Fix this
by adding <b><code>/cygdrive/c/WINDOWS/system32</code></b> and
<b><code>/cygdrive/c/WINDOWS</code></b> to your <code>$PATH</code> in
<code>~/.cshrc</code> and either <code>~/.bash_profile</code> or
<code>~/.profile</code>.  Don't worry about your home directory dot-files
being shared among Windows, FreeBSD, and Linux nodes; non-existent directories
in the <code>$PATH</code> are ignored by shells.  <p>

When new Emulab user accounts are created, the default CSH and Bash dotfiles
are copied from the FreeBSD /usr/share/skel.  They replace the whole $PATH
rather than add to it.  Then we append an Emulab-specific part that takes care
of the path, conditionally adding the Windows directories on Cygwin.  </div>
401
402
403
404
405
406
407
408
409
410
411
412
413
414

<div style="margin-left: 40px;"> <b>NOTE:</b> The Windows
<b><code>ping</code></b> program has <emph>completely</emph> different option
args from the Linux and FreeBSD ones, and they differ widely from each other.
There is a ping package in Cygwin that is a port of the 4.3bsd ping.  Its
options are close to a common subset of the Linux and FreeBSD options, so it
will be included in future WINXP images:
<pre> ping [ -dfqrv ] host [ packetsize [count [ preload]]] </pre> <p>

You can load it yourself now using <a href="#Cygwin_packages"> Cygwin Setup </a>.
</div>

<div style="margin-left: 40px;"> <b>NOTE:</b> There are no Cygwin ports of
some other useful networking commands, such as <b><code>traceroute</code></b>
Russ Fish's avatar
Russ Fish committed
415
and <b><code>ifconfig -a</code></b>.  The Windows system equivalents are
416
<code>tracert</code> and <code>ipconfig /all</code>. </div>
417

418
419
420
421
422
423
<h4><a name="RDP_details"> </a> RDP details </h4>

Here are some fine points and hints for RDP logins to remote Windows desktops:

<ul>

424
  <li> Microsoft allows only <b>one desktop login at a time</b> to <i>Windows XP</i>,
425
426
427
428
429
430
431
432
433
       although this is the same Citrix Hydra technology that supports many
       concurrent logins to Terminal Server or Server 2003. <p>

       The <b>Fast User Switching</b> option to XP is turned on, so a second
       RDP connection disconnects a previous one rather than killing it.
       Similarly, just closing your RDP client window disconnects your Windows
       Login session rather than killing it. You can reconnect later on
       without losing anything. <p>

434
       <a name="QWINSTA"></a>
435
       SSH doesn't count as a desktop, so you can ssh in and use this command:
Russ Fish's avatar
Russ Fish committed
436
       <b><code>qwinsta</code></b> (Query WINdows STAtion) to show existing
437
       winstation sessions and their session ID's, and this one to reset
Russ Fish's avatar
Russ Fish committed
438
       (kill) a session by ID: <b><code>rwinsta</code></b> </li>
439
440

  <li> We rename <b>My Computer</b> to show the PCxxx physical node name, but
441
442
443
       it doesn't appear on the <i>Windows XP</i> desktop by default.  The XP
       user interface incorporates My Computer into the upper-right quadrant
       of the Start menu by default, and removes it from the desktop. <p>
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458

       You can go back to the "classic" user interface of Windows 2000,
       including showing My Computer.  Right-click on the background of the
       Taskbar which contains the Start button at the left, and choose
       "Properties".  Select the "Start Menu" tab, click the "Classic Start
       menu" radio-button, and click "OK". <p>

       Alternatively, you can force My Computer to appear on your XP desktop
       by right-clicking on the desktop background and choosing "Properties".
       Select the "Desktop" tab and click "Customize Desktop..." to get the
       "Desktop Items" dialog.  Turn on the My Computer checkbox, then click
       "OK" twice.  </li>

  <li> There are several <b>Desktop icons</b> (i.e. "shortcuts") installed by
       default in the XP images: Computer Management, Bash and TCSH shells,
459
460
       and <i>NtEmacs</i>.  You will notice two flavors of Bash and TCSH icons
       on the desktop, labeled <code>rxvt</code> and <code>Cygwin</code>.
461
       
462
       <ul>
463

464
465
       <li> The <b><code>rxvt</code> shells</b> run in windows with
	    <b>X</b>-like cut-and-paste mouse clicks:
466

467
	    <ul>
468

469
	      <li> <b>Left-click</b> starts a selection,  </li>
470

471
	      <li> <b>Right-click</b> extends it, and  </li>
472

473
474
475
476
477
	      <li> <b>middle-click</b> pastes. </li>

	    </ul>

	    These are the ones to use if you're connecting from an X
478
479
480
481
482
483
484
485
	    workstation.  <p>

	    <b>NOTE:</b> The default colors used in Bash and rxvt don't work
	    well in 4-bit color mode under RDP.  Make sure you update your
	    rdp-mime.pl to get the rdesktop <b><code>-a 16</code></b> argument
	    for 16-bit color.  Or, you can over-ride the rxvt defaults by
	    putting lines in your <code>~/.Xdefaults</code> file like this:
	    <br> <code>rxvt*background: steelblue</code> </li> <br>
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509

       <li> The <b><code>Cygwin</code> shells</b> run in a </b>Windows Terminal</b>
	    window, just as the Windows cmd.exe does.  These are the ones to use
	    if you're connecting from a Windows workstation.  <p>

	    <b>Quick-edit mode</b> is on by default, so you can cut-and-paste
	    freely between your local workstation desktop and your remote RDP
	    desktops. <p>

	    In a Windows Terminal window on your RDP remote desktop, the
	    quick-edit cut-and-paste mouse clicks are:

	    <ul>

	      <li> <b>Left-drag</b> the mouse to <i>mark</i> a rectangle 
		   of text, highlighting it.  </li>

	      <li> <b>Type <i>Enter</i> or <i>right-click</i> the mouse when text
		   is highlighted</b>, to <i>copy</i> the selected text to the
		   clipboard. (<b><i>Escape</i></b> <i>cancels</i> the selection
		   without copying it.)  </li>

	      <li> <b>Right-click the mouse with nothing selected</b> to 
		   <i>paste</i> the contents of the clipboard.  </li>
510

511
	    </ul>
512
513
       </ul>
  </li> <br>
514
515

  <li> On the <b>first login by a user</b>, Windows creates the user's <i>Windows
Russ Fish's avatar
Russ Fish committed
516
       profile directory</i> under <code>C:\Documents and Settings</code>, and creates
517
518
519
520
521
522
523
       the <i>registry key</i> (folder) for persistent settings for that user. <p>

       We arrange that early in the user's login process, a user <b>HOME</b>
       environment variable value is set in the user's registry.  Otherwise
       Emacs wouldn't know how to find your <i>.emacs</i> setup file in your
       remotely mounted home directory. <p>

524
525
       User "root" is special, and has a local home directory under
       <code>/home</code>.  <code>/home</code> is a Cygwin symbolic link to
526
527
       <code>C:\Documents and Settings</code>.
  </li>
528

529
530
  <li> The <i>Windows XP</i> Start menu has no <b>Shutdown</b> button under
       RDP.  Instead, it is labeled <b>Disconnect</b> and only closes the RDP
Russ Fish's avatar
Russ Fish committed
531
532
533
534
       client window, leaving the login session and the node running.  If you
       simply close the window, or the RDP client network connection is lost,
       you are also disconnected rather than logged out.  When you reconnect,
       it comes right back, just as it was. <p>
535
536
537
538

       To restart the computer, run <b>/sbin/reboot</b>, or use the "Shut
       Down" menu of <b>Task Manager</b>.  One way to start Task Manager is to
       right-click on the background of the Taskbar at the bottom of the
539
540
       screen and select "Task Manager".
  </li>
541
542
</ul>

543
544
545
<h4><a name="Custom_images"> </a> Making custom Windows OS images </h4>

Making custom Windows images is similar to <a
546
547
548
549
550
551
href="../tutorial/docwrapper.php3?docname=tutorial.html#CustomOS"> doing it on
the other Emulab operating systems</a>, except that you must do a little more
work to run the <code>prepare</code> script as user <code>root</code> since
there are no <code>su</code> or <code>sudo</code> commands on Windows.  This
is optional on the other OS types, but on Windows, proper TCP/IP network setup
depends on <code>prepare</code> being run.
552
553
554
555
556
557
558
559
560
561
562
563
564
565

<ul>
  <li>
    Log in to the node where you want to save a custom image.  Give
    the shell command to change the root password.  Pick a password
    string you can remember, typing it twice as prompted:
    <pre>
       % passwd root
       Enter the new password (minimum of 5, maximum of 8 characters).
       Please use a combination of upper and lower case letters and numbers.
       New password:
       Re-enter new password:
    </pre>

566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
    This works becuase you are part of the Windows <code>Administrators</code>
    group.  Otherwise you would have to already know the root password to
    change it.  <p>

       <div style="margin-left: 40px;"> <b>NOTE:</b> If you change the root
       password and reboot Windows before running <code>prepare</code> below,
       the root password will not match the definitions of the Emulab Windows
       services (daemons) that run as root, so they will not start up. </div>
  </li> <br>

  <li>
     Log out all sessions by users other than <code>root</code>, because
     <code>prepare</code> will be unable to remove their login profile
     directories if they are logged in.  (See <a href="#QWINSTA">QWINSTA</a>.)
  </li> <br>

582
583
584
585
586
587
588
  <li>
     Log in to the node as user <code>root</code> through the Console or SSH,
     using the password you set above, then run the <code>prepare</code> command.
     (It will print "Must be root to run this script!" and do nothing
     if not run as root.)
     <pre>
       /usr/local/etc/emulab/prepare
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
     </pre>
     
     If run without option arguments, <code>prepare</code> will ask for the
     root password you want to use in your new image, prompting twice as the
     passwd command did above.  It needs this to redefine the Emulab Windows
     services (daemons) that run as root.  It doesn't need to be the same as
     the root password you logged in with, since it sets the root password to
     be sure.  The Administrator password is changed as well, since the
     Sysprep option needs that (below.)  <p>

     <ul>
       <li>
         You can give the <b><code>-p</code></b> option to specify the root
	 password on the command line:
	 <pre>
	   /usr/local/etc/emulab/prepare -p myRootPwd
	 </pre>
       </li>
       <li>
	 The <b><code>-n</code></b> option says not to change the passwords at
	 all, and the Emulab Windows services are not redefined.
	 <pre>
	   /usr/local/etc/emulab/prepare -n
	 </pre>
       </li>
       <li>
	 The <b><code>-s</code></b> option is used to make
	 hardware-independent images using the Windows
	 <b><code>Sysprep</code></b> deploy tool.  If you use it with the
	 <code>-n</code> option instead of giving a password, it assumes that
	 you separately blank the Administrator password, or edit your
	 Administrator password into the
	 <code>[GuiUnattended]AdminPassword</code> entry of the sysprep.inf
	 file.
	 <pre>
	   /usr/local/etc/emulab/prepare -s -p myRootPwd
	 </pre>

	   <div style="margin-left: 40px;"> <b>NOTE:</b> This must be done
	   from a login on the <b>serial console</b>, because Sysprep shuts
	   down the network.  <code>prepare -s</code> refuses to run from an
	   SSH or RDP login. </div> <br>

	 Windows normally casts some aspects of the NT image into concrete at
	 the first boot after installation, including the specific boot disk
	 driver to be used by the NT loader (IDE vs. SCSI.)
	 <code>Sysprep</code> is used by PC hardware manufacturers as they
	 make XP installation disks with their own drivers installed.  The
	 Sysprep option to run an unattended <code>Mini-Setup</code> at first
	 boot instead of the normal "Out Of the Box Experience" is used in
	 some large corporate roll-outs.  We do both. <p>

	 The Emulab <code> /share/windows/sysprep </code> directory contains
	 various service pack versions of the XP deploy tools, appropriate
	 device driver directories, and a draft sysprep.inf file to direct the
	 automated install process. <p>

	 Unfortunately, the cost of having just one WINXP image for all PC
	 types is that Mini-setup is slow, being a stripped-down NT kernel.
	 It also forces an additional reboot when it's finished installing
	 drivers.  Together, this adds between 4 and 5 minutes to the total
	 Windows swap-in time, increasing it from about 10 minutes to around
	 15.

	   <div style="margin-left: 40px;"> <b>NOTE:</b> If you do this, set
	   the <b>reboot wait-time</b> as you create your Image Descriptor to
	   <b>360</b> rather than 240 so that swap-ins don't time out. </div>
	   <br>
       </li>

     </ul>
  </li>       

662
  <li>
663
664
665
     Then log out and <a
     href="../tutorial/docwrapper.php3?docname=tutorial.html#CustomOS">
     create your custom image.</a> <br>
666
667
668
669
670

       <div style="margin-left: 40px;"> <b>NOTE:</b> Windows XP is too big to
       fit in the partitioning scheme used by FreeBSD and Linux, so it's
       necessary when making a Windows custom image to specify <b>Partition
       1</b>, and click <b>Whole Disk Image.</b> </div>
671
  </li>
672
673
</ul>

674
675
676
677
678
679
680
<hr style="width: 100%; height: 2px;">
<h3><a name="Cygwin"> </a> Cygwin </h3>

Cygwin is <a href="http://www.cygwin.com/"> GNU + Cygnus + Windows </a>,
providing Linux-like functionality at the API, command-line, and package
installation levels. <p>

681
682
683
684
685
<h4><a name="Cygwin_documentation"> </a> Cygwin documentation </h4>

Cygwin is well documented.  Here are some links to get you started:
<ul>
  <li> <a href="http://cygwin.com/cygwin-ug-net/cygwin-ug-net.html"> 
686
    Users guide </a> </li>
687
  <li> <a href="http://cygwin.com/cygwin-ug-net/highlights.html"> 
688
    Cygwin highlights </a> </li>
689
  <li> <a href="http://cygwin.com/cygwin-ug-net/using-utils.html"> 
690
    Cygwin-added utilities </a> </li>
691
  <li> <a href="http://cygwin.com/faq.html"> 
692
    FAQ </a> </li>
693
  <li> <a href="http://cygwin.com/cygwin-api/cygwin-api.html"> 
694
    API compatibility and Cygwin functions </a> </li>
695
696
</ul>

697
698
699
700
701
<h4><a name="Cygwin_packages"> </a> Cygwin packages </h4>

A number of optional Cygwin packages are installed in the image due to our
building and running the Emulab client software, plus some editors for
convenience.  These packages are currently agetty, bison, cvs, cygrunsrv, ed,
Russ Fish's avatar
Russ Fish committed
702
703
704
file, flex, gcc, gdb, inetutils, make, minires-devel, more, nano, openssh,
openssl-devel, patch, perl, perl-libwin32, psmisc, python, rpm, rsync,
shutdown, sysvinit, tcsh, vim, wget, and zip. <p>
705

Russ Fish's avatar
Russ Fish committed
706
The Cygwin command <b><code>cygcheck -c</code></b> lists the packages that are
Russ Fish's avatar
Tweak.    
Russ Fish committed
707
708
installed, and their current version number and status.

709
710
711
712
Package-specific notes and/or documentation for installed packages are in
<code>/usr{,/share}/doc/Cygwin/*.README</code> and
<code>/usr/share/doc/*/README</code> files.

713
714
715
716
The <a href="http://www.cygwin.com/packages/"> Cygwin package site </a> lists
the available pre-compiled packages and provides a search engine. <p>

If you want to install more Cygwin pre-compiled packages, run the graphical
Russ Fish's avatar
Russ Fish committed
717
installer: <pre>    C:/Software/Cygwin/setup.exe</pre>  <p>
718

Russ Fish's avatar
Russ Fish committed
719
The Cygwin command <b><code>cygcheck -l <i>package-name</i></code></b> lists the
Russ Fish's avatar
Tweak.    
Russ Fish committed
720
721
722
contents of an installed package, which may help you to make a tarfile or rpm
from a package you have installed.  You can then cause it to be installed
automatically by Emulab into all of the nodes of your experiment.  See the <a
723
href="../tutorial/docwrapper.php3?docname=tutorial.html#TARBALLS">
Russ Fish's avatar
Russ Fish committed
724
Tutorial </a> for more information about installing RPM's and tarballs. <p>
725
726
727
728
729
730
731

Watch out for post-install scripts in:
<pre>    /etc/postinstall/<i>package-name</i>.sh{,.done}</pre><p>

Many packages not in the Cygwin package site have also been ported to Cygwin
already.  Download the sources to an experiment node and try
<pre>
Russ Fish's avatar
Russ Fish committed
732
    ./configure
733
734
735
736
737
738
    make
    make install
</pre> as usual. <p>

<h4><a name="SMB_mounts"> </a> SMB mounts and Samba </h4>

Russ Fish's avatar
Russ Fish committed
739
740
741
742
User home directories and other shared directories are served by <b>fs</b>,
another alias for Ops/Users, via the SMB protocol (Server Message Block, also
known as Windows File Sharing) with the Windows Client connecting to the Samba
server. <p>
743

Russ Fish's avatar
Russ Fish committed
744
745
746
747
748
749
UNC paths with leading double-slashes <b><code>//fs</code></b> are used to
access the SMB Shares under Cygwin.  They are then further mounted to the
usual Unix paths for the shared directories:
<code>/users/&lt;username&gt;</code>, <code>/proj/&lt;pid&gt;</code>,
<code>/group/&lt;pid&gt;/&lt;gid&gt;</code>, and <code>/share</code>.
<p>
750

Russ Fish's avatar
Russ Fish committed
751
752
753
754
The Cygwin <b><code>mount</code></b> command lists what you could access on
the Samba server, with the UNC path in the first column.  Unix file
permissions may further limit your access on the Samba server.  Log in to Ops
to investigate.<p>
Russ Fish's avatar
Russ Fish committed
755

Russ Fish's avatar
Russ Fish committed
756
757
758
<b><code>/share/windows</code></b> contains Windows software.  See
<code>/share/windows/README.bin</code> for descriptions of binary packages
available for installation. <p>
759

Russ Fish's avatar
Russ Fish committed
760
761
762
763
In Windows GUI programs, you can just type the UNC path into the Address bar
or a file-open dialog with <b>backslashes</b>, e.g. <code>\\fs\share</code> or
<code>\\fs\&lt;username&gt;</code>.  User and project shares are marked "not
browsable", so just <code>\\fs</code> shows only <code>share</code>. <p>
764

Russ Fish's avatar
Russ Fish committed
765
766
767
768
Windows limitation: There is only one protection mask for everything in a
whole mount/share under SMB.  It's set in the "share properties" on the server
(Samba config file in this case) so <b><code>chmod</code></b> will do you no
good across SMB.
769
770
771

<h4><a name="Cygwin_arcana"> </a> Cygwin arcana </h4>

772
773
<ul>

Russ Fish's avatar
Russ Fish committed
774
  <li> Paths <p>
775

Russ Fish's avatar
Russ Fish committed
776
777
778
779
780
781
782
783
784
785
786
787
       Cygwin accepts either flavor of slashes in paths, Unix/POSIX-style
       forward-slashes, or Windows-style back-slashes.  In Unix shell
       commands, backslashes need to be quoted. <p>

       Single-quotes work best.  Doubling each backslash also works.  This
       must also be done inside double-quotes.  Examples:
       <code>'\single\quoted'</code>, <code>"\\double\\quoted"</code>,
       <code>\\un\\quoted</code>.  (The difference between double and single
       quotes is that $variable references and back-quoted command execution
       are expanded in double-quotes.) <p>

       When you invoke Windows (as opposed to Cygwin) commands, for example
Russ Fish's avatar
Russ Fish committed
788
       <b><code>net use</code></b>, they will know nothing about Unix-style paths in
Russ Fish's avatar
Russ Fish committed
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
       their arguments. The <a
       href="http://cygwin.com/cygwin-ug-net/using-utils.html#cygpath">
       <b><code>cygpath</code></b> </a> utility is an aid to converting paths
       between the Unix and Windows conventions. <p>

       <code>cygpath -w</code> converts its arguments to Windows format, where <code>cygpath
       -u</code> converts its arguments to Unix format, e.g. <pre>
	 $ cygpath -w /cygdrive/c/WINDOWS
	 c:\WINDOWS

	 $ cygpath -u 'c:\WINDOWS'
	 /cygdrive/c/WINDOWS
	 </pre> <p>  </li>

  <li> Cygwin mounts <p>

       <a href="http://cygwin.com/cygwin-ug-net/using-utils.html#mount">
Russ Fish's avatar
Russ Fish committed
806
807
       Cygwin mount points </a> are shown by the <b><code>mount</code></b> and
       <b><code>df</code></b> commands.   <p>
Russ Fish's avatar
Russ Fish committed
808
809
810
811
812
813
814
815
816
817
818
819
820
821

       Note that there is a hard-coded limit of 30 mount points in Cygwin.
       Attempts to use the Cygwin <code>mount</code> command after that will
       fail. <p>

       We discussed UNC <code>//machine</code> paths to SMB shares <a
       href="#SMB_mounts"> above </a>. <p>

       Another special case is the <b>Unix root</b>, "<code>/</code>".  It's
       mounted to <code>C:\cygwin</code> in the Windows filesystem. </li>

  <li> Windows drive letter mounts <p>

       Cygwin knows about drive letter prefixes like
822
823
       <b><code>C:</code></b>&nbsp;, which are equivalent to
       <code>/cygdrive/&lt;drive-letter&gt;</code>&nbsp;.  However,
Russ Fish's avatar
Russ Fish committed
824
825
826
827
828
829
830
       <code>/cygdrive</code>, like <code>/dev</code>, isn't a real directory,
       so you can't <code>ls</code> it.  <p>

       Some Windows software requires drive-letter mounts to be created for
       its use. <p>

       You can use the Windows <b><code>net use</code></b> command to
Russ Fish's avatar
Russ Fish committed
831
832
       associate drive letters with UNC paths to SMB shares, e.g. <pre>net
       use W: '\\fs\share\windows'</pre> <p>
Russ Fish's avatar
Russ Fish committed
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854

       You can use the Windows <b><code>subst</code></b> command to associate
       drive letters with local paths, e.g. <code>subst T: 'C:\Temp'</code> <p>

       Filename completion in Cygwin shells with <code>&lt;Tab&gt;</code>
       doesn't work following a drive-letter prefix, but it works normally
       after a <code>/cygdrive/</code> prefix.  Also, filename completion is
       case-sensitive, although the underlying Windows is case-insensitive, so
       a filename in the wrong case is still opened properly. </li>

  <li> Cygwin is running in <a
       href="http://cygwin.com/cygwin-ug-net/ntsec.html"> <b>NTSEC</b> </a>
       (NT Security) mode, so <code>/etc/passwd</code> and
       <code>/etc/group</code> contain Windows SID's as user and group ID's.
       Your Windows UID is the computer SID with a user number appended,
       something like
       <code>S-1-5-21-2000478354-436374069-1060284298-1334</code>. <p>

       Cygwin commands, such as <code>id</code>, <code>ls -ln</code>, and
       <code>chown/chgrp</code>, use the numeric suffix as the uid,
       e.g. <code>1334</code>.  This is different from your normal Emulab Unix
       user ID number, and the Samba server takes care of the
855
856
857
858
859
860
861
862
863
       difference. <p>

       The <b><code>id</code></b> command reports your user id and group
       memberships.  <p>

       Note that all users are in group <b><code>None</code></b> on XP.
       Contrary to the name, this is a group that contains <b>all users</b>.
       It was named <code>Everybody</code> on Windows 2000, which was a better
       name.  </li>
Russ Fish's avatar
Russ Fish committed
864
865
866
867

  <li> There is no direct equivalent of the Unix <b>setuid</b> programs under
       Windows, and hence no <code>su</code> or <code>sudo</code> commands. <p>

868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
       The Windows equivalent to running a Unix command as <code>root</code>
       is membership in the Windows <b><code>Administrators</code></b> group.
       Emulab project members who have either <code>local_root</code> or
       <code>group_root</code> privileges are put in group
       <b><code>wheel</code></b>, another alias for
       <code>Administrators</code>.  Project members with <code>user</code>
       privileges are not members of the wheel group. <p>

       You can <code>ssh</code> a command to the node as the target user, as
       long as you arrange for the proper authentication.  <p>

       There is not usually a Windows account named <b><code>root</code></b>.
       We create one as part of the Emulab setup to own installed software,
       and to run services and Unix scripts that check that they're running
       with root privileges.  The <code>root</code> user does not have Samba
       privileges to access Samba shared mounts, including <code>/proj</code>,
       <code>/groups</code>, and <code>/users</code>.  <p>

       For C/C++ code, there is a <code>setuid()</code> function in the Cygwin
       library, which "impersonates" the user if proper setup is done first.
       </li>
Russ Fish's avatar
Russ Fish committed
889
890
891
892

  <li> Cygwin does a pretty good job of mapping Unix user-group-other file
       permissions to Windows NT security ACLs.  <p>

893
       On Windows, unlike Unix, file permissions can lock out root,
Russ Fish's avatar
Russ Fish committed
894
       Administrator, or SYSTEM user access.  Many Unix scripts don't bother
895
896
       with permissions if they're running as root, and hence need
       modification to run on Cygwin. </li>
Russ Fish's avatar
Russ Fish committed
897

898
  <li> Cygwin tries to treat <code>.exe</code> files the same as executable
Russ Fish's avatar
Russ Fish committed
899
900
901
902
903
       files without the <code>.exe</code> suffix, but with execute
       permissions turned on.  This breaks down in Makefile actions and
       scripts, where <code>rm</code>, <code>ls -l</code>, and
       <code>install</code> commands may need an explicit <code>.exe</code>
       added. </li>
904

905
</ul>
906
907
908
909
910
911

<hr style="width: 100%; height: 2px;">
<h3><a name="NtEmacs"> </a> NtEmacs </h3>

We don't include the Cygwin X server in our XP images to keep the bulk and
complexity down.  So <a
912
913
href="http://www.gnu.org/software/emacs/windows/ntemacs.html"> <i>NtEmacs</i>
21.3 </a> is provided instead of the Cygwin <b>X</b> Emacs.  <i>NtEmacs</i>
Russ Fish's avatar
Russ Fish committed
914
915
"frames" are windows on the Windows Desktop, e.g. <code>^X-5-2</code> makes
another one. <p>
916
917
918
919
920
921
922
923

The <code>/usr/local/bin/emacs</code> executable is a symlink to
<code>/cygdrive/c/emacs-21.3/bin/runemacs.exe</code>, which starts up an Emacs
on the desktop.  This only works under RDP, since SSH logins have a null
desktop. <p>

There is also a <code>/usr/local/bin/emacs-exe</code> executable, a symlink to
<code>/cygdrive/c/emacs-21.3/bin/emacs.exe</code>, which is only useful as an
Russ Fish's avatar
Russ Fish committed
924
925
Emacs compiler.  It could be used to run Emacs in an SSH or Serial Console 
login window with the
926
927
928
929
<code>-nw</code> (no windows) flag, except that it exits with <code>emacs:
standard input is not a tty</code>.  Another thing not to try is running
<code>emacs-exe -nw</code> in a Bash or TCSH shell on the RDP desktop.  It
crashed <i>Windows XP</i> when I tried it. <p>
930

931
<ul>
932

933
934
  <li> Can drag-and-drop files from <i>Windows Explorer</i> to <i>NtEmacs</i>
       windows.  </li>
935

936
937
938
  <li> <code>cygwin-mount.el</code> in <code>c:/emacs-21.3/site-lisp/</code> 
       makes Cygwin mounts visible within <i>NtEmacs</i>.  It doesn't do Cygwin
       symlinks yet. </li>
939
940

  <li> Options - See <code>~root/.emacs</code>
941

942
       <ul>
943

944
945
946
947
         <li> <code>mouse-wheel-mode</code></li>

	 <li> <code>CUA-mode</code> option ( <code>^C</code> copy /
	 <code>^X</code> cut on selection, <code>^V</code> paste,
948
	 <code>^Z</code> undo).&#14; </li>
949

950
       </ul> </li>
951
</ul>
952

953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
<hr style="width: 100%; height: 2px;">
<h3><a name="DotNet"> </a> Microsoft .Net Runtime </h3>

We have not included the <a
href="http://msdn.microsoft.com/netframework/downloads/framework1_1/">
Microsoft .NET Framework </a> runtime in the standard WINXP images in an
attempt to keep the image size down.  If you need it, it's easy to
install. <p>

The installer for the <a
href="http://www.microsoft.com/downloads/details.aspx?familyid=262D25E3-F589-4842-8157-034D1E7CF3A3&displaylang=en">
Microsoft Framework Version 1.1 Redistributable Package </a> is downloaded to
<b><code>/share/windows/dotnetfx.exe</code></b>.  Run it to download the
runtime, agreeing to the EULA.  It takes a few minutes, and uses 104 meg of
disk. <p>

If you want to develop .NET code as well as run it, you will need to install
the <a
href="http://www.microsoft.com/downloads/details.aspx?FamilyId=9B3A2CA6-3647-4070-9F41-A333C6B9181D&displaylang=en">
.NET Framework SDK Version 1.1 </a>.

974
<hr style="width: 100%; height: 2px;">
975
976
977
978
979
980
981
<h3><a name="Changes"> </a> Change Log </h3>

<b>2006-02-14</b>
<ul>
  <li>
    The -UPDATE images include the most recent round of Microsoft patches,
    plugging both known WMF holes and many others.  The -SP* images of course
Russ Fish's avatar
Tweaks.    
Russ Fish committed
982
983
984
985
986
987
988
989
    <b>don't</b> have the WMF holes plugged, but that's no different from before.
  </li><br>

  <li>
    When making <a href="#Custom_images">custom Windows images</a>, the
    <code>prepare</code> script now requires you to set your own
    <code>root</code> password.
  </li><br>
990
991
992

  <li>
    Within the Emulab code, these images restore linktest to working condition.
Russ Fish's avatar
Tweaks.    
Russ Fish committed
993
  </li><br>
994
995
996
997
998
999
1000
1001
1002
1003

  <li>
    The other changes are intended to make Windows booting and setup more reliable.

    One is that sshd is turned off during rc.bootsetup, since it would
    sometimes go into a loop, eating the CPU and preventing setup from
    finishing before timing out.  Unless you're logging in as root, it won't
    do you much good to try to log in before accounts are set up anyway...  In
    case of trouble, log in via RDP or the serial console, and say "net start
    sshd" in a shell.
Russ Fish's avatar
Tweaks.    
Russ Fish committed
1004
  </li><br>
1005
1006
1007
1008
1009
1010
1011

  <li>
    I've also been chasing a random problem where one of the network
    interfaces disappears from ipconfig due to a race condition within Windows
    startup.  rc.cygwin/rc.ifconfig now work harder at resetting the
    interfaces, and reboot as a last resort if that fails.  It seems that
    fixing one interface can make the problem move to another one though.
Russ Fish's avatar
Tweaks.    
Russ Fish committed
1012
    Unless you use all four available experimental network interfaces in an
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
    experiment topology, this should fix the problem.
  </li>
</ul>

<b>2005-11-22</b>
<ul>
  <li>
    Enable linktest, including ltmap fetching, misc fixes, (c)rude and iperf.
  </li>

  <li>
    Add hacks in watchdog, slothd, and idlemon for clock setback.
  </li>

  <li>
    Back-rev OpenSSH to 4.1 in an attempt to cure sshd boot-time busy-looping.
  </li>

  <li>
    Add rxvt shell windows for X-like mousing.
  </li>
</ul>

<b>2005-10-28</b>
<ul>
  <li>
    Race condition tweaks to rc.cygwin, add rc.firstboot to EmulabStartup service.
  </li>

  <li>
    Cleanup tweaks to prepare and liblocsetup.pm .
  </li>

  <li>
    Add Cygwin ping package.
  </li>
</ul>

<b>2005-9-29</b>
<ul>
  <li>
    Cygwin updated, including OpenSSH 4.2p1-1 .
  </li>

  <li>
    Serial console now works, with agetty and sysvinit providing a login shell.
  </li>

  <li>
    network settings: DNS interface registration and TCP/IP autoconfiguration disabled,
    		  disabled unused experimental net interfaces, 
    		  IPEnableRouter enabled on multihomed experimental nodes.
  </li>

  <li>
    slothd: RDP idlemon for RDP keyboard and mouse events, load-avg correction on pc3000's.
  </li>

  <li>
    program-agent: commands forked on experiment nodes now see Samba directories.
  </li>
</ul>

<b>2005-8-22</b>
<ul>
  <li>
    Everything created behind control-net firewalls to avoid contamination.
  </li>

  <li>
    Patched sshd to support public-key login with Samba shares, and slothd.
  </li>

  <li>
    Emulab program-agent, syncserver and slothd idle detection all work now.
  </li>

  <li>
    NetBT (NetBios over TCP) is disabled to allow network idle detection by slothd.
  </li>

  <li>
    Cygwin syslog now goes into /var/log/messages rather than Event Log.
  </li>

  <li>
    Some Windows services are shut down: Messenger, SSDP Discovery Service,
    Universal Plug and Play Device Host, and Remote Registry.
  </li>

  <li>
    Image creation time now put in /etc/motd.
  </li>
</ul>

<hr style="width: 100%; height: 2px;">
<h3><a name="Future"> </a> Future Work </h3>
1110

Russ Fish's avatar
Russ Fish committed
1111
There are still some things undone: <br>
1112

1113
1114
<ul>

Russ Fish's avatar
Russ Fish committed
1115
  <li> Use Sysprep (MS WADS) for multi-hardware XP images. </li>
1116
1117
1118

  <li> Automate production of <i>Windows XP</i> images for Emulab. </li>

Russ Fish's avatar
Russ Fish committed
1119
1120
  <li> Dynamic routing support for <code>rtproto Session</code>?  </li>

1121
</ul>
1122