 L'utilisation des VMware Tools permet d'améliorer significativement les performances des machines virtuelles fonctionnant sous ESX en fournissant au système d'exploitation invité des drivers optimisés. Si sur de nombreux systèmes cette installation se fait très simplement, sur la dernière mouture Linux Debian 5.0 (Lenny), elle se révèle un peu plus complexe...
Prérequis Pour pouvoir installer correctement les VMware Tools, certains packages sont nécessaires (notamment les entêtes du noyau Linux et un compilateur C version 4.1). debian:~# apt-get update
debian:~# apt-get install autoconf automake binutils make psmisc
debian:~# apt-get install cpp gcc-4.1
debian:~# uname -r
2.6.26-2-686
debian:~# apt-get install linux-headers-2.6.26-2-686 Si vous aviez déjà un compilateur C d'installé, vérifiez que le gcc pointe bien sur la version 4.1. Dans le cas contraire, modifiez le lien ou utilisez la variable d'environnement CC en faisant un export CC=/usr/bin/gcc-4.1. Cette dernière méthode semble toutefois ne pas fonctionner à tout les coups... debian:~# cd /usr/bin/
debian:/usr/bin# ll gcc*
lrwxrwxrwx 1 root root 7 2009-06-04 15:01 gcc -> gcc-4.3
-rwxr-xr-x 1 root root 196996 2009-01-18 16:39 gcc-4.1
-rwxr-xr-x 1 root root 207648 2008-12-31 13:52 gcc-4.3
-rwxr-xr-x 1 root root 16288 2009-01-18 16:37 gccbug-4.1
debian:/usr/bin# rm gcc
debian:/usr/bin# ln -s gcc-4.1 gcc
debian:/usr/bin# ll gcc*
lrwxrwxrwx 1 root root 7 2009-06-04 15:04 gcc -> gcc-4.1
-rwxr-xr-x 1 root root 196996 2009-01-18 16:39 gcc-4.1
-rwxr-xr-x 1 root root 207648 2008-12-31 13:52 gcc-4.3
-rwxr-xr-x 1 root root 16288 2009-01-18 16:37 gccbug-4.1 Téléchargement des VMware Tools
| VMwareTools-3.5.0-143129-debian-lenny.iso Version modifiée pour Debian Lenny (fichier os.c modifié) Attention : Ce fichier est fournit gratuitement dans un esprit communautaire et aucune garantie de quelque sorte n'est accordée quant au bon fontionnement de celui-ci.
|  | VMwareTools-3.5.0-143129-debian-lenny.iso Version d'origine (nécessite les modifications du fichier os.c décrites en bas d'article)
| InstallationCommencez par monter le fichier ISO en tant que CD-ROM, soit à l'aide de la console VMware, soit en modifiant la configuration de votre VM depuis VMware Infrastructure Client. Suivez ensuite le déroulement ci-dessous : <a href="media/VMwareTools-3.5.0-143129.i386.iso">debian:~# cd /root</a>
debian:~# copy /cdrom/VMwareTools-3.5.0-143129-debian-lenny.tar.gz .
debian:~# tar xvfz VMwareTools-3.5.0-143129-debian-lenny.tar.gz
debian:~# cd vmware-tools-distrib/
debian:~/vmware-tools-distrib# ./vmware-install.pl
Creating a new installer database using the tar4 format.
Installing the content of the package. This may take from several
minutes to over an hour depending on the size of the package.
In which directory do you want to install the binary files?
[/usr/bin]
What is the directory that contains the init directories
(rc0.d/ to rc6.d/)?
[/etc]
What is the directory that contains the init scripts?
[/etc/init.d]
In which directory do you want to install the daemon files?
[/usr/sbin]
In which directory do you want to install the library files?
[/usr/lib/vmware-tools]
The path "/usr/lib/vmware-tools" does not exist currently. This
program is going to create it, including needed parent directories.
Is this what you want? [yes]
In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]
The path "/usr/share/doc/vmware-tools" does not exist currently.
This program is going to create it, including needed parent
directories. Is this what you want? [yes]
The installation of VMware Tools 3.5.0 build-143129 for Linux
completed successfully. You can decide to remove this software from
your system at any time by invoking the following command:
"/usr/bin/vmware-uninstall-tools.pl".
Before running VMware Tools for the first time, you need to configure
it by invoking the following command:
"/usr/bin/vmware-config-tools.pl".
Do you want this program to invoke the command for you now? [yes] no
Enjoy,
--the VMware team Attention, le reste de la procédure doit être effectué directement depuis la console système (pas de SSH car la configuration des VMware Tools réinitialise les interfaces réseau).
debian:~/vmware-tools-distrib# vmware-config-tools.pl Le script de configuration doit démarrer et vous prévenir qu'il ne trouve pas de module vmmemctl approprié pour votre système. Acceptez alors la compilation du module depuis les sources. None of the pre-built vmmemctl modules for VMware Tools is suitable
for your running kernel. Do you want this program to try to build
the vmmemctl module for your system (you need to have a C compiler
insatlled on your system) ? Le script doit alors compiler et installer les différents drivers pour votre système. Après installation vous devez avoir deux nouveaux process d'actifs : root 6980 2 0 12:03 ? 00:00:00 [vmmemctl]
root 7023 1 0 12:03 ? 00:00:00 /usr/sbin/vmware-guestd Il est possible qu'un troisième processus [vmhgfs] soit également actif en fonction de la configuration de votre ESX (utilisé dans le cas de partage d'espace disque entre vos machines virtuelles et le serveur ESX).
L'installation est terminée. N'oubliez pas de remonter les interfaces réseaux ou mieux de faire un reboot pour vérification du bon démarrage de votre VM.
Modifications effectuées sur le package d'origine Seul le fichier os.c contenu dans l'archive /lib/modules/source/vmmemctl.tar a fait l'objet de modifications qui sont décrites ci-dessous. Aucune autre modification n'a été apportée au package d'origine (VMwareTools-3.5.0-143129.tar.gz). Ligne 203, remplacement de : #ifdef CONFIG_PROC_FS
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
static int os_proc_read(char *, char **, off_t, int);
static struct proc_dir_entry *global_proc_entry;
#else
static int os_proc_read(char *, char **, off_t, int, int);
static struct proc_dir_entry global_proc_entry = {
0, 8, "vmmemctl", S_IFREG | S_IRUGO, 1, 0, 0, 0, NULL, os_proc_read,
};
#endif
#endif /* CONFIG_PROC_FS */ par #ifdef CONFIG_PROC_FS
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
static int os_proc_read(char *, char **, off_t, int, int *, void *);
static struct proc_dir_entry *global_proc_entry;
#else
static int os_proc_read(char *, char **, off_t, int, int);
static struct proc_dir_entry global_proc_entry = {
0, 8, "vmmemctl", S_IFREG | S_IRUGO, 1, 0, 0, 0, NULL, os_proc_read,
};
#endif
#endif /* CONFIG_PROC_FS */ Ligne 519, remplacement de : #ifdef CONFIG_PROC_FS
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
static int os_proc_read(char *buf,
char **start,
off_t offset,
int length)
#else
static int os_proc_read(char *buf,
char **start,
off_t offset,
int length,
int unused)
#endif par #ifdef CONFIG_PROC_FS
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
static int os_proc_read(char *buf,
char **start,
off_t offset,
int length,
int *eof,
void *data)
#else
static int os_proc_read(char *buf,
char **start,
off_t offset,
int length,
int unused)
#endif et enfin, ligne 582, remplacement de : global_proc_entry->get_info = os_proc_read; par global_proc_entry->read_proc = os_proc_read; Contact
N'hésitez pas à faire vos retours sur cet article à l'adresse : . Merci à Alain pour sa contribution à l'amélioration de cet article ! ;o)
|