c4se記:さっちゃんですよ☆

.。oO(さっちゃんですよヾ(〃l _ l)ノ゙☆)

.。oO(此のblogは、主に音樂考察Programming に分類されますよ。ヾ(〃l _ l)ノ゙♬♪♡)

音樂は SoundCloud に公開中です。

考察は現在は主に Scrapbox で公表中です。

Programming は GitHub で開發中です。

Ubuntu 13.04上でVMWare Toolsのshared foldersが有効に成らない場合

追記20130923
正直な所、若し未だ此のVMWareのbugが修正されてゐないとしたら、open-vm-toolsを使って解決する方が筋が好いかもしれない。当記事の下部を参照。
但し此のbug、Vagrant使ってて当たった事無いんだよな。今はVagrant使ってるので、此れには困って無いのだけれど。

Windows8 VMWare上のUbuntuを13.04に上げてから、共有directoryが使えなくなった。VMWare-Toolsのinstallでerrorが出る。どうもUbuntu丈でなく、Fedora上でも同じerrorが出ている様だから、おそらくLinux karnelのupdateに着いて行けていないVMWare Tools側のbugである。然しWMWare Toolsのupdateを待っている暇も無い。
餘り気持ちの好い方法ではないが、解決する。
VMWare Toolsのinstall法は問題なくわかるものとする。C言語も局所的には速やかに読み下せるものとする。

現象

何時もの様にsudo ./vmware-install.plをしても、以下のerrorが出て、共有directoryが有効に成らない。

The VMware Host-Guest Filesystem allows for shared folders between the host OS 
and the guest OS in a Fusion or Workstation virtual environment.  Do you wish 
to enable this feature? [yes] 

Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-dCmJbV/vmci-only'
/usr/bin/make -C /lib/modules/3.8.0-19-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
	  MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.8.0-19-generic'
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/linux/driver.o
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/linux/vmciKernelIf.o
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/common/vmciContext.o
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/common/vmciDatagram.o
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/common/vmciDoorbell.o
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/common/vmciDriver.o
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/common/vmciEvent.o
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/common/vmciHashtable.o
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/common/vmciQPair.o
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/common/vmciQueuePair.o
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/common/vmciResource.o
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/common/vmciRoute.o
  CC [M]  /tmp/modconfig-dCmJbV/vmci-only/driverLog.o
  LD [M]  /tmp/modconfig-dCmJbV/vmci-only/vmci.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/modconfig-dCmJbV/vmci-only/vmci.mod.o
  LD [M]  /tmp/modconfig-dCmJbV/vmci-only/vmci.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-19-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
	  MODULEBUILDDIR= postbuild
make[1]: Entering directory `/tmp/modconfig-dCmJbV/vmci-only'
make[1]: `postbuild' is up to date.
make[1]: Leaving directory `/tmp/modconfig-dCmJbV/vmci-only'
cp -f vmci.ko ./../vmci.o
make: Leaving directory `/tmp/modconfig-dCmJbV/vmci-only'
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-dCmJbV/vmhgfs-only'
/usr/bin/make -C /lib/modules/3.8.0-19-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
	  MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.8.0-19-generic'
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/backdoor.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/backdoorGcc32.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/cpName.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/bdhandler.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/cpNameLinux.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/cpNameLite.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/dentry.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/dir.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/file.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/filesystem.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/fsutil.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/hgfsBd.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/hgfsEscape.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/hgfsUtil.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/inode.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/link.o
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/message.o
/tmp/modconfig-dCmJbV/vmhgfs-only/inode.c: In function ‘HgfsTruncatePages’:
/tmp/modconfig-dCmJbV/vmhgfs-only/inode.c:888:4: error: implicit declaration of function ‘vmtruncate’ [-Werror=implicit-function-declaration]
  CC [M]  /tmp/modconfig-dCmJbV/vmhgfs-only/module.o
cc1: some warnings being treated as errors
make[2]: *** [/tmp/modconfig-dCmJbV/vmhgfs-only/inode.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [_module_/tmp/modconfig-dCmJbV/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-19-generic'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/modconfig-dCmJbV/vmhgfs-only'

The filesystem driver (vmhgfs module) is used only for the shared folder 
feature. The rest of the software provided by VMware Tools is designed to work 
independently of this feature.

If you wish to have the shared folders feature, you can install the driver by 
running vmware-config-tools.pl again after making sure that gcc, binutils, make
and the kernel sources for your running kernel are installed on your machine. 
These packages are available on your distribution's installation CD.
[ Press Enter key to continue ]

vmhgfs-only/inode.cの888行目がおかしいとな? 末広がりで好かった(〃l _ l) 666だったらとんでもない事に成る所だった(U〃l _ l)

解決

vmware-tools-distrib/lib/modules/source/vmhgfs.tarを解凍し、出てきたvmhgfs-only/inode.cの888行目を、以下の通り書き換える。

// result = compat_vmtruncate(inode, newSize);
result = 0;

元々此の行は、error checkの為に有る丈の様で、上記の如くerrorをthroughする事にしても、其れ程問題は無い様だ。多分然う云う事だ。
VMWare Toolsをinstallし直す。其の前にuninstallが必要だったかもしれない。

tar sf vmhgfs.tar vmhgfs-only/
sudo bin/vmware-uninstall-tools.pl
sudo ./vmware-install.pl

cdは適当に省略した。

cf.

以下を使った。
cf. Question #227866 : Questions : Ubuntu https://answers.launchpad.net/ubuntu/+question/227866
又、以下も見た。
cf. Shared Folders Error in 13.04 - VMware Tools 9.2.3 - vmhgfs problem http://ubuntuforums.org/showthread.php?t=2136277
cf. Development: Patching VMware Tools in Fedora 18 http://erikbryantology.blogspot.jp/2013/03/patching-vmware-tools-in-fedora-18.html
cf. FLAG-U: 【 Fedora18 on vmware 】 - vmware で共有フォルダが有効にならない時の対処 http://flag-u.surfchiba.com/2013/03/fedora18-on-vmware-vmware.html

補遺

関係ないが、Virtual Box上で共有directoryを設定する方法は、以下の通りだ。
VirtualBox上でDebian6.0.2.1-i386をインストール/セッティングした http://c4se.hatenablog.com/entry/20110929/1317252969


VMWare-Toolsの代替open source実装も有る。試していない。
Open Virtual Machine Tools http://open-vm-tools.sourceforge.net/

The Open Virtual Machine Tools (open-vm-tools) are the open source implementation of VMware Tools. They are a set of guest operating system virtualization components that enhance performance and user experience of virtual machines. As virtualization technology rapidly becomes mainstream, each virtualization solution provider implements their own set of tools and utilities to supplement the guest virtual machine. However, most of the implementations are proprietary and are tied to a specific virtualization platform.


With the Open Virtual Machine Tools project, we are hoping to solve this and other related problems. The tools are currently composed of kernel modules for Linux and user-space programs for all VMware supported Unix-like guest operating systems. They provide several useful functions like:

  • File transfer between a host and guest
  • Improved memory management and network performance under virtualization
  • General mechanisms and protocols for communication between host and guests and from guest to guest


cf. VMWare下のUbuntuとWindowsのファイル共有で/mnt/hgfsにフォルダが出ないときの対処法 « haya14busa http://haya14busa.com/solution-of-sharing-file-between-windows-and-ubuntu-under-vmware/ Open Virtual Machine Toolsで解決した例