windows.html 67.2 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
   All rights reserved.
  -->
<h2>Windows XP in Emulab</h2>
15
<div style="margin-left: 40px;">
16
<a href="#Changes"> Latest change: 2006-11-16 Emulab client-side update. </a>
17
18
19
<img src="../new.gif" alt="&lt;NEW&gt;">
</div>

20
21
22
23
24
<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>
Russ Fish's avatar
Russ Fish committed
25
    <li> <a href="#File_Sharing"> File Sharing </a></li>
26
    <li> <a href="#Windows_Passwords"> Windows Passwords </a></li>
27
    <li> <a href="#Experiment_setup"> Experiment setup for Windows nodes </a></li>
28
    <li> <a href="#Network_config"> Network config </a></li>
Russ Fish's avatar
Russ Fish committed
29
    <li> <a href="#Routing"> Routing </a></li>
30
    <li> <a href="#Firewalls"> Firewalls </a></li>
31
32
    <li> <a href="#Boots_twice"> Windows nodes boot twice </a></li>
    <li> <a href="#Login_connections"> Login connections to Windows </a></li>
33
    <li> <a href="#RDP_details"> RDP details </a></li>
Russ Fish's avatar
Russ Fish committed
34
    <li> <a href="#netbt_command"> The <code>netbt</code> command </a></li>
35
    <li> <a href="#Custom_images"> Making custom Windows OS images </a></li>
36
37
38
  </ul>
  <li> <a href="#Cygwin"> Cygwin </a> </li>
  <ul>
39
    <li> <a href="#Cygwin_documentation"> Cygwin documentation </a></li>
40
    <li> <a href="#Cygwin_packages"> Cygwin packages </a></li>
41
    <li> <a href="#SMB_mounts"> SMB mounts and Samba </a></li>
42
43
    <li> <a href="#Cygwin_arcana"> Cygwin arcana </a>
         <img src="../new.gif" alt="&lt;NEW&gt;"></li>
44
45
46
47
48
49
50
51
52
53
54
55
      <ul>
	<li> <a href="#Cygwin_paths"> File paths </a></li>
	<li> <a href="#Cygwin_mounts"> Mount points </a></li>
	<li> <a href="#Cygwin_drive_letters"> Drive letter mounts </a></li>
	<li> <a href="#Cygwin_NTSEC"> NTSEC </a></li>
	<li> <a href="#Cygwin_setuid"> setuid </a></li>
	<li> <a href="#Cygwin_root"> <code>root</code> </a></li>
	<li> <a href="#Cygwin_Administrators"> <code>Administrators</code> group </a></li>
	<li> <a href="#Cygwin_permissions"> Permissions </a></li>
	<li> <a href="#Cygwin_executables"> Executables </a></li>
	<li> <a href="#Cygwin_GUI"> Windows GUI programs </a></li>
      </ul>
56
57
  </ul>
  <li> <a href="#NtEmacs"> NtEmacs </a></li>
58
  <li> <a href="#DotNet"> Microsoft .Net Runtime </a></li>
59
  <li> <a href="#Changes"> Change Log <img src="../new.gif" alt="&lt;NEW&gt;"></a></li>
60
  <li> <a href="#Future"> Future Work </a></li>
61
62
63
64
65
</ol>

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

66
67
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
68
<a href="../kb-show.php3?xref_tag=SWS-WIN2K">Windows 2000</a> is not supported. <p>
69

Russ Fish's avatar
Russ Fish committed
70
71
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
72
73
74
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>
75
76
77
78

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
79
Emulab software automatically configures each Windows XP node, providing the
80
expected experiment user environment including: user accounts and Emulab SSH
81
82
83
84
85
keys; remote home, project, and shared directories; and network connections. <p>

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

87
88
89
90
91
92
All of the Emulab experiment automation and monitoring services have been
ported to run on Windows/Cygwin.  Sometimes the <a
href="../tutorial/tutorial.php3#SyncServer"> Emulab documentation </a> shows
explicit command paths, such as <code>/usr/testbed/bin/emulab-sync</code>.  <a
href="#Cygwin"> Cygwin </a> handles both Unix and Windows-style command paths,
as described <a href="#Cygwin_arcana"> below </a>. <p>
93

94
95
The Emulab web interface manages a separate <a href="#Windows_Passwords"> 
Windows password </a> in the user
Russ Fish's avatar
Russ Fish committed
96
profile, as well as making <a href="#Login_connections"> login
97
connections </a> to the experiment nodes.
98
Remote Desktop Protocol service supports Windows Desktop logins from the
Russ Fish's avatar
Russ Fish committed
99
100
user's workstation screen to the experiment node.  SSH and Serial Console
command-line connections are also supported.  <p>
101

102
<i>Windows XP</i> installations are more hardware dependent than Linux or
Russ Fish's avatar
Russ Fish committed
103
104
105
FreeBSD.  At present, this <i>Windows XP</i> image runs on most of the Emulab
<a href="../nodecontrol_list.php3"> pc </a> node types, including pc600,
pc850, pc3000 and pc3000w (wifi) nodes. <p>
106
107
108
109
110

<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
111
112
113
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>
114

Russ Fish's avatar
Russ Fish committed
115
116
<h4><a name="File_Sharing"> </a> File Sharing </h4>

117
118
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
Russ Fish's avatar
Russ Fish committed
119
120
121
122
Message Block) protocol, otherwise known as Windows File Sharing.  <p>

The "Client
for Microsoft Networks" software contacts the SMB server, in this case
Russ Fish's avatar
Russ Fish committed
123
124
<b>Samba</b> running on the file server known as <b>Fs</b> (an alias for
<b>Users</b>.)  The SMB protocol
125
126
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
127
under Cygwin mounts, <a href="#SMB_mounts">described below</a>.) <p>
128

129
130
131
132
133
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>

Russ Fish's avatar
Russ Fish committed
134
135
136
If you want to serve files from one of your experiment nodes to others, see
the section on <a href="#netbt_command"> The <code>netbt</code> command </a>.

137
138
139
<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
140
141
142
143
144
145
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>
146
147
148
149
150

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
151
User Profile</b> and then <b>Edit Profile</b> under <b>User Options</b>.  You
152
153
154
155
156
157
158
159
160
161
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
162
163
next Emulab watchdog daemon <code>isalive</code> interval.  This should be in
3 to 6 minutes. <p>
164

165
<h4><a name="Experiment_setup"> </a> Experiment setup for Windows nodes </h4>
166

167
168
169
All you have to do is put a line <a
href="../kb-show.php3?xref_tag=tb-set-node-os">specifying a WINXP OS image</a>
in your experiment .ns file, like this:
Russ Fish's avatar
Russ Fish committed
170
<pre>
171
    <a href="../kb-show.php3?xref_tag=tb-set-node-os">tb-set-node-os</a> $node WINXP-UPDATE
Russ Fish's avatar
Russ Fish committed
172
173
</pre>

174
The Emulab Windows XP images are no longer specific to a particular hardware type.
175
(See the <a href="#Changes"> Change Log </a> for more information.)  You may
176
explicitly <a href="../kb-show.php3?xref_tag=tb-set-hardware">specify the
177
hardware type</a> to run on if you wish, for example:
Russ Fish's avatar
Russ Fish committed
178
<pre>
179
    <a href="../kb-show.php3?xref_tag=tb-set-hardware">tb-set-hardware</a> $node pc3000
Russ Fish's avatar
Russ Fish committed
180
181
</pre>

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
See the <a href="#tb-set-node-failure-action"> note below</a> on using the <a
href="../tutorial/docwrapper.php3?docname=nscommands.html#tb-set-node-failure-action">
tb-set-node-failure-action</a> command for experiments with a large number of
Windows nodes.  This can save a <a href="../kb-show.php3?xref_tag=swapping">
swap-in</a> with a large number of Windows nodes, or prevent a single node
boot failure on a <a href="../kb-show.php3?xref_tag=swapmod"> swapmod</a> from
swapping-out the whole experiment.  <p>

If you use these commands:
<a href="../kb-show.php3?xref_tag=tb-set-node-startcmd">tb-set-node-startcmd</a>,
<a href="../kb-show.php3?xref_tag=load-software">tb-set-node-tarfiles</a>, or
<a href="../kb-show.php3?xref_tag=load-software">tb-set-node-rpms</a> you
should read the sections on <a href="#Cygwin_permissions"> Permissions </a>
and <a href="#Cygwin_GUI"> Windows GUI programs </a> below.  <p>


198
Currently available Windows XP images are:
199
200
201

<ul>

202
203
204
205
  <li><b>WINXP-UPDATE</b> - The most recent Windows
  XP-SP2+.  This is usually what you want.  <p>

  It is updated periodically from Windows Update, typically after
Russ Fish's avatar
Russ Fish committed
206
207
208
209
  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>
210

Russ Fish's avatar
Russ Fish committed
211
  Note: The Windows Firewall is disabled by default (as it will inform you
Russ Fish's avatar
Russ Fish committed
212
  repeatedly!)
213
214
  </li>

215
  <li><b>WINXP-SP2</b> - Windows XP-SP2.  This has the original SP2 on it,
Russ Fish's avatar
Russ Fish committed
216
217
218
  with no Windows Update modifications beyond that.  (SP2 includes SP1.)
  </li>

219
  <li><b>WINXP-SP1</b> - Windows XP-SP1a.  This is intended for
Russ Fish's avatar
Russ Fish committed
220
221
  software (in)security work, and has only the updated version of SP1
  (a.k.a. SP1a) installed.
222
223
  </li>

224
  <li><b>WINXP-SP0</b> - Windows XP, from the original 2001 MSDN CD,
Russ Fish's avatar
Russ Fish committed
225
226
  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.
227
228
229
230
231
232
233
  </li> <br>

  <li><b>WINXP-BASE[-SP1,-SP2][-cygwn][-3000,-pc3000]</b> - Raw Windows XP
  images from the original 2001 MSDN CD, some with service packs and Cygwin.
  There is no Emulab client-side <a href="#Overview"> management code
  </a> to set up and operate the node.  This is only useful
  for building special custom images completely from scratch.  <p>
Russ Fish's avatar
Russ Fish committed
234

235
236
237
  Note: These base images are hardware-dependent, and will run only on the
  pc850 (and possibly the pc600) without a suffix, and on the pc3000 with the
  <code>-3000</code> or <code>-pc3000</code> suffix.
238
  </li>
239
240
241

</ul>

Russ Fish's avatar
Russ Fish committed
242
243
244
245
246
247
248
249
250
<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>
251
252
by the <a href="../kb-show.php3?xref_tag=slothd_details">
<code>slothd</code></a> service.  <i>TCP/IP address autoconfiguration</i>
Russ Fish's avatar
Russ Fish committed
253
254
255
256
257
258
259
260
261
262
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
263
264
265
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.  (See file
266
267
<code>/var/emulab/boot/ipconfig-cache</code> for a full listing from boot
time, including the interfaces that were later disabled.)  <p>
Russ Fish's avatar
Russ Fish committed
268
269
270
271
272
273
274
275
276
277
278

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>

279
<div style="margin-left: 40px;"> <b>NOTE:</b> Often, we have seen
Russ Fish's avatar
Russ Fish committed
280
<code>ipconfig</code> report an ip address and mask of <code>0.0.0.0</code>,
281
282
283
284
while the TCP/IP properties dialog boxes and the <code>netsh</code> command
show the proper values.  Our startup scripts disable and re-enable the network
interface in an attempt to reset this.  Sometimes it doesn't work, and another
reboot is done in an attempt to get the network up.</div>
Russ Fish's avatar
Russ Fish committed
285

286
287
<h4><a name="Routing"> </a> Routing </h4>

Russ Fish's avatar
Russ Fish committed
288
289
290
291
292
293
294
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>
295

Russ Fish's avatar
Russ Fish committed
296
<b><code>rtproto Static</code></b> is supported in all recent WINXP images,
297
but not in WINXP-02-16 (2005) or before. <p>
298
299
300

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

302
There is more information on routing in the <a
303
href="../tutorial/docwrapper.php3?docname=tutorial.html#Routing">
304
305
Routing Section of the Emulab Tutorial. </a><p>

Russ Fish's avatar
Russ Fish committed
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<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>
326

327
328
329
<div style="margin-left: 40px;"> <b>NOTE:</b> There are some problems
which make swapping-in Windows nodes behind a control-net firewall take
longer than they should, or fail.
330

331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
  <ul>
    <li> DHCP packets aren't passed until the firewall node is loaded with
	 FreeBSD and started up.  The OS image loading process starts with a
	 FreeBSD PXE-loader that requires DHCP information.  To minimize the
	 impact of this, we hold rebooting the experiment nodes into the
	 PXE-loader until the firewall is up.
    </li> <br>
    <li> During the Frisbee OS image loading process, all of the image data
	 passes through the control-net firewall.  This can be a bottleneck:
	 if it is allocated to a pc600 node; if you are loading several
	 different Windows images in the experiment; or if there are multicast
	 congestion problems in the Cisco router.  Windows nodes are more
	 subject to all of these issues, only because the Windows images are
	 larger.  <p>

	 After 10 minutes in the <code>reloading</code> state, Emulab gives up
	 and reboots the node to try again, even if Frisbee is working hard
	 and nearly done.  We could extend the time-out when the nodes are
	 behind a control-net firwall, or change to accept some slowdown as
	 long as the image load is making progress rather than using a fixed
	 time-out.
    </li>
  </ul>
</div>
355

Russ Fish's avatar
Russ Fish committed
356
The <i>Windows Firewall</i> software is installed in WINXP-SP2 and
357
358
359
360
361
WINXP-UPDATE images, but disabled with the <code>netsh firewall set opmode
DISABLE</code> command, to allow RDP and SSH access to Windows nodes.  There
is an XP display bug related to this: sometimes the "Security Center" that
shows at RDP login indicates that the Windows Firewall is turned on.  Clicking
through to the firewall settings shows that it is really off.  <p>
362

363
<h4><a name="Boots_twice"> </a> Windows nodes boot twice </h4>
364

365
366
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
367
368
369
370
371
372
network stack properly.  Be patient, Windows XP doesn't boot quickly. <p>

With <a href="#Hardware_independent">hardware-independent</a> (<a
href="#Sysprep"><code>Sysprep</code>'ed</a>) images, the first boot is
actually running <code>Mini-Setup</code> as well, setting up device drivers
and so on.  <p>
373
374
375
376
377
378
379
380
381
382
383

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>
384

385
386
387
388
389
390
391
392
393
394
395
<a name="tb-set-node-failure-action"> </a>
<div style="margin-left: 40px;"> <b>NOTE:</b>

Sometimes Windows XP fails to do the second reboot.  One reason is transient
race conditions in the Windows startup, for example in the network stack when
there are multiple network interface devices being initialized at the same
time.  We make a strong effort to recover from this, but if the recovery code
fails, by default it results in a <a href="../kb-show.php3?xref_tag=swapping">
swap-in</a> or <a href="../kb-show.php3?xref_tag=swapmod"> swapmod</a>
failure.  <p>

396
<a href="../kb-show.php3?xref_tag=XP_boot">
397
398
At boot time, the EmulabStartup service on Windows XP runs the
<code>/usr/local/etc/emulab/rc/rc.bootsetup</code> script, logging output to
399
<code>/var/log/bootsetup.log</code>.</a>  If you're having swap-in problems and
400
401
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
402
<code>ISUP</code>, Emulab gives up on the node.<p>
403

404
405
406
You can cause these boot-time problems to be nonfatal by adding this line to
your <a href="../tutorial/docwrapper.php3?docname=nscommands.html"> ns file
</a> <i>for each Windows node</i>: <br>
407
408
409
410
411
412
413
&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>

414
415
416
417
418
419
420
421
422
423
424
425
426
427
Emulab will still complain if it doesn't get the ISUP signal at the end of
rc.bootsetup, but the swap-in or swapmod will proceed and allow you to figure
out what's happening.  Then you will probably have to manually reboot the failed
Windows node to make it available to your experiment.  <p>

If you try to login to a node after swap-in to diagnose the problem 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, this
is another symptom of a partial set-up.  You have the additional option of
executing this command on the node itself:<pre> /sbin/reboot</pre>

This gives Windows another chance to get it right.  </div>
428

429
<h4><a name="Login_connections"> </a> Login connections to Windows </h4>
430

Russ Fish's avatar
Russ Fish committed
431
432
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.
433
434
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>
435
436

Or you can set up your browser to automatically connect in one click from the
Russ Fish's avatar
Russ Fish committed
437
Emulab web interface and pop up a connection window.
438
Once you start swapping in an experiment, the Emulab Experiment
439
Information page contains a table of the physical node ID and logical node
440
name, status, and connection buttons.  The captions at the top of the button columns link
441
442
443
444
445
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>
       
446
  <li> <b>SSH</b> <a href="../docwrapper.php3?docname=ssh-mime.html">
Russ Fish's avatar
Russ Fish committed
447
448
449
450
       (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
451
452
453
454
455
456
  <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>
457

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

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

Russ Fish's avatar
Russ Fish committed
467
	 <li> A Microsoft <b>RDC</b> (Remote Desktop Connector) client program is
Russ Fish's avatar
Russ Fish committed
468
469
470
471
472
473
	      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>
474

Russ Fish's avatar
Russ Fish committed
475
       </ul>
476
477
</ul>

Russ Fish's avatar
Russ Fish committed
478
479
480
481
482
483
484
485
486
487
488
489
490
491
<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>
492
493
494
495
496
497
498
499
500
501
502
503
504
505

<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
506
and <b><code>ifconfig -a</code></b>.  The Windows system equivalents are
507
<code>tracert</code> and <code>ipconfig /all</code>. </div>
508

509
510
511
512
513
514
<h4><a name="RDP_details"> </a> RDP details </h4>

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

<ul>

515
  <li> Microsoft allows only <b>one desktop login at a time</b> to <i>Windows XP</i>,
516
517
518
519
520
521
522
523
524
       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>

525
       <a name="QWINSTA"></a>
526
       SSH doesn't count as a desktop, so you can ssh in and use this command:
Russ Fish's avatar
Russ Fish committed
527
       <b><code>qwinsta</code></b> (Query WINdows STAtion) to show existing
528
       winstation sessions and their session ID's, and this one to reset
Russ Fish's avatar
Russ Fish committed
529
       (kill) a session by ID: <b><code>rwinsta</code></b> </li>
530
531

  <li> We rename <b>My Computer</b> to show the PCxxx physical node name, but
532
533
534
       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>
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549

       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,
550
551
       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>.
552
       
553
       <ul>
554

555
556
       <li> The <b><code>rxvt</code> shells</b> run in windows with
	    <b>X</b>-like cut-and-paste mouse clicks:
557

558
	    <ul>
559

560
	      <li> <b>Left-click</b> starts a selection,  </li>
561

562
	      <li> <b>Right-click</b> extends it, and  </li>
563

564
565
566
567
568
	      <li> <b>middle-click</b> pastes. </li>

	    </ul>

	    These are the ones to use if you're connecting from an X
569
570
571
572
573
574
575
576
	    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>
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600

       <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>
601

602
	    </ul>
603
604
       </ul>
  </li> <br>
605
606

  <li> On the <b>first login by a user</b>, Windows creates the user's <i>Windows
Russ Fish's avatar
Russ Fish committed
607
       profile directory</i> under <code>C:\Documents and Settings</code>, and creates
608
609
610
611
612
613
614
       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>

615
616
       User "root" is special, and has a local home directory under
       <code>/home</code>.  <code>/home</code> is a Cygwin symbolic link to
617
618
       <code>C:\Documents and Settings</code>.
  </li>
619

620
621
  <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
622
623
624
625
       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>
626
627
628
629

       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
630
631
       screen and select "Task Manager".
  </li>
632
633
</ul>

Russ Fish's avatar
Russ Fish committed
634
635
636
637
638
639
640
641
642
643
644
645
<h4><a name="netbt_command"> </a> The <code>netbt</code> command </h4>

The <b>NetBT</b> (Netbios over TCP) protocol is used to announce shared
directories (folders) from one Windows machine to others.  (See the Name and
Session services in <a href="http://en.wikipedia.org/wiki/Netbios">
http://en.wikipedia.org/wiki/Netbios</a>.) <p>

The <b>SMB</b> (Server Message Block) protocol is used to actually serve
files. (See <a href="http://en.wikipedia.org/wiki/Server_Message_Block">
http://en.wikipedia.org/wiki/Server_Message_Block</a>.) <p>

In Emulab, we normally disable NetBT on experiment nodes, because it chatters
646
647
and messes up <a href="../kb-show.php3?xref_tag=slothd_details">
<code>slothd</code></a> network idle detection, and is not needed for the usual
Russ Fish's avatar
Russ Fish committed
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
SMB mounts of <code>/users</code>, <code>/proj</code>, and <code>/share</code>
dirs, which are served from a Samba service on <b>fs</b>. <p>

However, NetBT <i>does</i> have to be enabled on the experiment nodes if you
want to make Windows file shares between them.  The <b><code>netbt</code></b>
script sets the registry keys on the Windows network interface objects.  Run
it on the server nodes (the ones containing directories which you want to
share) and reboot them afterwards to activate.  There is an optional
<code>-r</code> argument to reboot the node.

<pre>    Usage: netbt [-r] off|on</pre>

If you use <code>netbt</code> to turn on NetBT, it persists across reboots. <p>

No reboot is necessary if you use Network Connections in the Control Panel
to turn on NetBT.  It takes effect immediately, but is turned off at reboot
unless you do <code>netbt on</code> afterward as well.
<ul>
  <li> Right-click Local Area Connection (or the name of another connection, if
    appropriate), click Properties, click Internet Protocol (TCP/IP), and then
    click the Properties button.  </li>

  <li> On the Internet Protocol (TCP/IP) Properties
    page, click the Advanced button, and click the WINS tab.  </li>

  <li> Select Enable or Disable NetBIOS over TCP/IP.  </li>
</ul>

<code>ipconfig /all</code> reports "NetBIOS over Tcpip . . . : Disabled" on
interfaces where NetBT is disabled, and says nothing where NetBT is
enabled. <p>

To start sharing a directory, on the node, use the <code>net share</code>
command, or turn on network sharing on the Sharing tab of the Properties of a
directory (folder.)  <ul> <li> On XP-SP2 or above, when you first do this, the
"Network sharing and security" subdialog says: 
<pre>    As a security measure, Windows has disabled remote access to this
    computer.  However, you can enable remote access and safely share files by
    running the _Network_Setup_Wizard_.

    _If_you_understand_the_security_risks_but_want_to_share_
    _files_without_running_the_wizard,_click_here._"</pre>  </li>

  <li> Skip the wizard and click the latter ("I understand") link. Then click
    "Just enable file sharing", and "OK".  </li>

  <li> Then you finally get the click-box to "Share this
    folder on the network".  </li>
</ul>

The machine names for UNC paths sharing are the same as in shell prompts:
<code>pcXXX</code>, where <code>XXX</code> is the machine number.  These will
show up in <code>My Network Places / Entire Network / Microsoft Windows
Network / Emulab</code> once you have used them. <p>

IP numbers can also be used in UNC paths, giving you a way to share files
across experiment network links rather than the control network. <p>

There is an Emulab-generated <b><code>LMHOSTS</code></b> file, to provide the
usual node aliases within an experiment, but it is currently ignored even
though "Enable LMHOSTS lookup" is turned on in the TCP/IP WINS settings.  Try
Russ Fish's avatar
Russ Fish committed
709
710
711
<code>nbtstat -c</code> and <code>nbtstat -R</code> to experiment with this.
(See the <a
href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/nbtstat.mspx?mfr=true">Microsoft
712
doc for nbtstat</a>.  <p>
Russ Fish's avatar
Russ Fish committed
713

714
715
716
<h4><a name="Custom_images"> </a> Making custom Windows OS images </h4>

Making custom Windows images is similar to <a
717
718
719
720
721
722
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.
723
724
725
726
727
728
729
730
731
732
733
734
735
736

<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>

737
738
739
740
    This works because you are part of the Windows <a
    href="#Cygwin_Administrators"><code>Administrators</code> group</a>.
    Otherwise you would have to already know the root password to change it.
    <p>
741
742

       <div style="margin-left: 40px;"> <b>NOTE:</b> If you change the root
743
       password and reboot Windows <u>before running <code>prepare</code></u> below,
744
745
746
747
748
749
750
751
752
753
       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>

754
755
756
757
758
759
760
  <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
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
     </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>
787
	 <a name="Sysprep"> </a>
788
	 The <b><code>-s</code></b> option is used to make
789
790
	 <a href="#Hardware_independent">hardware-independent</a> 
	 images using the Windows
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
	 <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>

806
807
	   <div style="margin-left: 40px;"> <b>NOTE:</b> Currently,
	   hardware-independent images must be made on a pc850, and will then
808
809
810
	   run on the pc600, pc3000, and pc3000w as well.  There is an
	   unresolved boot-time problem going the other direction, from the
	   pc3000 to a pc850 or pc600. </div> <br>
811

812
813
	 Windows normally casts some aspects of the NT image into concrete at
	 the first boot after installation, including the specific boot disk
814
	 driver to be used by the NT loader (IDE, SCSI, or SATA.)
815
816
	 <code>Sysprep</code> is used by PC hardware manufacturers as they
	 make XP installation disks with their own drivers installed.  The
817
818
819
820
	 <code>Sysprep</code> 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>
821
822

	 The Emulab <code> /share/windows/sysprep </code> directory contains
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
	 several versions of the XP deploy tools matched to the XP service
	 pack level, appropriate device driver directories, and a draft
	 <code>sysprep.inf</code> file to direct the automated install
	 process. <p>

	 <code>Mini-setup</code> needs to reboot after setting up device
	 drivers.  XP also needs to <a href="#Boots_twice">reboot</a> after
	 changing the host name.  We combine the two by using a <a
	 href="http://support.microsoft.com/?kbid=238955">
	 <code>Cmdlines.txt</code> script</a> to run <code>rc.firstboot
	 -mini</code> to set the host name at the end of
	 <code>Mini-Setup</code>.  <p>

	 Thus we only pay the extra time to set up device drivers and so
	 on from scratch, about two minutes, rather than adding a third
	 hardware and XP reboot cycle.

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

     </ul>
  </li>       

849
  <li>
850
851
852
     Then log out and <a
     href="../tutorial/docwrapper.php3?docname=tutorial.html#CustomOS">
     create your custom image.</a> <br>
853
854
855
856

       <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
857
858
859
860
861
862
863
864
865
866
       1</b>, and click <b>Whole Disk Image.</b> </div> <br>
  </li>

  <li>
     When you're testing your custom image, it's a good idea to set the <a
     href="../tutorial/docwrapper.php3?docname=nscommands.html#tb-set-node-failure-action">
     tb-set-node-failure-action</a> to "nonfatal" in the ns file so you get a
     chance to examine an image that hasn't completed the set-up process.  See
     the <a href="#tb-set-node-failure-action"> note below</a> for other
     useful ideas.
867
  </li>
868
869
</ul>

870
871
872
873
874
875
876
<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>

877
878
879
880
881
<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"> 
882
    Users guide </a> </li>
883
  <li> <a href="http://cygwin.com/cygwin-ug-net/highlights.html"> 
884
    Cygwin highlights </a> </li>
885
  <li> <a href="http://cygwin.com/cygwin-ug-net/using-utils.html"> 
886
    Cygwin-added utilities </a> </li>
887
  <li> <a href="http://cygwin.com/faq.html"> 
888
    FAQ </a> </li>
889
  <li> <a href="http://cygwin.com/cygwin-api/cygwin-api.html"> 
890
    API compatibility and Cygwin functions </a> </li>
891
892
</ul>

893
894
895
896
897
<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
898
899
900
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>
901

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

905
906
907
908
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.

909
910
911
912
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
913
installer: <pre>    C:/Software/Cygwin/setup.exe</pre>  <p>
914

Russ Fish's avatar
Russ Fish committed
915
The Cygwin command <b><code>cygcheck -l <i>package-name</i></code></b> lists the
Russ Fish's avatar
Tweak.    
Russ Fish committed
916
917
918
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
919
href="../tutorial/docwrapper.php3?docname=tutorial.html#TARBALLS">
Russ Fish's avatar
Russ Fish committed
920
Tutorial </a> for more information about installing RPM's and tarballs. <p>
921
922
923
924
925
926
927

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
928
    ./configure
929
930
931
932
933
934
    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
935
936
937
938
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>
939

940
941
942
943
UNC paths with leading double-slashes and a server name,
e.g. <b><code>//fs</code></b>, are used to access the SMB Shares under Cygwin.
Emulab then uses the <a href="#Cygwin_mounts"> Cygwin mount command </a> to
make them appear on the usual Unix paths for the Emulab shared directories:
Russ Fish's avatar
Russ Fish committed
944
945
946
<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>
947

Russ Fish's avatar
Russ Fish committed
948
949
950
951
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
952

Russ Fish's avatar
Russ Fish committed
953
954
955
<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>
956

Russ Fish's avatar
Russ Fish committed
957
958
959
960
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>
961

962
963
964
965
966
967
968
969
970
971
<i>Windows limitation:</i> There is only <b>one protection mask</b> 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. <p>

<i>Cygwin limitation:</i> There is a hard-coded <b>limit of 30 mount
points</b> in Cygwin.  Cygwin uses 4 of them, and Emulab uses another 3 or 4.
So some of your <code>/users</code> mounts will fail on Windows startup if you
have more than 23 or 24 members in your project, unless they are grouped into
smaller <a href="../docwrapper.php3?docname=groups.html"> subgroups </a>.
972
973
974

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

975
976
<ul>

977
  <li> <a name="Cygwin_paths"> </a> File paths <p>
978

Russ Fish's avatar
Russ Fish committed
979
980
981
982
983
984
985
986
987
988
989
990
       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
991
992
       <b><code>net use</code></b>, they will know nothing about Unix-style
       paths in their arguments. The <a
Russ Fish's avatar
Russ Fish committed
993
994
995
996
       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>

997
998
999
1000
       <code>cygpath -w</code> converts its arguments to Windows format, and
       <code>cygpath -u</code> converts its arguments to Unix format,
       e.g. <pre>

For faster browsing, not all history is shown. View entire blame