Trixbox under VMWare Server 2.0 hosted on Linux

squiggly
Posts: 1
Member Since:
2008-10-04

I had Trixbox running fine under VMWare on an older machine. When I moved to a new, fast, dual core, 64-bit server, all audio playback became choppy. I just spent an entire day getting it working, and I'd like to share the details with the trixbox community at large. All of this information came from various places on the web, but none of it was collected together in one nice place.

I can't claim this will work for everyone, but it worked for me:

First, copy the vmware tools rpm to the trixbox host.
- select "Install VMWare Tools" from the VMWare monitor
- login to trixbox as root and run these commands:

mkdir mnt
mount /dev/cdrom mnt
cp mnt/*.rpm .

Now, let's grab a new kernel:

wget dev.centos.org/~tru/kernel-vm/5/RPMS/i386/kernel-vm-2.6.18-92.1.13.el5.i686.rpm
wget dev.centos.org/~tru/kernel-vm/5/RPMS/i386/kernel-vm-devel-2.6.18-92.1.13.el5.i686.rpm

This kernel is optimized specifically for running under VMWare. Without it, I had no luck getting rid of choppy audio.

Since we're upgrading the kernel, we also need to grab the zaptel source:

wget www.voicetronix.com.au/Downloads/asterisk/zaptel-wcopenpci-1.4.9vt1.tar.gz

Finally, we need the gcc compiler:

yum install gcc

Now we have all the pieces, so let's put them together. First, install the new kernel:

rpm -ivh kernel-vm-*

Edit the kernel options in /boot/grub/menu.lst:

vi /boot/grub/menu.lst

Make sure "default=0" is set at the top so the new kernel boots. Add the "acpi=off" and "clock=pit" options to the kernel you just installed. It should now look like this:

        kernel /vmlinuz-2.6.18-92.1.13.el5vm ro root=LABEL=/ acpi=off clock=pit

The first option disables ACPI (Advanced Configuration and Power Interface) for the kernel, which seems to interfere with timing, and the second forces the kernel to use a more accurate technique for synchronizing the vm time with the host time. (Another thread recommended also putting "nosmp noapic nolapic". That actually made it worse for me. YMMV.)

We're ready to boot the new kernel:

init 6

When trixbox is back up, log in again as root. Now we can install the VMWare tools:

vmware-config-tools.pl

Pick the default on every question by hitting enter.

Now, we'll rebuild the zaptel drivers:

tar xzf zaptel-wcopenpci-1.4.9vt1.tar.gz
cd  zaptel-wcopenpci-1.4.9vt1
./configure
make && make install && make config

Now edit /etc/sysconfig/zaptel and comment out all of the "MODULES=..." lines, EXCEPT the "ztdummy" driver. It will be commented out by default, so you'll need to uncomment it:

vi /etc/sysconfig/zaptel

Reboot one last time and you should have a stutter-free trixbox running under VMWare!

init 6

Sources:
http://pbxinaflash.net/vm/
http://www.trixbox.org/forums/trixbox-forums/help/crappy-sound-pl...



bubbapcguy
Posts: 3774
Member Since:
2006-06-02
easy

The easy is to just linux on host box and not windos



Net-Ninja
Posts: 22
Member Since:
2006-10-16
Well done, thank you

@squiggly,
Thank you for taking the time to put up your instructions. These steps remove dependency errors and some of the 'broken trixbox' issues after updating from a fresh vm install. Few things to mention...


When following these steps, be sure to note:
- the address from dev.centos.org for the kernel is: ..el5.xxx not a 1 but an L as in Larry.
- make sure to install the kernel and the kernel-devel like squiggly indicates
- you could alternately run the command: rpm -Uvh dev.centos.org/the-rest-of-the-address for the file targeted for download and install.
- for those like me that hate to edit with vi, you can use the command: nano -w filename-to-edit

When installing the vmware tools, note the following:
- trixbox core doesn't include 'make' so install it with yum install make
- you have to go to the folder where you copied the installer to run the rpm install command, use locate VMwareT* to find the vmware-tools rpm file, then enter: rpm -ivh VMwareTools* to install vmware tools. Once done, run the vmware-config-tools.pl script as instructed by squiggly.

When running the .pl script the first time, note the following:
- if you run into trouble with your kernel header location, run this to point to your headers: ls -d /usr/src/kernels/$(uname -r)*/include


Lastly:
- make sure you note that trixbox updates STILL break the box by changing all your customized passwords back to the original; therefore, make note of your orginal install passwords and keep them with your records for the current passwords. Maybe one day the 'developers' will allow for the upgrade to process without changing current passwords. (maybe by- ripping the customized passwords, storing in a temporary hash, performing current upgrade changing to original passwords, retrieving customized passwords from hash, then placing passwords back in place, complete checks and upgrade).

oh, and..
Bubba: ever think people might run vmserver on a linux/unix host? (rhetorical, don't reply)



adabbas
Posts: 191
Member Since:
2008-11-19
Squiggly, I do not think I

Squiggly,

I do not think I that I can thank you enough for posting this info here... It took me days to gather it from different places, but when I found it already posted here by you I was reassured that I am on the right track thanks.

Virtualization is the wave of the present, those who resist it are stuck in the past.



adambg
Posts: 1
Member Since:
2009-07-05
Thank you!

squiggly, I found your post just in time! I was just about to abandon trixbox as I was unable to solve this choppy audio problem under vmware.
Your instructions are perfect! Solved the problem and my frustration. Thanks!



cur8or
Posts: 2
Member Since:
2007-06-21
Fix the time

You could opt to set/correct your VM time after you boot with new kernel:

service ntpd stop
ntpdate 0.pool.ntp.org
hwclock --systohc

Check the date/time in both OS and VM side:
date;hwclock

If all looks OK - start NTP again:
service ntpd start

Also, after upgrading kernel on trixbox 2.6.2.3 my freepbx was broken, so I ran install_amp in /usr/src/tbm-pbxconfig-5.5.1 and that fixed it for me.



chinatti
Posts: 21
Member Since:
2009-11-14
Has anyone gotten this

Has anyone gotten this working under TrixBox 2.8.0.2, the latest stable version as of this post?

I'm playing around with getting a test VM going to evaluate trixbox, and I followed these instructions. I noticed that the kernel I installed (2.6.18-92.1.13.el5vm) had an older version than the version that came with 2.8.0.2 (2.6.18-128.1.10.el5xen). I got several new errors / warnings after rebooting the box, most notably regarding the DAHDI module:

FATAL: Module dahdi not found.
wct4xxp: FATAL Module wct4xxp not found [FAILED]
(and a bunch more like this...)

Thanks in advance...



andrew
Posts: 1472
Member Since:
2006-05-30
trixbox 2.8.02 now uses

trixbox 2.8.02 now uses Dahdi. The new Dahdi dummy has much better trimming then zaptel dummy. I have run 2.8.0.2 under vmware without any problems.



anirudhsahu
Posts: 1
Member Since:
2009-11-21
trixbox with VMware installation steps required

I want to learn trixbox installation and other setting. I have installed trixbox-2.8.0.1.iso on top of VMware2.5.0. After installation it ask for login. What should I do next.
If the instructions exist, please give me link.



SkykingOH
Posts: 9678
Member Since:
2007-12-17
Don't hijack another thread

Don't hijack another thread to get an answer to your question.

Go to the wiki and read the getting started guides.

--

Scott

aka "Skyking"



KarelJansen
Posts: 1
Member Since:
2009-12-24
2.8.0.3 and VMware

Hello Andrew,

I want to instal 2.8.0.3. under VMware workstation. I assume that .3 also uses Dahdi, and that I don't have to do al the mods that are mentioned in this tread?

k,regards
Karel



goodie
Posts: 1
Member Since:
2010-01-04
In 2.4 kernels the system

In 2.4 kernels the system timer was normally clocked at 100 Hz, while in 2.6 the default system timer is set to 1000 Hz (some other distros are not following these "rules", and USER_HZ is still 100). 1000 Hz is definately a good thing for desktop computers requiring fast interactive responses, but there are environments where this causes bad side effects.
Kernels compiled for SMP the system timer will requests twice as many interrupts when running on a single cpu and 2.5 as many when running on a dual cpu system.

Some cpus can't keep up with this interrupt rate, and the 2.6 kernel has code to detect this, but it can't always correct for lost ticks, and having the interrupt rate this high is also affecting the performance negatively. The negative effects of this has been experienced in virtual environments using VMware products.

In a virtual environment, a key indicator that these systems are not properly setup is if you have an idle guest system (indicated by tools inside the guest) while the host reports that this guest is using a lot of cpu (typically 20-30%). Another indicator is that the clock inside the guest is not keeping up with time. On newer cpu's these effects are not as visible as on old cpus (for example a Pentium 3 500-1000MHz), but also on newer cpus you will not be able to scale as well due to these issues, resulting in fewer guests systems per server host.

Kernel-vm was clocked at 100HZ instead of the usual 1000HZ provided by the regular CentOS kernels.

Anyway, since the release of CentOS 5.3, there is no longer any kernel-vm provided since it is no longer needed.

If you are running Centos 5.3 on 32 bit, all you have to do is:

modify the startup parameters in the bootloader (grub) by adding "clocksource=acpi_pm divider=10" at the end of the menu entry so it would read like this:

title CentOS (2.6.18-164.6.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.6.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet clocksource=acpi_pm divider=10
initrd /initrd-2.6.18-164.6.1.el5.img

If you are running Centos 5.3 on 64 bit:
substitute clocksource=acpi_pm with notsc

Here is a list for best practices published by vmware.

Note on CentOS 5.4 and divider=10
For CentOS 5.4 and later, divider=10 is a supported kernel configuration option, but is no longer necessary for accurate timekeeping. Using it reduces the frequency of timer interrupts by 10x, which reduces the CPU overhead of processing timer interrupts. This overhead is especially noticeable for idle virtual machines. The only drawback of using divider=10 is that the granularity of wakeups provided by the kernel changes from 1ms to 10ms. The vast majority of applications are not affected by this, but using divider=10 may not be the right tradeoff for some time sensitive applications. For CentOS 5.3 and earlier, divider=10 greatly improves timekeeping accuracy and is strongly recommended.

Hope this helps!



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.