VMWare Server 2.0 optimisations
VMWare Server 2.0 is emerging as a capable, zero cost alternative to VMWare ESX when used in combination with Ubuntu Server 8.04LTS. Unfortunately "out of the box" performance can be a little disappointing, especially when running guest Windows virtual machines. What follows are a few system tweaks that can improve performance without hampering overall system stability. I have not come up with these myself, instead they are pruned from the following pages:
- VMWare FAQ: I need more performance out of my VMware environment
- VMWare Communities: Performance tuning in Server 2.0
- Ubuntu Server Installation with VMware Server
Kernel parameters
In addition to the default Ubuntu Server kernel parameters, the following should be appended to the end of /etc/sysctl.conf.
vm.swappiness=0
vm.overcommit_memory=1
vm.dirty_background_ratio=5
vm.dirty_ratio=10
vm.dirty_expire_centisecs=1000
dev.rtc.max-user-freq=1024
Once added reboot the server to ensure their application is successful and permanent.
Create an in-memory temp drive
In the host's /tmp directory create a new directory named vmware (e.g. /tmp/vmware). This will be used as the mount point for a tmpfs (in-memory) partition for storing VM related, temporary files.
Edit /etc/fstab and add the /tmp/vmware partition to your list of mount points:
tmpfs /tmp/vmware tmpfs defaults,size=100% 0 0
Now if you execute the following command the tmpfs filesystem will be mounted at /tmp/vmware:
sudo mount /tmp/vmware
If successful, reboot the Ubuntu server to ensure the tmpfs partition is mounted at boot time.
VMWare Server configuration
Edit the /etc/vmware/config file and ensure the following configuration declarations are set:
prefvmx.minVmMemPct = "100"
prefvmx.useRecommendedLockedMemSize = "TRUE"
mainMem.partialLazySave = "TRUE"
mainMem.partialLazyRestore = "TRUE"
tmpDirectory = "/tmp/vmware"
mainMem.useNamedFile = "FALSE"
sched.mem.pshare.enable = "FALSE"
MemTrimRate = "0"
MemAllowAutoScaleDown = "FALSE"
These configuration declarations instruct VMWare Server to keep all virtual machines in memory and not to write unused blocks to disk. It also sets the temporary directory to the newly created tmpfs partition at /tmp/vmware.
Restart the VMWare Server process (sudo /etc/init.d/vmware restart) or reboot the server for these changes to take effect. The net result should be notably smoother virtual machine performance, especially when it comes to Windows guests.
Virtual machine tips
- Always use fully allocated disk images.
- Do not use snapshots as they are approximately 20% slower.
- Always install the VMWare Tools package.
- If running Linux make sure the kernel is compiled for running within a VM, or is using the correct boot time parameters.
Should VMWare Tools be installed on headless Linux guests (JeOS)
Hi David,
Just a quick query regarding your advice to always install VMWare Tools package...
If you are running headless (without GUIs) Linux guests, such as those using Ubuntu JeOS (specialised Ubuntu version especially created for use as a guest VM in VMWare), would installing VMWare Tools make any difference i.e. make guest run faster or perform better in VMWare?
As a headless guest, without the need for drag-and-drop or unity mode or the other main features installing VMWare Tools provides, installing the VMWare Tools is pointless in such sceanario?
Thanks,
Bab.
You get the network driver and time synchronisation
Beyond the GUI-level stuff the VMWare Tools package provides a VMWare network card driver and automatic time synchronisation. Whilst you can get away without the time synchronisation if you use NTP, the network driver does appear to run better under load. Also from a management perspective the Tools package exposes services for monitoring and interacting with the VMs from the host. The most obvious use of this is when you get into automatically loading virtual machines.