Friday, 25 April 2008

Asterisk on VMWare

Many people have reported problems with Asterisk running on VMWare and having just decided to play with Asterisk I ran into them myself. First, here's what worked for me (using CentOS 4.6):

  • On the VMWare host machine, edit the .vmx config file for your image and add:
host.noTSC = "TRUE"
ptsc.noTSC = "TRUE"

  • In your CentOS image, disable the cpuspeed process:
chkconfig cpuspeed off

It actually worked fine for me without the extra kernel parameters but the CPU usage seemed to be slightly lower at idle with them added so I left them. The issue seems to be the default clock rate (1000Hz) used by most 2.6 kernels which can't be adequately serviced in the VM guests. The kernel-vm kernel is built with the clock rate at 100Hz.

Apparently CentOS 5 has a new kernel that allows you to specify divider=10 clocksource=acpi_pm to the kernel which tells it to run at 1/10 the clock rate it was compiled with.

Some links:
http://communities.vmware.com/message/762010#762010
http://bugs.centos.org/view.php?id=2189
http://communities.vmware.com/thread/101492?start=0&tstart=0
http://communities.vmware.com/thread/101406