|
|
To print: Select File and then Print from your browser's menu
-------------------------------------------------------------- This story was printed from ZDNet Australia. --------------------------------------------------------------
|
Software testing: Go virtual By Michael Jackman, TechRepublic May 18, 2004 URL: http://www.zdnet.com.au/insight/software/soa/Software-testing-Go-virtual/0,139023769,139147893,00.htm
If you frequently test hardware, operating systems, and applications, you know that you're likely to spend many frustrating hours rebooting while you troubleshoot problem apps, drivers, services, and patches. If so, creating a test lab using virtual machines software will save you a lot of downtime. Two popular applications are Virtual PC (formerly made by Connectix, but recently purchased by Microsoft) and VMware. Virtual PC software allows you to install and run guest operating systems within your computer's operating system, which acts as a host. The virtual systems share the workstation's devices and are stored in files. Therefore, each virtual machine is isolated from the other and from the host; if one fails, the host machine and all the other virtual machines remain unaffected. You can continue to work while you reboot a crashed guest. In addition to testing, VMware and Virtual PC allow you to run different platforms and platform-specific software that may be incompatible with your OS. For example, within Windows 2000, you could run a Linux Web server and test Office 2003 on Windows XP. Further, workstations equipped with virtual guest systems allow you to consolidate training and IT support onto fewer workstations. VMware and Virtual PC share similar features and concepts. The major differences between the two are that VMware versions support Linux either as a guest or host operating system, while Virtual PC does not, and that one Virtual PC version allows you to run Windows within Mac operating systems. Installation, hardware, and software requirements VMware Workstation 4.0 for Windows can be installed on Windows NT, 2000 (workstations and servers), Windows XP Professional and Home Edition, and Windows Server 2003. For more specific information about host requirements, see the VMware Workstation specs. VMware 4.0 supports the following guest operating systems:
The minimum hardware requirements for running VMware Workstation 4.0 are:
To enable VMware to run more than one guest OS at a time, you will need much more than the CPU and RAM minimums. Your test station will benefit from a processor of at least 1 GHz, 1 GB or more of RAM, and separate hard drives for each virtual machine you plan to run simultaneously so they won't compete for read/write operations. There are several other reasons for reserving plenty of disk space for virtual machines. Each time you save a guest OS configuration (called a Snapshot, discussed below), you need enough file space to store it. Further, your virtual disk can be configured to grow dynamically. (You can choose to automatically split virtual disks into 2GB files as they grow.) At some point, you will need to defragment and shrink your virtual systems. To do so, you'll need somewhat more free space than the amount taken up by the virtual disk files. For example, if you plan to allow a virtual Windows XP installation to grow to 10 GB, leave about 22 GB on a hard drive. If you plan on taking periodic Snapshots of the disk configuration, then leave about 30 or more GB on the drive. Once VMware is installed, you use it to create a test lab by:
Configuring new virtual machines To create a new virtual machine, choose File | New | New Virtual Machine from the VMware menu. Choose Custom Installation. Pick a guest operating system from the drop-down list. Next, set a name and a location for the new virtual machine. The next few screens allow you to configure RAM size, networking method, and other devices. If you need to change these settings later, you can do so by choosing Edit | Edit Virtual Machine Settings from the VMware menu.
Choose a memory allocation based on the recommended guest range. This is provided by VMware based on your total available memory (Figure A).
Next, configure networking. Choose Bridged, Network Address Translation (NAT), Host-Only, or None (Figure B). NAT requires few or no additional steps and is the easiest to set up; Bridged Networking involves setting up a separate IP address for the guest on the network.
On the following screen, select Create A New Virtual Disk. Other choices are to reuse an existing virtual disk and have VMware access a physical disk. In the latter case, the guest OS reads and writes directly to the drive or partition. This is useful for multiboot machines if you want to run the alternate operating system(s) as a guest. However, it is not the best choice for a test machine, as directly accessing the physical disk invalidates the protections of using isolated virtual disks. Next, specify a virtual disk capacity (Figure C). Remember to leave ample room for testing, as well as enough space on the hard drive where the virtual disk will be stored for shrinking and defragmenting. Splitting the disk into 2-GB files makes it easier for VMware to perform these operations. If you desire, choose to allocate the entire virtual disk at this time rather than having it grow dynamically.
Virtual disks grow dynamically unless you specify otherwise. Splitting the disk into 2-GB files will ease later defragmentation and shrinking operations. Maximum disk capacity workaround The Specify Disk Capacity dialog states that a virtual disk can never be larger than the maximum capacity you allocate now. This is not strictly true. VMware has published a workaround using Norton Ghost to increase disk capacity later. However, the process is tedious, so it's better to set a workable limit at the beginning. An easier way to work around a disk capacity limit is to add additional virtual disks to a guest OS. After you complete the Disk Capacity dialog, VMware will allocate the space. This operation can take some time. Figure D shows VMware's tabbed display. You can switch from one guest to another using this interface. Highlighted is the new virtual OS, "Windows 2000 Pro on X:\." After configuring this guest, it receives a tab even though it has not yet been powered on. The summary lists all configured devices for that virtual machine.
Whenever the guest is powered down, you may add or modify a device by clicking Edit Virtual Machine Settings. For example, to allow printing through the host, in the settings dialog, click Add, then select Parallel Port. VMware supports most standard devices you will need. Modify a device by double-clicking it in the edit dialog. For example, if you have more than one CD drive, Auto Detect might sense the drive without the installation disk when the OS is powered on. Double-click CD-ROM to change from Auto Detect to a specified drive letter. You are limited to one CD-ROM per virtual machine. Installing a virtual OS Inputting within the new virtual machine Initially, you must first click the mouse within the VMware window to enter any mouse or keyboard input into the guest machine. To remove focus from the guest, simultaneously press [CTR][ALT]. After you install the new OS and VMware tools, the host and guest systems will automatically grab focus for keyboard and mouse input. If VMware doesn't boot from the installation CD, access the virtual machine BIOS when booting up by pressing F2. (First, click the mouse within the guest screen to give it focus.) Select the boot menu and add CD-ROM Drive (Figure E). Exit the BIOS by pressing [F10].
Your operating system setup program will load and run exactly as it would for a physical machine. Here are a few items to be aware of:
For more information, tips, and tricks, check VMware's Guest Operating System Installation Guide and the VMware support page. Installing VMware tools To install VMware tools on a Windows guest, start the guest operating system. When it is running, choose File | Install VMware Tools from the VMware menu. Additional VMware tool-tweaks for various Windows OSs are listed in the VMware Workstation manual that comes with the program. To install the tools on a Linux guest, start Linux and log on as administrator or superuser (su -). Do not start the X server. Choose File | Install Vmware Tools from the VMware menu. The next steps are performed in the Linux console: Mount the VMware Tools virtual CD-ROM image and change to a working directory (i.e., /tmp). (This image is an ISO that appears as a CD-ROM to the Linux guest.) To do so, type: Next, unmount the CD-ROM image by typing: After that, run the VMware Tools installer and exit from the root account by typing: Finally, type startx to launch your graphical environment. Once it loads, launch the VMware Tools background application in a terminal window by typing, vmware-toolbox &. Installing applications, updates, and patches Using Snapshots To create a Snapshot, with the guest OS running, choose Snapshot | Save Snapshot from the VMware menu. A progress bar will appear with the message Saving Virtual Machine State. This operation can take some time. Snapshot information is stored in a file with the extension .vmsn, and additional files with REDO as part of the extension. Each time you create a Snapshot, the previous one is updated with the virtual machine's current configuration. To return the guest OS to a saved configuration, choose Snapshot | Revert To Snapshot from the VMware menu. You can prevent the current Snapshot from being updated by selecting Edit | Virtual Machine Settings, clicking the Options tab, and then clicking Snapshot. Check the box, Lock This Snapshot (Figure F).
During testing, you may find it useful to revert the guest OS to the Snapshot state each time it is powered down. In the Snapshot Options panel, under When Powering Off, click Revert To The Snapshot. Alternatively, you may choose to update your Snapshot when the virtual machine is powered off. To remove a Snapshot, first power down the guest OS, then choose Snapshot | Remove Snapshot. If the OS is not powered off, this option will be grayed out. Copying, backing up, moving, and renaming virtual disks
TechRepublic is the online community and information resource for all IT professionals, from support staff to executives. We offer in-depth technical articles written for IT professionals by IT professionals. In addition to articles on everything from Windows to e-mail to firewalls, we offer IT industry analysis, downloads, management tips, discussion forums, and e-newsletters.
Copyright © 2009 CBS Interactive, a CBS Company. All Rights Reserved. |