Shared Virtual Reference Disks
The article below is outdated. Recent versions of VMware workstations fully support this feature.
I often create large numbers of disposable lab VMs by cloning reference disks. While it is straightforward to copy disk images, this method is time-consuming and can use up a lot disk space. For WMware 3.x, there is an advanced tech tip that describes how a reference disk can be shared between multiple VMs running concurrently. What follows is an adaption of this procedure for VMware Workstation 4.x.
To start with a disclaimer, use this procedure at your own risk.
Step 1: Create the reference virtual disk image.
You can do this in any way that meets your requirements, either by installing and customizing a new VM, by creating a reference disk in an existing VM…
Step 2: Power down any instances of VMs that access the reference image
Due to file locking, you probably don’t have a choice anyway.
Step 3: Write-protect the reference image
It is absolutely essential that VMware can’t modify the reference image.
Repeat from step 4 onwards for every VM that will use the reference image.
Step 4: Add the reference disk to a target VM
When creating a new VM, select an existing disk image. Otherwise, add a new disk to an existing VM.
Step 5: Change the directory for redo logs and snapshots.
Edit the virtual machine settings, select the options tab, and explicitely change the working directory of the general settings to a directory other than the one where the reference image is stored.
Step 6: Take a snapshot
This is the rough equivalent of configuring an undoable disk in VMware 3.
Step 7: Power on target VM
Power on the VM and power it off as soon as it starts to load (i.e. it’s past the BIOS screens). You should have a set of redo files for the reference disk.
Step 8: Change the disk image to the redo file
In the target VM, change the disk image used by the reference disk to the redo file. If the reference disk has a base name of refdisk.vmdk, you should switch to show all in the file browser and select the redo file
Conclusion
If the target VM is powered up, the shared reference disk will run in a copy-on-write mode, where each VM instance has its own set of redo files. This type of configuration may have subtle or not so subtle problems; it is best used to clone many short-lived instances of a reference disk.
