mardi, mai 21, 2013

dossiers partagés VMWare: host et guest sous Ubuntu 13.04 via WMWare Workstation 9.0

Chez Eranea, pour nos projets de transcodage et de migration d'applications, nous utilisons beaucoup VMWare Workstation pour tester simplement et efficacement des configurations-cibles nouvelles (système isolé, ensemble de machines interconnectées, etc.). C'est extrêmement efficace au sein de l'équipe: l'un prépare les machines virtuelles puis les passent aux autres membres de l'équipe par simple copie de fichiers. Beaucoup de temps d'installations de base à répliquer économisés !

Dans cet objectif, je viens de passer pas mal de temps à faire fonctionner la fonction de dossiers partagés entre host et guest, tous 2 sur Ubuntu 13.04 avec VMWare Workstation 9.0.  Ce n'est pas encore opérationnel de base sûrement à cause de la nouveauté de Ubuntu 13.04 "Raring Ringtail" (i.e Le Bassaris): un incident est ouvert chez VMWare : https://answers.launchpad.net/ubuntu/+question/227866

Alors, voilà ci-dessous comment je m'en suis finalement sorti en attendant. Si cela peut faire gagner du temps à d'autres...

Par défaut, les VMWare Tools installés par WMWare WS9 ne permettent pas l'accès aux dossiers partagés : le module kernel nommé vmhgfs qu'ils devraient intégrer au noyau lors de leur installation ne l'est finalement pas : un simple lsmod | grep vmhgfs le prouve.

Une réinstallation des outils via l'onglet VM > Reinstall VmWare Tools ne donne rien même après reconstruction du noyau Linux.

Voici donc le bon chemin:  (en tout cas pour moi...)
  • sudo apt-get install open-vm-tools
  • sudo mkdir /mnt/hgfs
  • sudo mount -t vmhgfs .host:/ /mnt/hgfs
Ci-après se trouve le journal de mes réponses aux questions posées lors de l'installation de open-vm-tools pour que vous puissiez comparer.

Après l'installation de open-vm-tools, lsmod | grep vmhgfs confirme la présence de vmhgfs et donc le mount va au out et les dossiers partagés apparaissent.

Good luck !

===================== Log de  sudo apt-get install open-vm-tools


 sudo apt-get install open-vm-tools
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  dkms ethtool fakeroot libdumbnet1 open-vm-dkms zerofree
Suggested packages:
  dpkg-dev debhelper open-vm-toolbox
The following NEW packages will be installed:
  dkms ethtool fakeroot libdumbnet1 open-vm-dkms open-vm-tools zerofree
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,136 kB of archives.
After this operation, 9,972 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ raring/main dkms all 2.2.0.3-1.1ubuntu2 [72.8 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ raring/main ethtool amd64 1:3.4.2-1 [101 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ raring/main fakeroot amd64 1.18.4-2ubuntu1 [89.1 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ raring/universe libdumbnet1 amd64 1.12-3.1 [31.3 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ raring/multiverse open-vm-dkms all 2012.12.26-958366-0ubuntu3 [394 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ raring/multiverse open-vm-tools amd64 2012.12.26-958366-0ubuntu3 [440 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu/ raring/universe zerofree amd64 1.0.2-1ubuntu1 [8,654 B]
Fetched 1,136 kB in 3s (356 kB/s)
Selecting previously unselected package dkms.
(Reading database ... 183590 files and directories currently installed.)
Unpacking dkms (from .../dkms_2.2.0.3-1.1ubuntu2_all.deb) ...
Selecting previously unselected package ethtool.
Unpacking ethtool (from .../ethtool_1%3a3.4.2-1_amd64.deb) ...
Selecting previously unselected package fakeroot.
Unpacking fakeroot (from .../fakeroot_1.18.4-2ubuntu1_amd64.deb) ...
Selecting previously unselected package libdumbnet1.
Unpacking libdumbnet1 (from .../libdumbnet1_1.12-3.1_amd64.deb) ...
Selecting previously unselected package open-vm-dkms.
Unpacking open-vm-dkms (from .../open-vm-dkms_2012.12.26-958366-0ubuntu3_all.deb) ...
Selecting previously unselected package open-vm-tools.
Unpacking open-vm-tools (from .../open-vm-tools_2012.12.26-958366-0ubuntu3_amd64.deb) ...
Selecting previously unselected package zerofree.
Unpacking zerofree (from .../zerofree_1.0.2-1ubuntu1_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Setting up dkms (2.2.0.3-1.1ubuntu2) ...
Setting up ethtool (1:3.4.2-1) ...
Setting up fakeroot (1.18.4-2ubuntu1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up libdumbnet1 (1.12-3.1) ...
Setting up open-vm-dkms (2012.12.26-958366-0ubuntu3) ...
Loading new open-vm-tools-2012.12.26 DKMS files...
First Installation: checking all kernels...
Building only for 3.8.0-21-generic
Building for architecture x86_64
Building initial module for 3.8.0-21-generic
Done.

vmblock:
Running module version sanity check.

Good news! Module version 1.1.2.0 for vmblock.ko
exactly matches what is already found in kernel 3.8.0-21-generic.
DKMS will not replace this module.
You may override by specifying --force.

vmci.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/3.8.0-21-generic/updates/dkms/

vmhgfs.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/3.8.0-21-generic/updates/dkms/

vmxnet.ko:
Running module version sanity check.
Error! Module version 2.0.15.0 for vmxnet.ko
is not newer than what is already found in kernel 3.8.0-21-generic (2.0.15.0).
You may override by specifying --force.

vsock.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/3.8.0-21-generic/updates/dkms/

depmod....

DKMS: install completed.
Setting up open-vm-tools (2012.12.26-958366-0ubuntu3) ...

Configuration file `/etc/vmware-tools/scripts/vmware/network'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** network (Y/I/N/O/D/Z) [default=N] ?

Configuration file `/etc/vmware-tools/suspend-vm-default'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** suspend-vm-default (Y/I/N/O/D/Z) [default=N] ?

Configuration file `/etc/vmware-tools/statechange.subr'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** statechange.subr (Y/I/N/O/D/Z) [default=N] ?

Configuration file `/etc/vmware-tools/poweroff-vm-default'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** poweroff-vm-default (Y/I/N/O/D/Z) [default=N] ?

Configuration file `/etc/vmware-tools/resume-vm-default'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** resume-vm-default (Y/I/N/O/D/Z) [default=N] ?

Configuration file `/etc/vmware-tools/poweron-vm-default'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** poweron-vm-default (Y/I/N/O/D/Z) [default=N] ?
update-initramfs: deferring update (trigger activated)
 * Loading open-vm-tools modules                                         [ OK ]
 * Remove pcnet32 module, if vmxnet is loaded                            [ OK ]
 * Starting open-vm daemon vmtoolsd                                      [ OK ]
Setting up zerofree (1.0.2-1ubuntu1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for ureadahead ...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.8.0-21-generic

Source: blog Media and Tech (par didier durand)

2 commentaires:

Azddin LAKEHICH a dit…

Merci infiniment pour ce tuto qui m'a beaucoup aidé.

Anonyme a dit…

Merci,
le problème persiste. Je l'ai corrigé grâce à cet article.
Merci
Env: VMWare Fusion (Os X) et VM Ubuntu 13.10 64bits.