Category Archives: Linux

Using ALSA for sound with VMware Workstation 6.5 on an Ubuntu 8.04 host

I built a new desktop PC for use at home, and I installed Ubuntu 8.04 on it. In anticipation of replacing the windows XP desktop with it, I’ve been playing with the evaluation license of VMware Workstation 6.5.

Somewhat annoyingly, VMware uses the lowest-common-denominator Linux sound API, OSS. Unfortunately, OSS, as typically implemented, only allows one application to have the sound device open at once. This might have been a acceptable design in 1995, but it sucks today.

However, as many people mention in several places on the web, you can use the ALSA-OSS emulation layer to give you the benefits of ALSA (such as multiple applications opening the audio device at once) with VMware. Almost all of them involve modifying the script which starts vmware to LD_PRELOAD the library. However, this seems to not work in the latest versions, since there are multiple levels of shell scripts which start the actual binary, and some of them modify the LD_PRELOAD environment variable. As far as I can discern, the “right” way is to add this line to /etc/vmware/config :

preload = “/usr/lib/”

And now, sound works just fine for me in VMware.
(Note, I did have to “sudo apt-get install alsa-oss” beforehand.)

Making the delete key work in screen (termcap capabilities)

I believe this is something I figured out long ago, and completely forgot since, so I had to figure it out again. I’m using a new virtualized Linux server from Slicehost, and as usual, I have some stuff running under Screen. Now, Screen is a crufty old program, but it’s immensely useful for leaving things running and detaching from them (and later reattaching), along with multiplexing several terminals into one.

But, I started having a problem I’d had before. Inside screen, my delete key wasn’t sending ^? (ascii 127), but it was sending ^[[3~ (the escape sequence for that key). Outside of screen, it was sending ^? as I’d expect. (I’m going to avoid the whole backspace [^H] versus delete [^?] argument here — OS X and Linux distributions seem to all come with it configured for delete out of the box these days, and that’s most of what I deal with.)

I poked around, and found some workarounds like this one, but I really want to fix it, rather than lying to it about my terminal type.

This did however remind me of what was wrong. My termcap (well, terminfo) was missing the proper capability for the delete key. So, I looked what the terminal type claimed by OS X’s was:

$ echo $TERM

I poked around some .screenrc examples and an old termcap file and composed this line to put in my .screenrc :

termcapinfo xterm-color kD=\E[3~

And it works! I didn’t even have to start a new screen session, I just detached and re-attached.