windows.html 18.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!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>
    <li> <a href="#Experiment_setup"> Experiment setup for Windows nodes. </a></li>
    <li> <a href="#Login_connections"> Login connections to Windows. </a></li>
    <li> <a href="#RDP_details"> RDP details </a></li>
  </ul>
  <li> <a href="#Cygwin"> Cygwin </a> </li>
  <ul>
    <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>

38
39
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.
40
41
42

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
43
44
45
46
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>
47
48
49
50
51
52
53
54
55
56

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>

57
58
59
<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>
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

<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
running Windows.  It will eventually be presented behind-the-scenes to
rdesktop and Samba by our Web interface.  Meanwhile, you will need to type it
on each connection. <p>

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>

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

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

Currently available images are:

<ul>

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

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

</ul>

122
123
124
125
126
127
128
129
130
131
132
<div style="margin-left: 40px;"> <b>NOTE:</b> The only form of routing that is
currently supported on Windows is <b><code>rtproto Static-old</code></b>.
<code>rtproto Manual</code> should work too.  Don't put any other
<code>rtproto</code> statements in your .ns file.   <p>

If you 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>. <p>

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

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
Notice that Windows reboots an extra time after first swap-in on a node, after
changing the node name, to set up the network stack properly.   <p>

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

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

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>

189
  <li> Microsoft allows only <b>one desktop login at a time</b> to <i>Windows XP</i>,
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
       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
205
206
207
       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>
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222

       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,
223
       and <i>NtEmacs</i>.  </li> <br>
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
       
  <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>

265
266
267
       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>
268

269
270
271
  <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>
272
273
274
275
276
277
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
319
320
321
322

       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>

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

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>

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 from a
package you have installed, which will then installed automatically by Emulab
into all of the nodes of your experiment.  See the <a
href="http://www.emulab.net/tutorial/docwrapper.php3?docname=tutorial.html#TARBALLS">
Tutorial  </a> for more information. <p>

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>

323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<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>,
       <code>/project/&lt;pid&gt;</code>, 
       <code>/group/&lt;pid&gt;/&lt;gid&gt;</code>. </li> 
342

343
344
  <li> Bug: One protection mask for everything in a whole mount/share under
       SMB. </li>
345

346
</ul>
347
348
349

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

350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<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>
365

366
         <li> Shown in the <code>mount</code> and <code>df</code> commands. </li>
367

368
         <li> <code><b>/</b> == C:/cygwin</code> </li>
369

370
         <li> <code>/cygdrive/c == C:</code> </li>
371

372
373
374
375
376
377
378
379
380
381
382
         <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>
383
384
385
386
387
388

<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
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
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>
405

406
<ul>
407

408
409
  <li> Can drag-and-drop files from <i>Windows Explorer</i> to <i>NtEmacs</i>
       windows.  </li>
410

411
412
413
414
  <li> <code>cygmount.el</code> makes Cygwin mounts visible within
       <i>NtEmacs</i>.  </li>

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

416
       <ul>
417

418
419
420
421
422
423
424
425
         <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>
426
427
428
429
430
431

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

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

432
433
434
435
436
437
438
<ul>

  <li>The <i>Elvin</i> event system, and hence <code>progagent</code>, is
      not yet running. </li>

  <li> <code>syncerver</code>, <code>slothd</code> and
       <code>healthd</code>. </li> 
439

440
  <li> <code>linktest</code> </li>
441

442
443
  <li> Add a topomap distribution option to NFS for <code>rtproto
       Static</code>.  </li>
444

445
446
  <li> <code>gated</code> or equivelant OSPF daemon for <code>rtproto
       Session</code>.  </li>
447

448
449
450
451
452
453
454
455
456
457
458
  <li> Password and ssh keys both working (hopefully.) </li>

  <li> Console support (<code>agetty</code> serial line speed 115.2kb doesn't
       work.) </li> 

  <li> No such thing as load averages, see the Task Manager/Performance
       tab. </li> 

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

</ul>
459