Sunday, November 19, 2006

VMWare Server with ALSA DMix

In Linux, the sound-card drivers normally do not support concurrent access. This means when you playing MP3, your instant-chat program (e.g. gaim) will be mute. To solve this problem, there are some projects -- ALSA DMix, ESD, ARTSD, JACK.... However, most of them are not compatible each other and the applications needs to use the API provided by the specific project.

In my Ubuntu desktop, I use ALSA DMix with ESD approach. Most applications should support ALSA or ESD. However, VMWare support neither of them. VMWare only use native /dev/dsp device for sounding. After some searching on the web, we can use the LD_PRELOAD libossa.so trick.

After half day of try-and-error, the following is the summary of how to make VMWare work with ALSA:
  • make sure you installed the package "olsa-oss".
  • add suid bit to /usr/lib/libaoss.so by command chmod +s /usr/lib/libaoss.so
  • rename the /usr/lib/vmware/bin/vmware-vmx to vmware-vmx-real
  • create a shell script /usr/lib/vmware/bin/vmware-vmx with the following contents
#!/bin/sh
LD_PRELOAD=libaoss.so exec /usr/lib/vmware/bin/vmware-vmx-real $@
  • make sure the shell script is executable (i.e. chmod a+x /usr/lib/vmware/bin/vmware-vmx-real)
  • If your guest OS's disk image file is "single growable virtual disk" type with size large than 2G, you should use the vmware-vdiskmanager to split it into several files. Otherwise, you will encounter the problem of "File too large".
Related Link:
A Post about VMWare works with ALSA
ALSA DMix

2 comments:

Dawnthorn said...

You are a god! I spent a couple of hours trying to get this to work with VMWare server after doing it with the player and I gave up. Thanks a ton. This works great.

Unknown said...

Why did you need setuid bit on the library file? It just seemed ilogical to me, and I tested without it, working perfectly with Vmware Workstation 6.5.1.