Barnoid’s Knowledge Base

Bits of Collected Wisdom

April 21st, 2007

vmplayer on Gentoo Linux 2.6.20

If vmplayer fails to compile on your 2.6.20 kernel with the following error

Extracting the sources of the vmmon module.

Building the vmmon module.

Building for VMware Player 1.0.2 or 1.0.3 or VMware Workstation 5.5.2 or 5.5.3.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config1/vmmon-only'
make -C /lib/modules/2.6.20-gentoo-r6/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-2.6.20-gentoo-r6'
CC [M]  /tmp/vmware-config1/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config1/vmmon-only/linux/driver.c:85:
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or ‘...’ before ‘compat_exit’
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or ‘...’ before ‘exit_code’
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: warning: type defaults to ‘int’ in declaration of ‘_syscall1’
make[2]: *** [/tmp/vmware-config1/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config1/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.20-gentoo-r6'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config1/vmmon-only'
Unable to build the vmmon module.

change dir to /opt/vmware/player/lib/modules/source and untar vmmon.tar

# cd /opt/vmware/player/lib/modules/source/
# tar xvf vmmon.tar
vmmon-only/
vmmon-only/autoconf/
vmmon-only/autoconf/geninclude.c
vmmon-only/autoconf/epoll.c
...

next, edit the file vmmon-only/include/compat_kernel.h and add the following preprocessor statements (in bold font)

/*
* compat_exit() provides an access to the exit() function. It must
* be named compat_exit(), as exit() (with different signature) is
* provided by x86-64, arm and other (but not by i386).
*/
#define __NR_compat_exit __NR_exit
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
static inline _syscall1(int, compat_exit, int, exit_code);
#endif

save, exit the editor, rename the original tarball and create an updated vmmon.tar tarball:

# mv vmmon.tar vmmon.orig.tar
# tar cvf vmmon.tar vmmon-only

now run vmware-config.pl again

# /opt/vmware/player/bin/vmware-config.pl
...
The configuration of VMware Player 1.0.3 build-34682 for Linux for this running
kernel completed successfully.

You can now run VMware Player by invoking the following command:
"/opt/vmware/player/bin/vmplayer".

Enjoy,

--the VMware team
April 20th, 2007

Courier-IMAP: Updating/Creating an X.509 Certificate for TLS Connections

To update the expired X.509 certificate of your courier-IMAP TLS connection, perform the following steps as root

First, get the location and filename of the server’s certificate and delete/rename it:

# cd /etc/courier-imap
# grep TLS_CERTFILE= imapd-ssl
TLS_CERTFILE=/etc/courier-imap/imapd.pem
# mv imapd.pem imapd.pem.old

Next, verify that the information in imapd.cnf is correct

# cat imapd.cnf

RANDFILE = /usr/share/imapd.rand

[ req ]
default_bits = 2048
encrypt_key = yes
distinguished_name = req_dn
x509_extensions = cert_type
prompt = no

[ req_dn ]
C=US
ST=California
L=San Fransisco
O=ACRL Server
OU=Advanced Compiler Research Lab
CN=aces.example.com
emailAddress=postmaster@aces.example.com

[ cert_type ]
nsCertType = server

Finally, generate a new certificate by executing mkimapdcert and restart the IMAP server:

# mkimapdcert
Generating a 2048 bit RSA private key
...........................................+++
..............+++
writing new private key to '/etc/courier-imap/imapd.pem'
-----
512 semi-random bytes loaded
Generating DH parameters, 512 bit long safe prime, generator 2
This is going to take a long time
............+................+....................+.+...............++*++*++*++*++*++*
subject= /C=US/ST=California/L=San Francisco/O=ACRL Server/OU=Advanced Compiler Research
Lab/CN=aces.example.com/emailAddress=postmaster@aces.example.com
notBefore=Apr 20 00:41:18 2007 GMT
notAfter=Apr 19 00:41:18 2008 GMT
SHA1 Fingerprint=9EF:9A:9F:8D:D5:D6:57:AB:15:83:12:F8:83:F1:33:1D:7E:E8:2A:F0
# /etc/init.d/courier-imapd-ssl restart
* Stopping courier-imapd over SSL ...               [ ok ]
* Starting courier-imapd over SSL ...               [ ok ]

Done!