StressFree | David Harrison

Open source development & digital architectural collaboration

VMWare Server 2.0 optimisations

Submitted by David on 19 July 2009 - 8:42pm
Printer-friendly version

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:

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.

 

Instant improvement

Thank you for this contribution.  Following these steps provided some instant performance improvements on our VMWare servers running on Debian.

I suspect it was I/O related, but followed all the items above anyway with good results... Previously very slow Windows 2000 VMachines went from 90-100% CPU down to 10-20% with no other changes.

Thanks again.

Better settings on ubuntu 9.x o 10.x and system stability

I had read your comment about

"why to use ubuntu higher that 8.04 with vmware?"

You say it makes no sense to go for a new untested/unstable system (kernel) when using a pretty well tested one is the best.

And this sounds good and obvious. Our goal is to have VMs working.. who cares about the back and under ground.

I agree, but anyway I ask you if the above settings should be applied to new kernels too and if they apply to vmware server 2.0.2 too.

Additionally I ask you your experience with vmware 64 bit installed on i.e. ubuntu 64 bit with 64 bit guests like win 2k8 64 bit. If any .. the pretty well tested combination for the virtualization system. I.e. vmware version + linux o.s. version + kernel version

Thank you

R.

Tuning Heavy VMs like Windows 2008 SBS Premium

I'm back since some time.

We worked hard trying to tune vmware server 2.0.2 on linux.

The results, either with a powerful hardware (ibm server with quad core xeon, 8gb ram and sas raid) were still an unusable windows sbs VM, too much poor performances slowing everything.

This bad result was such bad with one lonely VM, the win server sbs.

The main issue we noticed is that giving the VM a second core, performances were getting double the poor.

I'm sorry to say that but that is the true:
we downloaded and installed XenServer free, installed it on the same identical hardware and did the same single windows sbs guest installation.
Performances are close to be a physical server.

We will not install vmware esxi, no time for additional tests.

The result is that heavy windows guests on vmware server 2.0.2 are impossible to be used.

Kind regards

Thank you for the tips

Robert

Thanks for the feedback

I have also been experimenting with different virtualisation platforms given the uncertainty that exists around VMWare Server's future.

VirtualBox from Oracle is shaping up very nicely. The command line functionality is very powerful and performance-wise it seems very good. The only slight drawback is that it does not have a web interface, and if a GUI is required it was to be run within X-Windows on the host. This is not a huge problem, but it is nice not having to run too much extra software on a hypervisor.

XenServer command line interface

Thank you for the tip.

About XenServer and its command line interface:
you should give a read to the Admin Guide. It is 235 pages which the last 130 (more than half of the book) are all about the XE command line interface reference. This provides you the full both xen, SR and VMs control allowing you powerful scripting features (if needed)

You know you have the XenCenter as GUI (windows only) or OpenXenManager (python multi platform)

My next job is to make it run with drbd (already done by other guys on the web)

Bye
R.

Compilation problems with later kernels

VMWare Server works fine with later kernels but you need to be aware of the module compilation problems you may encounter. These can be overcome, but personally I am opting to wait until VMWare release an updated version of Server that supports later kernels.

Note: There is no guarantee of this, given VMWare haven't released an update in 2010 and this recent news.

As far as later kernels go it will depend on your distribution as to what kernel parameters need setting. The only real way to know is to run some tests.

As far as 64bit clients go I have run 64bit Linux clients on VMWare Server 2 64bit without any problems. I have not run Windows 64bit clients, but I have run Windows 32bit clients on VMWare Server 64bit without any problems.

 

Best combination

Thank you for the reply.

And so:

if you would go to install a new server for virtualization with vmware server on linux, which is the linux system that you would use and with which kernel? I mean the combination you would trust much more. (thank you)

R.

Ubuntu Server 8.04LTS with the default

Given the rumor that VMWare may discontinue VMWare Server 2 next year I would stick with Ubuntu Server 8.04LTS with the default kernel (which is supported until 2013).

Assuming VMWare Server is discontinued, you will definitely want to be migrated away VMWare Server by 2013, so 8.04 going end of life should not be an issue.

As far as kernels go I would stick with the Ubuntu 8.04 default (2.6.24) unless there is a need to use something else for hardware compatibility. You need to patch VMWare Server's kernel modules to work with later kernels, and over time that is painful - especially if Server is discontinued and the patches stop being developed.

If you have not already committed to VMWare Server I would consider an alternative such as VMWare ESXi, XenServer or KVM. The hardware support for ESXi is pretty limited but overall it is a great hypervisor. XenServer maybe a bit of a dead-end, but it has management tools that are on par with VMWare. KVM is still very immature, but it has strong support from Red Hat and Ubuntu, so the management tools for it should continue to get better.

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.