This is obsolete, use VirtualBox now.

Windows XP as a Linux application


You are running Linux, and are happy except for a few business requirements that need exact Windows compatibility. Examples include the Track Changes feature in Word to referee papers, or Internet Explorer for an airline reservation or grant proposal web site. What are your options?

You can use VMware to turn Windows XP into a Linux application that starts cleanly the same way each time, regardless of what the user or viruses do to it. The feature list includes:

Linux laptop users may find the Windows XP application has more attractive integration and maintenance properties than dual booting. Or have both: dual boot to native Windows to test and integrate new hardware, and use the Windows XP application for daily use.

How to implement it

You need one Linux machine running VMware Server, a separate Linux machine running VMware Player, and a shell script. The installers for Server and Player want to deinstall each other, and for now I'm using two separate machines. My Server machine is a Dell Optiplex GX270 manufactured in 2004, with 2 Gig of memory and 40 Gig of disk.
# Install Ubuntu 7.10 from cd
# log in
-> Application -> Accessories -> Terminal
$ sudo -i
# reinsert 7.10 cd for apt-get's use
$ apt-get -y install build-essential emacs22 emacs22-el elisp-manual

# you might add these for your development convenience
$ apt-get -y install openssh-server tkdiff

$ apt-get -y update
$ apt-get -y dist-upgrade

# wait while all this is downloaded and installed.  I had to hit enter
# on one text-based query box.

# reboot and remove cd before boot
# log in
$ sudo -i
# so that ssh incoming to root works
$ passwd root

Some user interface settings I suggest

# Make window focus follow mouse

$ gconftool-2 --set /apps/metacity/general/focus_mode mouse  --type string

# Make gnome applications accept Emacs editing keys

$ gconftool-2 --set /desktop/gnome/interface/gtk_key_theme Emacs --type string

# Make the left Windows key dig through windows

-> System -> Preferences -> Keyboard Shortcuts ->
	Window Management -> Raise obscured window, otherwise lower ->
		Left Windows logo key

-> System -> Preferences -> Appearance -> Fonts -> Subpixel smoothing (LCDs)

-> System -> Preferences -> Appearance -> Visual Effects -> None

Installing VMware Server

-> Application -> Accessories -> Terminal
$ sudo -i

# Install VMware-server-1.0.6-91891.tar.gz

$ tar -zxvf VMware-server-1.0.6-91891.tar.gz
$ cd vmware-server-distrib
$ ./

In which directory do you want to install the binary files? 
[/usr/bin] /depot/vmware-server-1.0/bin

# When you see this error, ignore it, just hit enter:

	Please specify a port for remote console connections to use [902] 

	inetd: no process killed
	Unable to make the Internet super-server (inetd) re-read its configuration 
	file.  Please restart inetd by hand:
	killall -v -HUP inetd

	Hit enter to continue. 

# Take prompted suggestions for everything else, except:

In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines] /depot/vmware-virtual-machines

# Enter no-cost serial number you received from

Creating a virtual machine to hold Windows XP

$ /depot/vmware-server-1.0/bin/vmware

-> Create a new virtual machine


1. Microsoft Windows

Windows XP Professional

Name: "XP"
Location: /depot/vmware-virtual-machines/XP

Use Network Address Translation (NAT)

Disk size 8 Gig
Allocate all disk space now
Split disk into 2GB files

-> Edit virtual machine settings

	# On a Dell Optiplex GX270 from 2004, with 2 Gig of memory
	752 Meg of memory

Installing Window XP in the virtual machine

# Insert Win XP Pro cd

# close Ubuntu file browser which opens on cd

-> Power on this virtual machine

# Do Windows XP install as prompted by Windows

Format the partition using the NTFS file system (Quick)

If during the Windows XP loading you get an error like

An error has been encountered that prevents Setup from continuing
One of the components that Windows needs to continue setup could not be installed.
The parameter is incorrect.
Press OK to view the Setup log file

Installation Failed: D:\I386\asms.  Error message: the parameter is incorrect.
It means your cd is a bad copy and you need a replacement. If you put the cd into the tray in Ubuntu and try to tar off the I386/asms directory, tar will report read errors on the bad files. Replace the cd, quit VMware, delete the XP directory, and redo the virtual machine creation and XP install from scratch. Continue as if we didn't get that error:
hostname is "VMware",
organization is "something appropriate for you",
username is "user"

-> Shut Down from Start menu

Load Office 2003

-> Power on this virtual machine

# Insert the Office 2003 cd, Windows will autorun it

	Do you want to check for updates?  Yes

	Installed service pack 3 update for Office 2003

		Did not choose beta updater version

		Closed Office 2003 update web site browser when prompted

Turned on automatic Windows update (to prevent error messages)

Did Windows update

	Installed ActiveX control it asked for

	Installed updating program it asked for

	Update includes Service Pack 3

		Rejected Internet Explorer version 7

	Downloaded MacAfee to Desktop

		Cleaned IE, -> Tools -> Internet Options

			Set start page
			deleted Cookies
			deleted Temporary files
			deleted downloaded files
			cleared Browsing history

Install McAfee antivirus

Make sure to select Perpetual License

Install VMware tools.

These handle the mouse going in and out of the VMware window, resize Windows' idea of the video card when the user resizes the window of VMware, and support File Sharing with the world outside VMware.
-> VMware -> VM -> Install VMware tools

# Must use Complete instead of Typical to get File Sharing driver
Setup type: Complete

InstallShield completes

Accept video improvement suggestions

	VMware tools icon in taskbar

		Options -> Time sync between VM and host

-> Start -> Shut Down

-> VMware -> File -> Quit

Add in file sharing and other features

VMware Server will not add in the File Sharing configuration file entries, the relevant menu entry from Edit virtual machine settings is completely missing; but if the config entries exist, VMware Player will operate with them. We tell the file sharing to act like it was root, and then the files it can access will be filtered by whatever user runs vmplayer. vmplayer does not run suid.
$ emacs /depot/vmware-virtual-machines/XP/XP.vmx


	uuid.action = "create"
	usb.present = "TRUE"
	usb.generic.autoconnect = "FALSE"
	sound.present = "TRUE"
	sound.fileName = "-1"
	sound.autodetect = "TRUE"
	sound.virtualDev = "es1371"
	sharedFolder.maxNum = "1"
	sharedFolder.option = "alwaysEnabled"
	sharedFolder0.present = "TRUE"
	sharedFolder0.enabled = "TRUE"
	sharedFolder0.readAccess = "TRUE"
	sharedFolder0.writeAccess = "TRUE"
	sharedFolder0.hostPath = "/"
	sharedFolder0.guestName = "root"
	sharedFolder0.expiration = "never" = "FALSE"

Now startup and shutdown the Windows repeatedly

Keep rebooting it until you stop seeing balloon messages and so forth, and it comes up clean. Whatever state you leave it in now is what your users will see.

Copy the state of the XP machine off someplace for safekeeping

This is the state you will return to and start from, to make any changes to what is inside the Windows XP world.
$ cd /depot/vmware-virtual-machines/XP
$ tar -cf /someplace-safe/XP-this-date.tar .

Add the snapshot feature

Snapshots are managed by a script to reset the modifications before and after each run:
$ /depot/vmware-server-1.0/bin/vmware

# Do not power on virtual machine.

-> Snapshot

These files get modified:


These files get added:

If you did -> VM -> Snapshot -> Remove Snapshot, most of these changes will be reversed. To reverse all of them, go back to the tar copy.

Save the unmodified snapshot files

These are what we're going to roll back to, outside the scope of VMware Player:
$ for i in XP.vmx *000001* ; do cp -va $i $i.master ; done

Copy the whole XP directory to ANOTHER machine

You will run VMware Player on this other machine. The installers for VMware Server and Player fight badly if you try to put them both on the same machine, no matter if you tell Server to install into another path. The installer finds conflicts with: the kernel modules loaded, the compiled kernel modules in existance at all, the previous networking setup, the previous global conf files for VMware, and on and on:
root@here# cd / ; tar -cf - depot/vmware-virtual-machines/XP | ssh root@elsewhere 'cd / ; tar -xvpf -'

root@elsewhere# cd /depot/vmware-virtual-machines/XP
The .vmx file must be writable by whoever is running the player. Both user-triggered option changes and notes to itself about generated ethernet addresses and so forth get written to it:
$ chmod 777 .
$ chmod 644 *
$ chmod 755 XP.vmx*

Add the script to control the rollback

The script controls the rollback each time Windows XP is started up. Adjust pathnames to local taste:
$ mkdir -p /depot/windows-1.0/bin
$ cd /depot/windows-1.0/bin
$ cat > windows
#!/bin/bash -e

trap '
set +x
if [ -z "$CLEANEXIT" ]
        echo "$0: ERROR Unexpected exit with return value of $SAVEDSTATUS"
        exit $SAVEDSTATUS
fi' EXIT



cd "$BASE/$EXT"

rm -f $SNAPFILES *.log

for i in $SNAPFILES
	cp -a "${i}.master" "$i"

vmplayer "$EXT.vmx"

# Reset entirely so the native VMware Server 'open a machine' dialog
# will still work

rm -f $SNAPFILES *.log

for i in $SNAPFILES
	cp -a "${i}.master" "$i"


exit 0

$ chmod +x windows
Add /depot/windows-1.0/bin to PATH in whatever way you do that locally.

Install VMware Player

$ tar -zxvf VMware-player-2.0.4-93057.i386.tar.gz 
$ cd vmware-player-distrib

$ ./

$ vmplayer
# accept license
-> Player -> Quit

Run the "windows" script, and see if everything works

$ /depot/windows-1.0/bin/windows

-> Player -> Shared Folders -> Always enabled

# In Windows Explorer, your Linux root directory is at:

	\\.host\Shared Folders

# This file is created by Player

$ chmod 644 /depot/vmware-virtual-machines/XP/XP.vmxf

Distribute sitewide

Now you can tar copy /depot/vmware-virtual-machines/XP and /depot/windows-1.0 to other machines, install VMware Player on them, and run this Windows image without managing those other copies as separate, evolving entities.

If you get a duplicate machine warning when you run Player, click OK and ignore it.

When you choose to evolve what is on the Windows, such as to set up a PostScript driver and network printers, I suggest going back to the pre-snapshot tar copy, making the changes to a copy of that, and moving forward from there.

Sidebar: Why isn't file sharing working under VMware player?

You type "\\.host\Shared Folders" into a Windows explorer and it doesn't find the host, yet you've added the file sharing entries to the .vmx file, and enabled File Sharing in VMware at powerup time. Is the Windows driver installed for VMware file sharing? Here's how to check:

-> Start -> Help and Support

	Search: network diagnostics

	Fix a Problem
	o Network Diagnostics
	Scan your System
Look at the bottom for:
Modems and Network Adaptors
[+]Network Clients
	VMware Shared Folders	<--- !!!
If it isn't there, do:
-> VMware -> VM -> Install VMware tools
And this time pick:
Setup type: Complete

Sidebar: Snapshot management notes

It seems that VMware server doesn't have the feature to collapse a snapshot back into the base hard drive image; the choices are either to run on the snapshot forever, or to Revert, make unrevertable changes, then take another Snapshot. This suggests a tar copy as a snapshot operation to provide the feature missing from VMware Server.,289483,sid179_gci1277577,00.html

The easiest way to recombine these snapshots into a single virtual hard disk file is to download a 30-day trial version of VMware Workstation 5. Using Workstation it is possible to clone a virtual hard disk or collapse a snapshot chain back to one virtual hard disk file.

(C) University of Florida, Gainesville, FL 32611; (352) 392-1941.
This page was last updated Tue Sep 25 00:30:37 EDT 2012