The following information details how to set up an environment to demonstrate Kevin Reed's (reed21) prototype for his cs423 project. This prototype has been tested on Windows XP Professional with Service Pack 3 installed. These instructions where then tested on a second computer also running Windows XP Professional with Service Pack 3.
The VMWrapper.exe was developed using Microsoft Visual C++ 2008 Express Edition. You can download the MS project I used to see how it works.
You can also download and read the just the cpp code.
- Download and Install VMware Server 2.0 (build 122589). You get this here.
- Once installed, you can access the console by opening https://127.0.0.1:8333/. The Login Name and Password are the login name and password of the Windows user who installed VMware Server.
- On the Summary Tab that is presented after logging in, look for the 'Datastores' section. Installation will create a default datastore called 'standard'. Note the location for this datastore. You can now log out.
- Download the virtual machine image that is used for the prototype (note 1). This should be downloaded to the directory that the 'standard' datastore points to. Once it is downloaded, unzip it. If the default datastore was C:\Virtual Machines, then you should now have a file at C:\Virtual Machines\x86LinuxOpenSuse11\x86LinuxOpenSuse11.vmdk (7 files in total will be in the same directory).
- Download the prototype files. This can be placed in any location. The zip file will unzip to create a directory called reed21Demo
- Change your directory to be within the reed21Demo directory
- Run the prototype using the following command line (note 2):
C:\temp\reed21Demo> VMWrapper.exe "[standard] x86LinuxOpenSuse11\\x86LinuxOpenSuse11.vmx" username password
username and password are the same as was used to log into the VMware Server console (i.e. the username and password that VMware was installed under)
- The prototype will now run. If it runs correctly you will see the following (note 3):
C:\temp\reed21Demo>VMWrapper.exe "[standard] x86LinuxOpenSuse11\\x86LinuxOpenSuse11.vmx" Mickey m0u5e
Message: Connected to VMware Server 2.0
Message: Registered virtual machine
Message: Opened virtual machine and obtained a handle
Message: Handle for snapshot obtained (VMware Server 2.0 only allows one snapshot)
Message: Reverted to snapshot
Message: Virtual machine turned on
Message: VM Tools availabled in guest (guest has finished booting)
Message: Login on guest suceeded
Message: Created /home/user/share on guest
Message: Copied run.sh from host to guest
Message: Copied test from host to guest
Message: Copied busy from host to guest
Message: chmod has been run to give us execute permission on run.sh, test and busy
Message: run.sh has been run (runs the test application with a working directory set)
Message: Busy has been started (uses lots of cpu time)
Message: Sleeping 10 seconds so that you can watch task manager and see the virtual machine using cpu time
Message: The virtual machine has been paused
Message: Sleeping 10 seconds so that you can watch Task Manager and see the virtual machine NOT using cpu time
Message: The virtual machine has been unpaused
Message: Waiting for busy to finish running (you can see the virtual machine using cpu time on the task manager again)
Message: busy has finished
Message: Copied output.txt from guest to host
Message: The virtual machine has been turned off
Message: The virtual machine has been unregistered
Message: exiting
- You should now find a file called output.txt in the reed21Demo. This contains the output of the 'test' application that estimated the value of pi
Note 1
Moving a virtual machine image from one computer and then registering it cause a prompt in the VMware Server console that requires the user to take action (to acknowledge that the virtual machine has been moved or copied). However, if you insert the line 'uuid.action = "create"' into the x86LinuxOpenSuse11.vmx file,
then it will regenerate the UUID for the virtual machine and not trigger the prompt.
Note 2
If you get a message stating that VMWrapper is in an invalid format, then download and install the Microsoft Visual C++ 2008 Redistributable Package (x86)
Note 2
If during execution you see:
C:\temp\reed21Demo>VMWrapper.exe "[standard] x86LinuxOpenSuse11\\x86LinuxOpenSuse11.vmx" Mickey m0u5e
Message: Connected to VMware Server 2.0
Message: Registered virtual machine
Message: Wait for VM Open returned error. Error Code: 4000
Message: Wait for power off returned error. Error Code: 1000
Message: The virtual machine has been unregistered
Message: exiting
Then you have encountered a bug with VMware server. Due to a sequence of events I haven't been able to determine, the open function will sometimes not be able to locate the virtual machine that was just registered. However, if you manually register it then it will work correctly. Re-installing the VMware server software will resolve the issue (but is not desirable). You can manually register the image by doing the following steps:
- Log into the VMware Server console by opening https://127.0.0.1:8333/
- In the 'Commands' section of the 'Summary' tab, click on Add Virtual Machine to Inventory
- In the 'Inventory' section of the dialogue that opens up, expand the 'standard' datastore and then click on 'x86LinuxOpenSuse11'
- You should now see in the 'Contents' section a file called x86LinuxOpenSuse11.vmx. Click on this then click 'OK'
- A virtual machine called 'x86LinuxOpenSuse' should now appear in the 'Inventory' section