Tips for windows vmware images on linux


VMware is a great tool for developers, especially with the vmplayer being freely available. Here are some tips I've learned in using windows images (ie the guest OS) from your host OS, Linux.

Edit

Which VMware product?


VMware Workstation

If you are going to be creating OS images, changing them regularly then I would recommend getting VMware workstation. You can try and buy it and compare with the VMware player or VMware console. The workstation version allows you to easily clone an existing VMware image, create and modify an image and provides shared folders. All VMware players also provide a very handy command line and api set that you can use to manage your image. I use older vixperl api

VMware Player

VMware player allows you to create and run VMware images via a gui. It doesn't provide service management and is really geared to running one VMware image on your desktop or laptop. The distribution of vmplayer is getting wider

VMware Server

Similar to VMware player but is designed to run as a server that you contact via the VMware console. It is also designed as a traditional service to start when your machine restarts. It comes with some helper command line tools that can also manage an image via VMware-cmd.

I use VMware workstation and VMware server the most, unfortunately you can't run both on the same machine.

Edit

Creating a Windows image


Base install and activations

The first stage is to create an empty VMware image. This can be done with VMware server, or workstation or generated at sites like easyvmx.com. You will be asked the following

  1. What Guest operating system you will use. Apart from a defaults memory size calcuation it doesn't do much else.
  2. The name and location of the image file, if you have a separate physical disk put the image there for performance
  3. What networking. Start with bridged networking if you have no preference. You can always change this later. I use NAT so that I create a static IP address in windows that is private.

$ allow the disk size. This is very important, although you can 'add' extra disks later you can't change the original file through the tools. You have the option of allocating all the space Pre-allocating the disk size means the image will run faster but it takes a little longer to create and if you want to move the image file somewhere else you are now dealing with a huge file transfer. If you choose the non-allocated sparse file you can copy the initial image file easier.

Installing windows is as simple as booting the image from a CD/DVD. The boot menu by default doesn't list the CD device first so once you have changed the order your windows install should proceed. If you want to provide a cleaned image then you can also run sysprep on that image so that windows mini setup is run on boot. Microsoft have updated some of their licensing to allow VMware images so check online for the latest rights/permissions.

As VMware contains its own bios you cannot use the pre-install windows copy of your machine to activate as it will not be able to look up the right bios code. Traditional activation or volume copies of windows are fine.

Networking

You have a choice of 3 networking options to allow your windows machine to talk to the real world. The easiest option is bridged network. I use NAT addressing so that my windows machine can call out but the outside network cannot call in. The networking bridging is all handled by VMware. You tell windows to point to the VMware dns address and name resolution is done for you

Copying between Windows and Linux

You again have several options for copying files to and from windows.

  1. Shared Folders

The easiest option in VMware workstation is shared folders. You can specify which linux directories you want to appear as network places in your windows partition

  1. Traditional network tools

If you want to access files from a range of machines then installing an ftp client on the windows machine is again fairly easy and trouble free. A dedicate samba share will also work fine

  1. VMware API

VMware also comes with an C and a simple perl api set to run commands on the windows guest OS, this includes copying files between the two. The perl api [1] provides the following

VMCopyFileFromGuestToHost
VMCopyFileFromHostToGuest
VMRunProgramInGuest

Hari created a simple wrapper for us to also retrieve the appropriate vm handle from the server and login. (a combination of HostConnect, FindRunningVms, VMOpen and finally VMLoginInGuest]

Performance

Windows is certainly usable under VMware. Obviously the more memory you have on the system the better your performance will be. 2GB is ample for most scenarios. SQLserver and probably other databases take a performance hit run in this manner. In particular startup of SQLserver was noticeably slower that on bare metal. I haven't found any SQLserver tuning that makes a difference so far.

For the desktop VMware has a toolkit to enable some acceleration of graphics that you can download and will make the windows environment snappier, especially over a remote vnc connection

Misc

Crtl-Alt-Delete is available from the vmware windows. You can use remote desktop although I've never found the need to date.

Edit

Summary

VMware is a mature tool that works well for ease of creating virtual OS images. It's obviously not the only tool around, Xen is also available and has been catching up to VMware fast for running Windows on Linux and Virtual PC is availahle from Microsoft but only available on Windows.

However for scripting and tooling support of your Windows image from Linux, VMware is the one to measure against.


Most Recent

Most Popular

Most Active Categories




Back To Top Add New Article Printable Page
MediaWiki

This page has been accessed 15,046 times.

This page was last modified 22:35, 8 June 2007.