As much as possible, we have left Windows XP "stock". Some Windows services are shut down: Messenger, SSDP Discovery Service, Universal Plug and Play Device Host, and Remote Registry. Other setting changes are described under Network config and Routing below.
Before booting the node at swap-in time, Emulab loads a
fresh image of Windows XP
onto the experiment nodes in parallel, using our
Emulab software automatically configures each Windows XP node, providing the
expected experiment user environment including: user accounts and Emulab SSH
keys; remote home, project, and shared directories; and network connections.
All of the Emulab experiment automation and monitoring services have been ported
to run on Windows.
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.
The Emulab web interface manages a separate Windows password in the user profile, as well as making login connections to the experiment nodes. Remote Desktop Protocol service supports Windows Desktop logins from the user's workstation screen to the experiment node. SSH and Serial Console command-line connections are also supported.
Windows XP installations are more hardware dependent than Linux or FreeBSD. At present, this Windows XP image only runs on the Emulab pc850 and pc3000 node types.
The second-biggest difference is that shared directories are provided not by the NFS (Network File System) protocol, but instead by the SMB (Server Message Block) protocol, otherwise known as Windows File Sharing. The Client for Microsoft Networks software contacts the SMB server, in this case Samba running on the file server known as Fs (an alias for Users.) 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.)
rdesktopfor 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 will have to type it each time if you use the Microsoft RDC (Remote Desktop Connector) client program from a Windows machine.
The default Windows password is randomly generated. It's easy to change it to something easier to remember.
To see or edit your Windows password, log in to Emulab, and click Manage User Profile and then Edit Profile under User Options. You will see Windows Password fields in addition to the regular Emulab Password fields.
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.
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.
tb-set-node-os $node WINXP-UPDATE tb-set-hardware $node pc850Notice that the above image only runs on the pc850 Emulab node type. At present, you have to explicitly specify a different image name and hardware type to run on the pc3000's . For example:
tb-set-node-os $node WINXP-UPDATE-pc3000 tb-set-hardware $node pc3000Currently available Windows XP images are:
Note: The Windows Firewall is disabled by default (as it will inform you repeatedly!)
slothdservice. TCP/IP address autoconfiguration is disabled ( IPAutoconfigurationEnabled=0 ) 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.
The Emulab pc850 node type has five network interfaces, and the pc3000 has
six. However, the Windows
ipconfig /all command only
shows the configuration information for the enabled network interfaces. There
will always be one enabled control net
interface on the 155.98.36 network. The others are disabled if not used
in your experiment.
If you specified links or LANs in your experiment network
topology , 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
Connection 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
ipconfigreport an ip address and mask of
0.0.0.0, while the TCP/IP properties dialog boxes show the proper values.
rtproto Sessionis not supported. However, basic routing between connected network components of your experiment topology works. The Windows command to see the routing tables is
route print. The IPEnableRouter=1 registry key is set on multi-homed hosts in the experiment network, before they are rebooted to change the hostname.
rtproto Static is supported in all recent WINXP images,
but not in WINXP-02-16 or before.
rtproto Static-old or
will work in any image.
There is more information on routing in the Routing Section of the Emulab Tutorial.
If your experiment does not require that full freedom, consider adding a control net firewall node statement to your experiment ns file. This allows you to control the security level of your connection to the Internet by a style keyword , for example:
set fw [new Firewall $ns] $fw set-type ipfw2-vlan $fw set-style basic
Details: DHCP packets aren't passed until the firewall node is loaded with FreeBSD and started up. That takes 3-4 minutes on a pc850 and leaves the Windows nodes in the FreeBSD PXE-loader image waiting for DHCP. Periodically, they time-out and reload the PXE-loader, which adds up to another minute after the firewall node is up, if you're unlucky.
After 10 minutes in the reloading state, Emulab gives up and reboots the node to try again, even if Frisbee is working hard and nearly done. 5-6 minutes is hardly enough time to Frisbee a WINXP image into a pc850. Either the image load time-out needs to be extended in experiments that have a firewall configured, or the load timer shouldn't start ticking until the firewall is up.
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:
node_reboot pcxxxIf 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:
/sbin/rebootThe EmulabStartup service runs
/usr/local/etc/emulab/rc/rc.bootsetup, logging output to
/var/log/bootsetup.log. If you're having swap-in problems and rc.bootsetup doesn't finish sending
ISUPto Emulab within 10 minutes, the node will be rebooted. After a couple of reboot cycles without a
ISUP, Emulab gives up on the node.
If you want to prevent swap-in failure, whether to diagnose the problem or to continue
manually, you may add this line to your
for each Windows node:
tb-set-node-failure-action $node "nonfatal"
$node is replaced with the node variable, of course.)
It will still complain if it doesn't get the ISUP signal at the end of rc.bootsetup, but the swap-in will proceed and allow you to figure out what's happening.
consolecommand on Ops. You will have to type your Windows Password when logging in, except for SSH when you have ssh-agent keys loaded.
Or you can set up your browser to automatically connect in one click from the Emulab web interface and pop up a connection window. Once you start swapping in an experiment, the Emulab Experiment Information page contains a table of the physical node ID and logical node name, status, and connection buttons. The captions at the top 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:
sysvinitpackages. 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.
rdesktopclient software is used from Linux and Unix client workstations.
~/.profile. Don't worry about your home directory dot-files being shared among Windows, FreeBSD, and Linux nodes; non-existent directories in the
$PATHare ignored by shells.
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.
ping [ -dfqrv ] host [ packetsize [count [ preload]]]
You can load it yourself now using Cygwin Setup .
ifconfig -a. The Windows system equivalents are
The Fast User Switching 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.
SSH doesn't count as a desktop, so you can ssh in and use this command:
qwinsta (Query WINdows STAtion) to show existing
winstation sessions and their session ID's, and this one to reset
(kill) a session by ID:
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".
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.
rxvtshells run in windows with X-like cut-and-paste mouse clicks:
NOTE: 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
-a 16 argument
for 16-bit color. Or, you can over-ride the rxvt defaults by
putting lines in your
~/.Xdefaults file like this:
Cygwinshells run in a Windows Terminal window, just as the Windows cmd.exe does. These are the ones to use if you're connecting from a Windows workstation.
Quick-edit mode is on by default, so you can cut-and-paste freely between your local workstation desktop and your remote RDP desktops.
In a Windows Terminal window on your RDP remote desktop, the quick-edit cut-and-paste mouse clicks are:
C:\Documents and Settings, and creates the registry key (folder) for persistent settings for that user.
We arrange that early in the user's login process, a user HOME environment variable value is set in the user's registry. Otherwise Emacs wouldn't know how to find your .emacs setup file in your remotely mounted home directory.
User "root" is special, and has a local home directory under
/home is a Cygwin symbolic link to
C:\Documents and Settings.
To restart the computer, run /sbin/reboot, or use the "Shut Down" menu of Task Manager. One way to start Task Manager is to right-click on the background of the Taskbar at the bottom of the screen and select "Task Manager".
preparescript as user
rootsince there are no
sudocommands on Windows. This is optional on the other OS types, but on Windows, proper TCP/IP network setup depends on
% 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:This works becuase you are part of the Windows
Administratorsgroup. Otherwise you would have to already know the root password to change it.
preparebelow, the root password will not match the definitions of the Emulab Windows services (daemons) that run as root, so they will not start up.
preparewill be unable to remove their login profile directories if they are logged in. (See QWINSTA.)
rootthrough the Console or SSH, using the password you set above, then run the
preparecommand. (It will print "Must be root to run this script!" and do nothing if not run as root.)
/usr/local/etc/emulab/prepareIf run without option arguments,
preparewill 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.)
-poption to specify the root password on the command line:
/usr/local/etc/emulab/prepare -p myRootPwd
-noption says not to change the passwords at all, and the Emulab Windows services are not redefined.
-soption is used to make hardware-independent images using the Windows
Sysprepdeploy tool. If you use it with the
-noption instead of giving a password, it assumes that you separately blank the Administrator password, or edit your Administrator password into the
[GuiUnattended]AdminPasswordentry of the sysprep.inf file.
/usr/local/etc/emulab/prepare -s -p myRootPwd
prepare -srefuses to run from an SSH or RDP login.
Sysprepis used by PC hardware manufacturers as they make XP installation disks with their own drivers installed. The Sysprep option to run an unattended
Mini-Setupat first boot instead of the normal "Out Of the Box Experience" is used in some large corporate roll-outs. We do both.
/share/windows/sysprep directory contains
various service pack versions of the XP deploy tools, appropriate
device driver directories, and a draft sysprep.inf file to direct the
automated install process.
Unfortunately, the cost of having just one WINXP image for all PC types is that Mini-setup is slow, being a stripped-down NT kernel. It also forces an additional reboot when it's finished installing drivers. Together, this adds between 4 and 5 minutes to the total Windows swap-in time, increasing it from about 10 minutes to around 15.
The Cygwin command
cygcheck -c lists the packages that are
installed, and their current version number and status.
Package-specific notes and/or documentation for installed packages are in
The Cygwin package site lists
the available pre-compiled packages and provides a search engine.
If you want to install more Cygwin pre-compiled packages, run the graphical installer:
The Cygwin command
cygcheck -l package-name 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
Tutorial for more information about installing RPM's and tarballs.
Watch out for post-install scripts in:
Many packages not in the Cygwin package site have also been ported to Cygwin already. Download the sources to an experiment node and try
./configure make make installas usual.
UNC paths with leading double-slashes
//fs are used to
access the SMB Shares under Cygwin. They are then further mounted to the
usual Unix paths for the shared directories:
mount 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
/share/windows contains Windows software. See
/share/windows/README.bin for descriptions of binary packages
available for installation.
In Windows GUI programs, you can just type the UNC path into the Address bar
or a file-open dialog with backslashes, e.g.
\\fs\<username>. User and project shares are marked "not
browsable", so just
\\fs shows only
Windows limitation: There is only one protection mask for everything in a
whole mount/share under SMB. It's set in the "share properties" on the server
(Samba config file in this case) so
chmod will do you no
good across SMB.
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.
Single-quotes work best. Doubling each backslash also works. This
must also be done inside double-quotes. Examples:
\\un\\quoted. (The difference between double and single
quotes is that $variable references and back-quoted command execution
are expanded in double-quotes.)
When you invoke Windows (as opposed to Cygwin) commands, for example
net use, they will know nothing about Unix-style paths in
their arguments. The
cygpath utility is an aid to converting paths
between the Unix and Windows conventions.
cygpath -w converts its arguments to Windows format, where
-u converts its arguments to Unix format, e.g.
$ cygpath -w /cygdrive/c/WINDOWS c:\WINDOWS $ cygpath -u 'c:\WINDOWS' /cygdrive/c/WINDOWS
Cygwin mount points are shown by the
Note that there is a hard-coded limit of 30 mount points in Cygwin.
Attempts to use the Cygwin
mount command after that will
We discussed UNC
//machine paths to SMB shares above .
Another special case is the Unix root, "
C:\cygwin in the Windows filesystem.
Cygwin knows about drive letter prefixes like
C: , which are equivalent to
/cygdrive/<drive-letter> . However,
/dev, isn't a real directory,
so you can't
Some Windows software requires drive-letter mounts to be created for its use.
You can use the Windows
net use command to
associate drive letters with UNC paths to SMB shares, e.g.
net use W: '\\fs\share\windows'
You can use the Windows
subst command to associate
drive letters with local paths, e.g.
subst T: 'C:\Temp'
Filename completion in Cygwin shells with
doesn't work following a drive-letter prefix, but it works normally
/cygdrive/ prefix. Also, filename completion is
case-sensitive, although the underlying Windows is case-insensitive, so
a filename in the wrong case is still opened properly.
/etc/groupcontain Windows SID's as user and group ID's. Your Windows UID is the computer SID with a user number appended, something like
Cygwin commands, such as
ls -ln, and
chown/chgrp, use the numeric suffix as the uid,
1334. This is different from your normal Emulab Unix
user ID number, and the Samba server takes care of the
id command reports your user id and group
Note that all users are in group
None on XP.
Contrary to the name, this is a group that contains all users.
It was named
Everybody on Windows 2000, which was a better
The Windows equivalent to running a Unix command as
is membership in the Windows
Emulab project members who have either
group_root privileges are put in group
wheel, another alias for
Administrators. Project members with
privileges are not members of the wheel group.
ssh a command to the node as the target user, as
long as you arrange for the proper authentication.
There is not usually a Windows account named
We create one as part of the Emulab setup to own installed software,
and to run services and Unix scripts that check that they're running
with root privileges. The
root user does not have Samba
privileges to access Samba shared mounts, including
For C/C++ code, there is a
setuid() function in the Cygwin
library, which "impersonates" the user if proper setup is done first.
On Windows, unlike Unix, file permissions can lock out root, Administrator, or SYSTEM user access. Many Unix scripts don't bother with permissions if they're running as root, and hence need modification to run on Cygwin.
.exefiles the same as executable files without the
.exesuffix, but with execute permissions turned on. This breaks down in Makefile actions and scripts, where
ls -l, and
installcommands may need an explicit
^X-5-2makes another one.
/usr/local/bin/emacs executable is a symlink to
/cygdrive/c/emacs-21.3/bin/runemacs.exe, which starts up an Emacs
on the desktop. This only works under RDP, since SSH logins have a null
There is also a
/usr/local/bin/emacs-exe executable, a symlink to
/cygdrive/c/emacs-21.3/bin/emacs.exe, which is only useful as an
Emacs compiler. It could be used to run Emacs in an SSH or Serial Console
login window with the
-nw (no windows) flag, except that it exits with
standard input is not a tty. Another thing not to try is running
emacs-exe -nw in a Bash or TCSH shell on the RDP desktop. It
crashed Windows XP when I tried it.
c:/emacs-21.3/site-lisp/makes Cygwin mounts visible within NtEmacs. It doesn't do Cygwin symlinks yet.
^Xcut on selection,
The installer for the
Microsoft Framework Version 1.1 Redistributable Package is downloaded to
/share/windows/dotnetfx.exe. Run it to download the
runtime, agreeing to the EULA. It takes a few minutes, and uses 104 meg of
If you want to develop .NET code as well as run it, you will need to install the .NET Framework SDK Version 1.1 .
preparescript now requires you to set your own