~
~
:wq

Tuesday, 26 January 2010

When did the system boot

spanish version - all english posts

The most common way to find out when was the last start is using the command "uptime":

root@blogspot:~# uptime
 22:28:20 up 22 days, 12:48,  1 user,  load average: 0.11, 0.04, 0.00

However that command doesn't tell us WHEN but HOW LONG!

Hence, only for curiosity, here are a few recipes to get that WHEN:

With "who":

root@blogspot:~# who -b
         system boot  2010-01-04 09:39

Using "last":

root@blogspot:~# last reboot
reboot   system boot  2.6.24-24-server Mon Jan  4 09:39 - 22:30 (22+12:51)

wtmp begins Mon Jan  4 09:34:08 2010

Unfortunately "last" depends on the "wtmp" registry which is regularily cleaned (depending on the distribution and how is logrotate configured). For this reason in servers with a high uptime the command "last reboot" is not quite useful.

Finally, the method I like best: Using the epoch timestamp from /proc/stat:

root@blogspot:~# date -d @$(sed -n 's/btime \(\d*\)/\1/p' /proc/stat)
Mon Jan  4 09:39:24 CET 2010

As usually, when I use sed, awk or grep I like to get their equivalents of each of them. So here are some alternatives of the above command (there are dozens of them):

With awk:

root@blogspot:~# date -d @$(awk '$1 ~ /btime/ {print $2}' /proc/stat)
Mon Jan  4 09:39:24 CET 2010

And with grep; in this case using it's perl regexp expressions compatibility:

root@blogspot:~# date -d @$(grep -Po '(?<=btime )(\d*)' /proc/stat)
Mon Jan  4 09:39:24 CET 2010

Cuándo se inició el sistema

english version - all spanish posts

La forma mas habitual de averiguar cuando se produjo el último inicio del sistema es mediante el comando uptime:

root@blogspot:~# uptime
 22:28:20 up 22 days, 12:48,  1 user,  load average: 0.11, 0.04, 0.00

Pero ese comando no nos dice CUANDO sino HACE CUANTO.

Así que aunque solo sea por curiosidad aquí van unas cuantas recetas para obtener el CUANDO:

Mediante who:

root@blogspot:~# who -b
         system boot  2010-01-04 09:39

Con last:

root@blogspot:~# last reboot
reboot   system boot  2.6.24-24-server Mon Jan  4 09:39 - 22:30 (22+12:51)

wtmp begins Mon Jan  4 09:34:08 2010

Lamentablemente "last" depende del registro wtmp que suele ser limpiado periódicamente (dependiendo de la distribución y de la configuración que se haga de logrotate). Por este motivo en servidores con un uptime muy elevado "last reboot" puede no ser demasiado útil.

Finalmente el método que más me gusta: a partir de la fecha epoch del arranque está almacenada en /proc/stat:

root@blogspot:~# date -d @$(sed -n 's/btime \(\d*\)/\1/p' /proc/stat)
Mon Jan  4 09:39:24 CET 2010

Como cada vez que uso sed, awk o grep me gusta obtener sus equivalentes para cada uno os propongo alguna alternativa (de las decenas que hay) al anterior comando sed; con awk:

root@blogspot:~# date -d @$(awk '$1 ~ /btime/ {print $2}' /proc/stat)
Mon Jan  4 09:39:24 CET 2010

Y con grep, en este caso con su compatibilidad con expresiones perl:

root@blogspot:~# date -d @$(grep -Po '(?<=btime )(\d*)' /proc/stat)
Mon Jan  4 09:39:24 CET 2010

Saturday, 23 January 2010

Counting pages

spanish version - all english posts

We have an application that generates PDF reports from rst formated text files. One of the requirements that the applicaction should have is the numbering of pages in the format "Page X of Y". Unfortunaltely our application is an implemetation of rst2pdf 0.11 which doesn't have shuch feature (at least in the version we have). Although it wouldn't be too complex to implement it by modifying the code of python-docutils, this goes against my principles: Packages should be maintained by their developers at first instance, and by the distro packagers at second stage (in this case Ubuntu LTS 8.04). As an administrator I do not like altering this policy because then we must be aware of future security updates that may break things when our changes will be overriden.

I'm a bash guy, hence I always tend to prototype using the shell. So here is a quick way to implement a method to count the total pages of a PDF document w/o installing any specific tool.

Total PDF pages obtained by grep:

hmontoliu@blogspot:/tmp$ grep -c --binary-files=text '/Page\b' foo.pdf
818

Of course the package xpdf-utils includes the command "pdfinfo" which reports the number of pages in a document; but again, if you can avoid installing extra packages on a server much better.

The avobe command also applies to ps documents with minor modifications:

hmontoliu@blogspot:/tmp$ grep -c '%%Page' bar.ps
5

More information at "man grep" :-)

Implementing this simple grep in python as a call to the shell or doing a grep-like stuff through re or string.count('text') is trivial; for example:

In [1]: with open('/tmp/foo.pdf','rb') as f:
   ...:     f.read().count('/Page>')
   ...:
   ...: 

Out[1]: 818

Contando páginas

english version - all spanish posts

Tenemos una aplicación que genera informes en PDFs a partir de ficheros con formato rst. Uno de los requisitos que debía tener la aplicación es la numeración de páginas de tipo "página X de Y". Lamentablemente se trata de una implementación a partir de rst2pdf 0.11 que de momento no incorpora esa característica (al menos en la versión que tenemos). Aunque no sería demasiado complejo implementarla modificando el código de python-docutils esto va en contra de mis principios: Los paquetes los deben mantener primero sus desarrolladores y en segunda instancia la distribución de turno; en este caso Ubuntu LTS 8.04. Como administrador no me gusta alterar esta política pues luego hay que estar pendiente de qué se rompe o se deja de romper con las actualizaciones de seguridad.

Como las cabras que tiran al monte, yo siempre tiro a la shell para «prototipar». Así que aquí va un método rápido de implementar que permite contar el total de páginas de un PDF sin herramientas específicas.

Páginas de un documento PDF obtenidas con grep:

hmontoliu@blogspot:/tmp$ grep -c --binary-files=text '/Page\b' foo.pdf
818

Por supuesto el paquete xpdf-utils incluye el comando "pdfinfo" que informa del número de páginas de un documento; pero, nuevamente, si se puede evitar la instalación de paquetes extra en un servidor mucho mejor.

El anterior grep nos vale también para documentos PS con mínimas modificaciones:

hmontoliu@blogspot:/tmp$ grep -c '%%Page' bar.ps
5

Mas información en man grep :-)

Implementar este sencillo grep en python como llamada a la shell o haciendo un grep-like directamente con python mediante re o con un cadena.count('texto') es trivial; por ejemplo:

In [1]: with open('/tmp/foo.pdf','rb') as f:
   ...:     f.read().count('/Page>')
   ...:
   ...: 

Out[1]: 818

Sunday, 17 January 2010

vmware-server-2.0.2 in ubuntu karmic

spanish version - all english posts

Update: I've written a post about the installation of vmware-server 2.0.x in Ubuntu 10.04 Lucid Lynx

Direct installation of VMware-server-2.0.2-203138.i386.tar.gz in Ubuntu 9.10 karmic exits with error when trying to compile the vmmon module:

[...]

None of the pre-built vmmon modules for VMware Server is suitable for your
running kernel.  Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.31-17-generic/build/include]

Extracting the sources of the vmmon module.

Building the vmmon module.

Using 2.6.x kernel build system.
make: se ingresa al directorio `/tmp/vmware-config3/vmmon-only'
make -C /lib/modules/2.6.31-17-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: se ingresa al directorio `/usr/src/linux-headers-2.6.31-17-generic'
  CC [M]  /tmp/vmware-config3/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config3/vmmon-only/linux/driver.c:31:
/tmp/vmware-config3/vmmon-only/./include/compat_wait.h:78: error: conflicting types for ‘poll_initwait’
include/linux/poll.h:70: note: previous declaration of ‘poll_initwait’ was here
In file included from /tmp/vmware-config3/vmmon-only/./include/vmware.h:38,
                 from /tmp/vmware-config3/vmmon-only/linux/driver.c:99:
/tmp/vmware-config3/vmmon-only/./include/vm_basic_types.h:108:7: warning: "__FreeBSD__" is not defined
In file included from /tmp/vmware-config3/vmmon-only/./include/vcpuset.h:103,
                 from /tmp/vmware-config3/vmmon-only/./include/modulecall.h:37,
                 from /tmp/vmware-config3/vmmon-only/./common/vmx86.h:33,
                 from /tmp/vmware-config3/vmmon-only/linux/driver.h:29,
                 from /tmp/vmware-config3/vmmon-only/linux/driver.c:101:
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:329:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:333:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:401:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:407:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:506:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:595:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:684:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:773:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:775:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:860:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:862:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:945:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:947:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:1028:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:1030:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:1223:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:1227:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:1536:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:1663:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config3/vmmon-only/./include/vm_basic_asm.h:46,
                 from /tmp/vmware-config3/vmmon-only/./include/rateconv.h:45,
                 from /tmp/vmware-config3/vmmon-only/./include/modulecall.h:40,
                 from /tmp/vmware-config3/vmmon-only/./common/vmx86.h:33,
                 from /tmp/vmware-config3/vmmon-only/linux/driver.h:29,
                 from /tmp/vmware-config3/vmmon-only/linux/driver.c:101:
/tmp/vmware-config3/vmmon-only/./include/vm_basic_asm_x86.h:62:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_basic_asm_x86.h:177:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_basic_asm_x86.h:346:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_basic_asm_x86.h:453:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config3/vmmon-only/./include/vm_asm.h:43,
                 from /tmp/vmware-config3/vmmon-only/linux/driver.c:103:
/tmp/vmware-config3/vmmon-only/./include/vm_asm_x86.h:486:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_asm_x86.h:779:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_asm_x86.h:820:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_asm_x86.h:922:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config3/vmmon-only/linux/driver.c:119:
/tmp/vmware-config3/vmmon-only/./common/hostif.h:53:7: warning: "WINNT_DDK" is not defined
/tmp/vmware-config3/vmmon-only/linux/driver.c: In function ‘LinuxDriverSyncCallOnEachCPU’:
/tmp/vmware-config3/vmmon-only/linux/driver.c:1423: error: too many arguments to function ‘smp_call_function’
/tmp/vmware-config3/vmmon-only/linux/driver.c: In function ‘LinuxDriver_Ioctl’:
/tmp/vmware-config3/vmmon-only/linux/driver.c:1987: error: ‘struct task_struct’ has no member named ‘euid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1987: error: ‘struct task_struct’ has no member named ‘uid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1988: error: ‘struct task_struct’ has no member named ‘fsuid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1988: error: ‘struct task_struct’ has no member named ‘uid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1989: error: ‘struct task_struct’ has no member named ‘egid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1989: error: ‘struct task_struct’ has no member named ‘gid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1990: error: ‘struct task_struct’ has no member named ‘fsgid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1990: error: ‘struct task_struct’ has no member named ‘gid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:2007: error: too many arguments to function ‘smp_call_function’
make[2]: *** [/tmp/vmware-config3/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config3/vmmon-only] Error 2
make[1]: se sale del directorio `/usr/src/linux-headers-2.6.31-17-generic'
make: *** [vmmon.ko] Error 2
make: se sale del directorio `/tmp/vmware-config3/vmmon-only'
For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/go/unsup-linux-products" and
"http://www.vmware.com/go/unsup-linux-tools".

Execution aborted.

Unable to build the vmmon module.

To fix it we must download the ubuntugeek's patch for vmware-server 2.0.1 x64 modules. Yes, the patch for 64-bit fixes the 32-bit package:

root@blogger:/tmp# wget -O - http://www.ubuntugeek.com/images/vmware-server.2.0.1_x64-modules-2.6.30.4-fix.tgz | tar xvfz -

Once we have the patch file and the script that installs it we do:

root@blogger:/tmp# ./vmware-server.2.0.1_x64-modules-2.6.30.4-fix.sh
[...]
Replacing original file vmnet.tar with patched file
Replacing original file vsock.tar with patched file
Replacing original file vmmon.tar with patched file
Replacing original file vmci.tar with patched file
Done!

I have changed the files in here:
/usr/lib/vmware/modules/source

I have placed a backup of the original files in here:
/usr/lib/vmware/modules/source-backup

The original VMware modules directory is still in the way.
Please move this directory somewhere else, because it confuses VMware:
/usr/lib/vmware/modules/binary

This command should work now, to install the modules:
vmware-config.pl -d

Voila! re-run «vmware-config.pl -d» and enjoy that vmware finally works:

root@blogger:/tmp# vmware-config.pl -d
[...]
Starting VMware services:
   Virtual machine monitor                                             done
   Virtual machine communication interface                             done
   Virtual ethernet                                                    done
   Bridged networking on /dev/vmnet0                                   done
   Host-only networking on /dev/vmnet1 (background)                    done
   DHCP server on /dev/vmnet1                                          done
   Host-only networking on /dev/vmnet8 (background)                    done
   DHCP server on /dev/vmnet8                                          done
   NAT service on /dev/vmnet8                                          done
   VMware Server Authentication Daemon (background)                    done
   Shared Memory Available                                             done
Starting VMware management services:
   VMware Server Host Agent (background)                               done
   VMware Virtual Infrastructure Web Access
Starting VMware autostart virtual machines:
   Virtual machines                                                    done

The configuration of VMware Server 2.0.2 build-203138 for Linux for this
running kernel completed successfully.

vmware-server-2.0.2 en ubuntu karmic

english version - all spanish posts

Actualización: he redactado un post sobre la instalación de vmware-server 2.0.x en Ubuntu 10.04 Lucid Lynx

La instalación directa del targzip VMware-server-2.0.2-203138.i386.tar.gz en ubuntu 9.10 karmic acaba con un error al tratar de compilar el módulo vmmon:

[...]

None of the pre-built vmmon modules for VMware Server is suitable for your
running kernel.  Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.31-17-generic/build/include]

Extracting the sources of the vmmon module.

Building the vmmon module.

Using 2.6.x kernel build system.
make: se ingresa al directorio `/tmp/vmware-config3/vmmon-only'
make -C /lib/modules/2.6.31-17-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: se ingresa al directorio `/usr/src/linux-headers-2.6.31-17-generic'
  CC [M]  /tmp/vmware-config3/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config3/vmmon-only/linux/driver.c:31:
/tmp/vmware-config3/vmmon-only/./include/compat_wait.h:78: error: conflicting types for ‘poll_initwait’
include/linux/poll.h:70: note: previous declaration of ‘poll_initwait’ was here
In file included from /tmp/vmware-config3/vmmon-only/./include/vmware.h:38,
                 from /tmp/vmware-config3/vmmon-only/linux/driver.c:99:
/tmp/vmware-config3/vmmon-only/./include/vm_basic_types.h:108:7: warning: "__FreeBSD__" is not defined
In file included from /tmp/vmware-config3/vmmon-only/./include/vcpuset.h:103,
                 from /tmp/vmware-config3/vmmon-only/./include/modulecall.h:37,
                 from /tmp/vmware-config3/vmmon-only/./common/vmx86.h:33,
                 from /tmp/vmware-config3/vmmon-only/linux/driver.h:29,
                 from /tmp/vmware-config3/vmmon-only/linux/driver.c:101:
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:329:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:333:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:401:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:407:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:506:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:595:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:684:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:773:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:775:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:860:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:862:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:945:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:947:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:1028:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:1030:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:1223:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:1227:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:1536:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_atomic.h:1663:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config3/vmmon-only/./include/vm_basic_asm.h:46,
                 from /tmp/vmware-config3/vmmon-only/./include/rateconv.h:45,
                 from /tmp/vmware-config3/vmmon-only/./include/modulecall.h:40,
                 from /tmp/vmware-config3/vmmon-only/./common/vmx86.h:33,
                 from /tmp/vmware-config3/vmmon-only/linux/driver.h:29,
                 from /tmp/vmware-config3/vmmon-only/linux/driver.c:101:
/tmp/vmware-config3/vmmon-only/./include/vm_basic_asm_x86.h:62:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_basic_asm_x86.h:177:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_basic_asm_x86.h:346:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_basic_asm_x86.h:453:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config3/vmmon-only/./include/vm_asm.h:43,
                 from /tmp/vmware-config3/vmmon-only/linux/driver.c:103:
/tmp/vmware-config3/vmmon-only/./include/vm_asm_x86.h:486:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_asm_x86.h:779:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_asm_x86.h:820:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config3/vmmon-only/./include/vm_asm_x86.h:922:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config3/vmmon-only/linux/driver.c:119:
/tmp/vmware-config3/vmmon-only/./common/hostif.h:53:7: warning: "WINNT_DDK" is not defined
/tmp/vmware-config3/vmmon-only/linux/driver.c: In function ‘LinuxDriverSyncCallOnEachCPU’:
/tmp/vmware-config3/vmmon-only/linux/driver.c:1423: error: too many arguments to function ‘smp_call_function’
/tmp/vmware-config3/vmmon-only/linux/driver.c: In function ‘LinuxDriver_Ioctl’:
/tmp/vmware-config3/vmmon-only/linux/driver.c:1987: error: ‘struct task_struct’ has no member named ‘euid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1987: error: ‘struct task_struct’ has no member named ‘uid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1988: error: ‘struct task_struct’ has no member named ‘fsuid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1988: error: ‘struct task_struct’ has no member named ‘uid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1989: error: ‘struct task_struct’ has no member named ‘egid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1989: error: ‘struct task_struct’ has no member named ‘gid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1990: error: ‘struct task_struct’ has no member named ‘fsgid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:1990: error: ‘struct task_struct’ has no member named ‘gid’
/tmp/vmware-config3/vmmon-only/linux/driver.c:2007: error: too many arguments to function ‘smp_call_function’
make[2]: *** [/tmp/vmware-config3/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config3/vmmon-only] Error 2
make[1]: se sale del directorio `/usr/src/linux-headers-2.6.31-17-generic'
make: *** [vmmon.ko] Error 2
make: se sale del directorio `/tmp/vmware-config3/vmmon-only'
For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/go/unsup-linux-products" and
"http://www.vmware.com/go/unsup-linux-tools".

Execution aborted.

Unable to build the vmmon module.

Para solucionarlo debemos descargar de ubuntugeek el parche para los módulos de vmware-server 2.0.1 x64. Si; el parche para los módulos de 64bits

root@blogger:/tmp# wget -O - http://www.ubuntugeek.com/images/vmware-server.2.0.1_x64-modules-2.6.30.4-fix.tgz | tar xvfz -

Una vez ya tenemos el fichero patch y el script que lo instala ejecutamos:

root@blogger:/tmp# ./vmware-server.2.0.1_x64-modules-2.6.30.4-fix.sh
[...]
Replacing original file vmnet.tar with patched file
Replacing original file vsock.tar with patched file
Replacing original file vmmon.tar with patched file
Replacing original file vmci.tar with patched file
Done!

I have changed the files in here:
/usr/lib/vmware/modules/source

I have placed a backup of the original files in here:
/usr/lib/vmware/modules/source-backup

The original VMware modules directory is still in the way.
Please move this directory somewhere else, because it confuses VMware:
/usr/lib/vmware/modules/binary

This command should work now, to install the modules:
vmware-config.pl -d

Voila! volvemos a ejecutar vmware-config.pl -d y comprobamos que por fín funciona vmware:

root@blogger:/tmp# vmware-config.pl -d
[...]
Starting VMware services:
   Virtual machine monitor                                             done
   Virtual machine communication interface                             done
   Virtual ethernet                                                    done
   Bridged networking on /dev/vmnet0                                   done
   Host-only networking on /dev/vmnet1 (background)                    done
   DHCP server on /dev/vmnet1                                          done
   Host-only networking on /dev/vmnet8 (background)                    done
   DHCP server on /dev/vmnet8                                          done
   NAT service on /dev/vmnet8                                          done
   VMware Server Authentication Daemon (background)                    done
   Shared Memory Available                                             done
Starting VMware management services:
   VMware Server Host Agent (background)                               done
   VMware Virtual Infrastructure Web Access
Starting VMware autostart virtual machines:
   Virtual machines                                                    done

The configuration of VMware Server 2.0.2 build-203138 for Linux for this
running kernel completed successfully.