Bits and Bytes from Johnny Mac

Friday, December 22, 2006

Running VMware Server in FC6

I run VMware Server 1.0.1 for a number of different development tasks. At some point after upgrading Fedora, I used vmware-config.pl to reconfigure VMware for my new kernel. This basically means recompiling a few VMware kernel modules. I ran into this error message that halted my progress:
/tmp/vmware-config4/vmnet-only/procfs.c:33:26: error: linux/config.h: No such file o directory
make[2]: *** [/tmp/vmware-config4/vmnet-only/procfs.o] Error 1
make[1]: *** [_module_/tmp/vmware-config4/vmnet-only] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.18-1.2868.fc6-i686'
make: *** [vmnet.ko] Error 2
make: Leaving directory `/tmp/vmware-config4/vmnet-only'
Unable to build the vmnet module.

At first glance, missing a kernel header file seems like a bad thing. It turns out to be a simple issue though. The use of linux/config.h has been deprecated. It remained as a placeholder for a while, but it has now been completely removed. Since VMware has not been getting anything from that header, the fix is simple:

touch /lib/modules/2.6.18-1.2868.fc6/build/include/linux/config.h

After that, vmware-config.pl completes successfully, and the world is right again. The only downer is that you have to do this extra step every time you upgrade the kernel. In all likelihood though, you would think VMware would address this issue in the next release.

Saturday, December 16, 2006

Beryl Workaround

As I noted in my previous post, I recently switched from FC5 to FC6. It was a very easy upgrade, and FC6 is most definitely worth it. The fonts are so much crisper, yum is way faster, and many things are generally just a little more polished than FC5.

One of the whizziest new features is the 3D desktop. This is enabled by use of OpenGL acceleration in the window manager. Very, very cool. Fedora encourages using Compiz as the window manager to get access to the eye candy.

This really tickled my fancy, so I kept digging into Compiz. As I looked more into Compiz, I found a fork of that project called Beryl. Perhaps I didn't dig deeply enough into Compiz, but one thing I didn't like was that there were almost zero configuration options and no plugins came with it by default.

Beryl, on the other hand, comes with all kinds of goodies. It is highly configurable, and it comes with all kinds of special effects by default. So I stuck with Beryl.

The only downer so far is that resuming from suspend does not work correctly. Everything on my laptop is functioning as expected except that the video does not resume cleanly. I can ssh in from another machine and restart beryl-manager at which point everything is fine. That's a simple enough workaround, but it's kind of annoying, and it doesn't work too well when I am moving my laptop from one network to another.

To work around this issue, I wrote a little perl script to act as a watchdog. I use this to launch beryl-manager in my session startup, and I modified my resume_video function in /etc/pm/functions-nvidia (part of pm-utils) to signal the watchdog. The watchdog then kills beryl (the window manager) and beryl-manager and restarts beryl-manager. This seems to work very reliably.

Hopefully we'll get a real fix soon. The behavior is kind of similar to the bad ole days when the nVidia driver was kind of wonky. I'm not 100% sure that it is Beryl. Compiz appears to exhibit the same behavior, but Metacity has no problem. Perhaps there's something flaky in the nVidia OpenGL code. However, since restarting Beryl fixes the issue, they have an opportunity to make life better for the user.

In any event, Beryl is well worth a little extra work. I'm never looking back!

Here's how to implement the watchdog workaround:
  • Download the watchdog script
  • tar xzvf beryl_watchdog.tar.gz
  • mv beryl_watchdog.pl <installation location> (e.g. ~/bin, /usr/local/bin)
  • Edit System->Preferences->More Preferences->Sessions->Startup Programs
  • Add beryl_watchdog.pl to the list of programs to start
  • Edit /etc/pm/functions-nvidia and add 'killall -USR1 beryl_watchdog.pl' as the last line in resume_video()
The net effect of all this is:
  • The watchdog script will be launched as part of the session startup
  • Upon resuming from suspend, the watchdog will get a USR1 signal
  • Upon receiving that signal the watchdog script will kill beryl and beryl-manager and relaunch beryl-manager
The last thing to note is that this only addresses Gnome usage. I'm not sure there is a problem under KDE. If the same problem does exist, the watchdog script may be useful, but the mechanics of including it in the session startup will differ.

This is a dirty little hack, but it is the difference between being able to use suspend plus Beryl and not. Hopefully this will be short-lived and I can delete this in a couple of months.

Thursday, December 14, 2006

Fix AdobeReader on Fedora Core 6

I recently upgraded from Fedora Core 5 to Fedora Core 6 on my laptop. It was one of the easiest in place upgrades I've ever done. However, I did experience a glitch with Adobe Acrobat Reader (AdobeReader_enu-7.0.8-1).

When running from the command line, I got this error in an endless loop:

jmcnair@laptop.mcnair.org:0 $ acroread
expr: syntax error
expr: syntax error
...


I found the solution in this forum:
FULL Fedora Core 6 Probs - LinuxQuestions.org

In that forum, there is a link to this small patch.

To apply the patch, become root and then:

cd
wget http://remi.collet.free.fr/files/acroread.patch
cd /usr/local/Adobe/Acrobat7.0/bin
cp -a acroread acroread.orig
patch -p0 < ~/acroread.patch


You should see this output:
patching file acroread


You should then be able to run 'acroread' from the command line with no errors.