Showing posts with label virtual machine. Show all posts
Showing posts with label virtual machine. Show all posts

10 May, 2008

Adding HardDrive to VMWare WinXp Virtual Machine

Underestimating the persistent storage of a virtual machine (VM) is pretty standard for me. I generally define my VM hard drive pretty conservatively to avoid wasting filesystem space, adding a new hard drive as required. This is the procedure I go through to add a new hard drive to a WinXp VM.

First, create a new virtual hard drive with VMWare. Begin by editing your VM preferences.



Next, add a new hard drive to your VM.





That completes adding the hard drive to the virtual machine, the next steps are required by the guest OS to get WinXp to recognize the new hard drive.

You first need to start up the disk management application.


You then need to open the c:\WINDOWS\system32\compmgmt property file.
Double-click on the Disk Management selection and a wizard will pop up, follow along with the wizard.










After the partion wizard has completed, exit computer management and you should now have a newly created hard drive on your system.
Viola.

09 May, 2008

Cloning a VMWare Virtual Machine

I've become a recent convert to the virtualization technologies that have been recently developed. I'll postpone the accolades of virtualization for future posts. For now, I'll concentrate on a task I find I regularly perform, but had some trouble locating how to do it.

Virtual machines opens the door for creating a VM template, where the guest OS is installed in a pre-defined manner, and task-specific instances of this template can be created and disposed of when the task is completed. For example, evaluation of a 30-day evaluation software installation is a prime example. Repeated installation, followed by un-installation, on a OS takes its toll leaving remnants of the products in unlikely locations. Creating a new VM instance dedicated to product evaluation and later deleting the entire VM once the product evaluation has completed is...in a word...simple.

This requires defining a VM template, simply put a generic OS installation that you'll clone for specific tasks. This is generated simply by creating a VM and installing the guest OS (documented in VMWare references). What isn't documented is how to clone/copy the VM. That will be the focus of the remainder of this post.

Suppose you have a VM template called WinXpBase, located in /VM/WinXpBase/ and you wish to clone this VM as Clone01 at /VM/Clone01/.

Step 1 - Copy the VM:
$ cp -rf /VM/WinXpBase /VM/Clone01

Step 2 - Update the Virtual Disks

$ cd /VM/Clone01
$ vmware-vdiskmanager -n WinXpBase.vmdk Clone01.vmdk

Step 3 - Rename Files Accordingly
$ mv WinXpBase.vmx Clone01.vmx
$ mv WinXpBase.vmsd Clone01.vmsd

Step 4 - Update File Name References in VM Properties
open the Clone01.vmx file in your favorite editor and search-n-replace instances of WinXpBase with Clone01

Step 5 - Add VM to VM List
As root, edit the following files:
/etc/vmware/vm-list
/etc/vmware/vm-list-private
duplicating the lines with WinXpBase, followed by search-n-replace with Clone01.

Fire up the VM Console and power up your new Clone01 VM.

Last Step - Apply New VM Identifier
Upon applying power to your new Clone01 VM, you'll encounter a pop-up similar to:

This is a one-time pop-up, you should select Create and you've just cloned your very own VM.