windows.html 21.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!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
   Copyright (c) 2000-2004 University of Utah and the Flux Group.
   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
22
    <li> <a href="#Experiment_setup"> Experiment setup for Windows nodes </a></li>
    <li> <a href="#Routing"> Routing </a></li>
23
    <li> <a href="#Network_config"> Network config </a></li>
24
25
    <li> <a href="#Boots_twice"> Windows nodes boot twice </a></li>
    <li> <a href="#Login_connections"> Login connections to Windows </a></li>
26
27
28
29
    <li> <a href="#RDP_details"> RDP details </a></li>
  </ul>
  <li> <a href="#Cygwin"> Cygwin </a> </li>
  <ul>
30
    <li> <a href="#Cygwin_documentation"> Cygwin documentation </a></li>
31
32
33
34
35
36
37
38
39
40
41
    <li> <a href="#Cygwin_packages"> Cygwin packages </a></li>
    <li> <a href="#SMB_mounts"> SMB mounts and Samba </a></li>
    <li> <a href="#Cygwin_arcana"> Cygwin arcana </a></li>
  </ul>
  <li> <a href="#NtEmacs"> NtEmacs </a></li>
  <li> <a href="#Future"> Future work </a></li>
</ol>

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

42
43
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.
44
<a href="../faq.php3?#SWS-WIN2K">Windows 2000</a> is not supported. <p>
45
46
47

Before booting the node at swap-in time, Emulab loads a fresh image of Windows
XP onto the experiment nodes in parallel, using our Frisbee service.  Emulab
48
49
50
51
software automatically configures each <i>Windows XP</i> node, providing the
expected experiment user environment including: user accounts and Emulab SSH
keys; remote home, project, and shared directories; and network connections.
<p>
52
53
54
55
56
57
58
59
60
61

The Cygwin GNU 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>

The Emulab web interface manages a separate Windows password in the user
profile, as well as making SSH and RDP login connections to the experiment nodes.
Remote Desktop Protocol service supports Windows Desktop logins from the
user's workstation screen to the experiment node.  <p>

62
63
64
<i>Windows XP</i> installations are more hardware dependent than Linux or
FreeBSD.  At first, this <i>Windows XP</i> image only runs on the pc850 and
pc600 Emulab node types.  <p>
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

<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
Cygwin layered on top, in an Emulab context.  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>

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
<b>Samba</b> running on the file server known as <b>Fs</b>.  The SMB protocol
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
under Cygwin mounts, described below.) <p>

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

A separate <b>Windows password</b> is kept for use only with experiment nodes
86
87
88
89
running Windows.  It is presented behind-the-scenes to rdesktop for RDP logins
by our Web interface.  However, we still haven't figured out how to present it
to Windows for the Samba mount of your home directory under an ssh login, so
you will still need to type it on each ssh connection. <p>
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108

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
User Profile</b> and then <b>Edit Profile under User Options</b>.  You
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
next Emulab watchdog daemon isalive interval.  This should be in 3 to 6
minutes. <p>

109
<h4><a name="Experiment_setup"> </a> Experiment setup for Windows nodes </h4>
110
111
112

All you have to do is put a line specifying a WINXP OS image in your
experiment .ns file, like this: <br>
113
<pre>    tb-set-node-os $node WINXP-UPDATE</pre>
114

115
Currently available Windows XP images are:
116
117
118

<ul>

119
120
121
  <li><b>WINXP-UPDATE</b> - Windows XP-SP2+, pc600 and pc850.  This will be
  updated periodically from Windows Update with critical and security fixes up
  through the date we pull the image file. <p>
122

123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
  The Windows Firewall is disabled by default (as it will inform you
  repeatedly!) <p>

  This image fixes the problem that was causing Windows experiments created
  with Netbuild to fail.  Netbuild creates all experiments with "Static"
  routing enabled, and that form of route is now supported. <p>

  There was also a problem with Windows not finding all the interfaces when it
  booted.  Hopefully that is fixed as well.
  </li>

  <li><b>WINXP-02-16</b> - Windows XP-SP2+, pc600 and pc850, first release.
  This incorporates SP2, as well as all "critical" and "security" updates as
  of the date of the image. <p>

  If you use WINXP-02-16 and built your experiment .ns file with the
  <i>NetBuild</i> GUI, be aware that it puts in a <code>rtproto Static</code>
  statement, which you will need to modify to <code>rtproto Static-old</code>.
  </li>

  <li><b>WINXP-02-11</b> - Windows XP-SP1, pc600 and pc850, early release
  candidate.
  </li>
146
147
148

</ul>

149
150
151
152
<h4><a name="Routing"> </a> Routing </h4>

Router nodes can not run Windows, i.e. <b><code>rtproto Session</code></b> is
not supported.<p>
153

154
155
156
157
158
<b><code>rtproto Static</code></b> is supported in WINXP-UPDATE, but not in
WINXP-02-16 or before. <p>

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

160
161
There is more information on routing in the <a
href="http://www.emulab.net/tutorial/docwrapper.php3?docname=tutorial.html#Routing">
162
163
Routing Section of the Emulab Tutorial. </a><p>

164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<h4><a name="Network_config"> </a> Network config </h4>

Normally, the Windows <b><code>ipconfig /all</code></b> command shows the
configuration information for each of the 5 network interfaces.  There will
always be a configured control net interface on the 155.98.36 network. <p>

Notice that the Windows names of the interfaces start with <code>Local Area
Connection</code> 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>

If you specified links or lans in your experiment topology, the other
interfaces will show a configuration, with an IP address, subnet mask, and
gateway that you can specify in the NS file.  Otherwise ipconfig will show a
Media State of <code>Media disconnected</code>. <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>

185
<h4><a name="Boots_twice"> </a> Windows nodes boot twice </h4>
186

187
Notice that Windows reboots an extra time after first swap-in on a node, after
188
189
changing the node name, to set up the network stack properly.  
Be patient, Windows doesn't boot fast. <p>
190
191
192
193
194
195
196
197
198
199

<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
the node itself: <pre>    /sbin/reboot</pre> </div>

200
<h4><a name="Login_connections"> </a> Login connections to Windows </h4>
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
230
231
232
233
234
235
236
237
238
239
240
241
242

You can manually start up SSH or RDP client programs to connect and log in to
nodes in your experiment, using your Windows password. <p>

Or you can set up your browser to automatically connect in one click from the
Emulab web interface.  Once an experiment is swapped in, the Emulab Experiment
Information page contains a table of the physical node ID and logical node
name, status, and connection buttons.  The captions of the button columns link
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>
       
  <li> <a href="https://www.emulab.net/docwrapper.php3?docname=ssh-mime.html">
       <b>SSH</b> </a> - The <b>SSH</b> connection button gives a Bash or TCSH
       shell, as usual.  Although your Emulab ssh keys are installed on the
       node in a /sshkeys subdirectory, you have to type your password to SSH
       logins to enable remote directory mounts through SMB.  </li>

  <li> <a href="https://www.emulab.net/faq.php3#UTT-TUNNEL"> <b>Console</b>
       </a> - The <b>Console</b> button won't do much good now, because
       Windows doesn't normally provide logins on the com serial device.
       (This will be remedied with <i>agetty</i> eventually.)  An exception is
       that you can monitor the Frisbee loading of the Windows image on the
       console.  </li>

  <li> <a href="https://www.emulab.net/docwrapper.php3?docname=rdp-mime.html">
       <b>RDP</b> </a> - The <b>RDP</b> button starts up a Remote Desktop
       Protocol connection, giving a Windows Desktop login from the user's
       workstation screen to the experiment node.  The "rdesktop" client
       software is used from Linux and Unix client workstations.  A Microsoft
       RDC (Remote Desktop Connector) client program is included in Windows
       XP, and may be installed onto other versions of Windows as well.  </li> 

</ul>

<h4><a name="RDP_details"> </a> RDP details </h4>

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

<ul>

243
  <li> Microsoft allows only <b>one desktop login at a time</b> to <i>Windows XP</i>,
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
       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>

       SSH doesn't count as a desktop, so you can ssh in and use this command:
       <pre> qwinsta</pre> (Query WINdows STAtion) command to show existing
       winstation sessions and their session ID's, and this one to reset
       (kill) a session by ID: <pre> rwinsta</pre> </li>

  <li> We rename <b>My Computer</b> to show the PCxxx physical node name, but
259
260
261
       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>
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276

       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,
277
       and <i>NtEmacs</i>.  </li> <br>
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
       
  <li> The Bash and TCSH icons run their respective shells in a </b>Windows
       Terminal</b>, just like the Windows cmd.exe .  <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>

       Remember that the cut-and-paste mouse clicks are different from in
       <b>X</b>, where left-click starts a selection, right-click extends it,
       and middle-click pastes.  (These are the clicks to use when you are
       SSH'ed in to a Windows node from an xterm window.)  Yes, it can be
       confusing. <p>

       In a Windows Terminal window on your RDP remote desktop, the
       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>

       </ul> <br>

  <li> On the <b>first login by a user</b>, Windows creates the user's <i>Windows
       profile directory</i> under "C:\Documents and Settings", and creates
       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>

319
320
321
       User "root" is special, and has a local home directory under
       <code>/home</code>.  <code>/home</code> is a Cygwin symbolic link to
       <code>C:\Documents and Settings</code>.  </li>
322

323
324
325
  <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
       client window, leaving the login session and the node running. <p>
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340

       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
       screen and select it. </li>

</ul>

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

341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
<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"> 
    Users guide </a>
  <li> <a href="http://cygwin.com/cygwin-ug-net/highlights.html"> 
    Cygwin highlights </a>
  <li> <a href="http://cygwin.com/cygwin-ug-net/using-utils.html"> 
    Cygwin-added utilities </a>
  <li> <a href="http://cygwin.com/faq.html"> 
    FAQ </a>
  <li> <a href="http://cygwin.com/cygwin-api/cygwin-api.html"> 
    API compatibility and Cygwin functions </a>
</ul>

357
358
359
360
361
362
363
364
<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,
file, flex, gcc, gdb, make, nano, openssh, openssl-devel, patch, perl,
perl-libwin32, python, rpm, rsync, shutdown, tcsh, vim, wget, and zip. <p>

Russ Fish's avatar
Tweak.    
Russ Fish committed
365
366
367
The Cygwin command <pre> cygcheck -c</pre> lists the packages that are
installed, and their current version number and status.

368
369
370
371
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.

372
373
374
375
376
377
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
installer: <pre>    C:/Software/Cygwin/cygwin-setup.exe</pre>  <p>

Russ Fish's avatar
Tweak.    
Russ Fish committed
378
379
380
381
The Cygwin command <pre> cygcheck -l <i>package-name</i></pre> lists the
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
382
href="http://www.emulab.net/tutorial/docwrapper.php3?docname=tutorial.html#TARBALLS">
Russ Fish's avatar
Tweak.    
Russ Fish committed
383
Tutorial </a> for more information. <p>
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399

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>
    configure
    make
    make install
</pre> as usual. <p>

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

Some details remain to be documented: <br>

400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
<ul>

  <li> Home dirs are on <code>//fs</code> via SMB(Windows Client, Samba server)

       <ul>

         <li> Cygwin/UNC mounts of Windows Shares under <code>/users</code>,
              <code>/proj</code>, <code>/share</code>. The Cygwin
              <code>mount</code> command shows what you can access. </li> 

         <li> Can put <code>\\fs\&lt;share_name&gt;</code> into the Windows
              Explorer "Address".  These shares are marked not browsable, so
              just <code>\\fs</code> shows little.  </li>

       </ul> </li>

  <li> Shared directories: <code>/share</code>,
Russ Fish's avatar
Russ Fish committed
417
       <code>/proj/&lt;pid&gt;</code>, 
418
       <code>/group/&lt;pid&gt;/&lt;gid&gt;</code>. </li> 
419

420
421
  <li> Bug: One protection mask for everything in a whole mount/share under
       SMB. </li>
422

423
</ul>
424
425
426

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

427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
<ul>

  <li> Paths 
       <ul>

         <li> <code><b>\</b> == <b>/</b></code>, modulo quoting </li>

         <li> <code>cygpath -w</code>, <code>cygpath -u</code> </li>

         <li> UNC paths: <code>//machine</code> </li>

       </ul> </li>

  <li> Cygwin mounts
       <ul>
442

443
         <li> Shown in the <code>mount</code> and <code>df</code> commands. </li>
444

445
         <li> <code><b>/</b> == C:/cygwin</code> </li>
446

447
         <li> <code>/cygdrive/c == C:</code> </li>
448

449
450
451
452
453
454
455
456
457
458
459
         <li> </code>//fs/...</code> all Emulab directories. </li>

       </ul> </li>

  <li> <code>/etc/passwd</code> and <code>/etc/group</code> contain Windows
  SID's as UID's and GID's. </li>

  <li> No suid, but everybody is in group wheel==Administrators. </li>

  <li> File protections can lock out root, Administrator, or SYSTEM. </li>
</ul>
460
461
462
463
464
465

<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
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
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>
"frames" are windows on the Windows Desktop. <p>

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
Emacs compiler.  It could be used to run Emacs in an SSH window with the
<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>
482

483
<ul>
484

485
486
  <li> Can drag-and-drop files from <i>Windows Explorer</i> to <i>NtEmacs</i>
       windows.  </li>
487

488
489
490
491
  <li> <code>cygmount.el</code> makes Cygwin mounts visible within
       <i>NtEmacs</i>.  </li>

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

493
       <ul>
494

495
496
497
498
499
500
501
502
         <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,
	 <code>^Z</code> undo). </li>

       </ul>
</ul>
503
504
505
506
507
508

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

There are still some things left to do: <br>

509
510
<ul>

Russ Fish's avatar
Russ Fish committed
511
  <li> Access to shares under ssh without having to type a password. </li>
512

Russ Fish's avatar
Russ Fish committed
513
  <li> Emulab <code>syncerver</code> and <code>slothd</code>. </li>
514

Russ Fish's avatar
Russ Fish committed
515
  <li> Use Sysprep (MS WADS) for multi-hardware XP images. </li>
516
517

  <li> Console support (<code>agetty</code> serial line speed 115.2kb doesn't
Russ Fish's avatar
Russ Fish committed
518
       work?) </li> 
519
520
521

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

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

524
</ul>
525