Posts Tagged ‘vmware’

Speed-up your virtual machine created with VMware Player

If your virtual machine created with VMware Player becames very slow and takes a long time to complete some operations it’s time to improve its performance!
Close your VM, and open the *.vmx file with a text editor. Then add at the end of the file the following lines:

mainMem.useNamedFile = "FALSE"
sched.mem.pshare.enable = "FALSE"
MemTrimRate=0
MemAllowAutoScaleDown = "FALSE"
prefvmx.useRecommendedLockedMemSize = "TRUE"
prefvmx.minVmMemPct = "100"

Remember to not duplicate the keywords (in case you already have some lines set) otherwise the VM will not start.
The above lines totally reserve the memory requested by the VM to the guest system and avoid to continuosly ask to the host (and so to the swap file) for new memory chunks.

Try yourself and give me a feedback!

Shrink Ext4 partition on VMware player

Few days ago I spent some times to try to shrink my Ubuntu 11.04 appliance with root partition formatted with EXT4 filesystem.

The main problem is that the current VMware tools (8.4.6, build-385536) does not support the ext4 shrink. If you run sudo vmware-toolbox, your root partition is formatted in ext4 and you try to execute the shrink an error message like the following could appear.

Anyway there is a trick to streamline the final vmdk size.
Run this command within a shell into the guest system:

sudo dd if=/dev/zero of=/zero.raw bs=20480
rm -f /zero.raw

Then, shutdown the virtual image and download the vdiskmanager tool from VMware website.
Now run the vmware-vdiskmanager with the -k parameter:

vmware-diskmanager -k /path/to/image.vmdk

This operation will take a while, but at the end you will get a considerable smaller vmdk image file.