mirror / vmware

1 stars 0 forks source link

vmware-tools #7

Open john-peterson opened 11 years ago

john-peterson commented 11 years ago

hlist_for_each_entry build fix

Patch

https://github.com/john-peterson/vmware-tools/tree/13,10

Problem

Since https://github.com/torvalds/linux/commit/b67bfe0d42cac56c512dd5da4b1b347a23f4b70a the VMwareTools-9.2.3-1031360.tar.gz vmhgfs build return

make: Entering directory `/tmp/modconfig-tvY62k/vmhgfs-only'

/tmp/modconfig-tvY62k/vmhgfs-only/inode.c:1821:66: error: expected ‘;’ before ‘{’ token
       hlist_for_each_entry(dentry, p, &inode->i_dentry, d_alias) {
                                                                  ^

in

cat /etc/issue
Ubuntu Saucy Salamander (development branch) \n \l
uname -r
3.9.0-4-generic

Solution

Removing the position variable

The command to download this patch in addition to the commands at http://ubuntuforums.org/showthread.php?t=2136277&p=12629477#post12629477 is

wget https://raw.github.com/john-peterson/vmware-tools/13,10/vmware9.hlist.patch
wget https://raw.github.com/john-peterson/vmware-tools/13,10/vmware_hgfs_fix.sh

open-vm-tools

An alternative solution is to use open-vm-tools (2013.04.16-1098359-0ubuntu1) that include a vmhgfs that's functional in 13,10, that has this identity

sudo apt-get install -y open-vm-tools

cat /lib/modules/`uname -r`/modules.dep|grep vmhgfs
updates/dkms/vmhgfs.ko: updates/dkms/vmci.ko

find /lib/modules/`uname -r`/updates/dkms -type f -name "*.ko" | sort | xargs crc32
3c2ca730        /lib/modules/3.9.0-4-generic/updates/dkms/vmci.ko
9df9ab61        /lib/modules/3.9.0-4-generic/updates/dkms/vmhgfs.ko
john-peterson commented 11 years ago

vmware-install doesn't build vmhgfs.ko

Problem

This doesn't build vmhgfs.ko and doesn't say why

sudo ./vmware-install.pl -d EULA_AGREED=yes

Solution

This build vmhgfs.ko

sudo ./vmware-install.pl -d --clobber-kernel-modules=vmci EULA_AGREED=yes

It's related to this message

The module vmci has already been installed on this system by another installer
or package and will not be modified by this installer.  Use the flag
--clobber-kernel-modules=vmci to override.

and this bin/vmware-config-tools.pl code

 # vmhgfs now depends on vmci.  Check to ensure it's configured.
 if (defined(db_get_answer_if_exists('VMCI_CONFED')) &&
     db_get_answer('VMCI_CONFED') ne 'yes') {

Unknown symbol vmci_datagram_destroy_handle

Problem

sudo modprobe vmhgfs
ERROR: could not insert 'vmhgfs': Invalid argument
dmesg | grep -i hgfs
[  300.204082] vmhgfs: disagrees about version of symbol vmci_datagram_destroy_handle
[  300.204087] vmhgfs: Unknown symbol vmci_datagram_destroy_handle (err -22)
[  300.204111] vmhgfs: disagrees about version of symbol vmci_datagram_send
[  300.204112] vmhgfs: Unknown symbol vmci_datagram_send (err -22)
[  300.204132] vmhgfs: disagrees about version of symbol vmci_datagram_create_handle
[  300.204133] vmhgfs: Unknown symbol vmci_datagram_create_handle (err -22)

Solution

Add vmci to vmhgfs dependencies

sudo depmod

because the problem is that vmci.ko isn't in its dependency list

modprobe -D vmhgfs
insmod /lib/modules/3.9.0-4-generic/misc/vmci.ko
insmod /lib/modules/3.9.0-4-generic/misc/vmhgfs.ko

Unknown symbol VMCIDatagram_Send

Problem

sudo modprobe vmhgfs
ERROR: could not insert 'vmhgfs': Unknown symbol in module, or unknown parameter (see dmesg)

dmesg | grep -i hgfs
[ 4103.120390] vmhgfs: Unknown symbol VMCIDatagram_Send (err 0)
[ 4103.120448] vmhgfs: Unknown symbol VMCIDatagram_DestroyHnd (err 0)
[ 4103.120453] vmhgfs: Unknown symbol VMCIDatagram_CreateHnd (err 0)

Solution

These are the equivalent (compared to the previous topic) VMCI export names for the tools distributed in linux.iso

john-peterson commented 11 years ago

Symlink

symlinks are now fixed in Fusion 6 coming out shortly

This will fix all Linux VMs

Does this patch enable symlink support for a Windows VMware Workstation NTFS shared folder mounted with Host/Guest File System in a Linux guest?

no, I have not been given the time to address Windows hosts and support symlinks there

Does this patch enable symlink support for a OS X VMware Fusion HFS+ shared folder mounted with Host/Guest File System in a Linux guest?

Yes

What's the file name of the first VMwareTools-9.?.?-?.tar.gz that contain this patch?

When is the patch committed to open-vm-tools?

Implementation

The purpose of this question is to obtain knowledge about the implementation so that it's clear what's required to support symlinks in a NTFS shared folder too

Describe the reason for not supporting symlinks in a NTFS shared folder when it's supported for a HFS+ shared folder

Is the HGFS symlink stored as a file (i.o.w. compatible with any shared folder file system) or a symlink in the HFS+ shared folder?

Is the symlink file identical to an existing symlink format described at Wikipedia?

Use

state your use case for symlink support in Windows VMware Workstation

Symlink support for a Linux guest in a Windows host is useful because

The message don't answer this question

Is the HGFS symlink stored as a file in the HFS+ shared folder?

I.o.w. does this Linux guest command

ln -s /home/user/folder /mnt/hgfs/shared/link

when the HFS+ shared folder is

path: /Users/user/shared
name: shared
mounted in the guest at: /mnt/hgfs/shared

create the file

 /Users/user/shared/link

with the content

/home/user/folder

The symlink is created on the host file system

So that kind of operation will fail as one of the constraints we have to place is that you cannot create links out of the share.

Is this true

I.o.w. this Linux guest command

ln -s /mnt/hgfs/shared/folder /mnt/hgfs/shared/link

when the HFS+ shared folder is

path: /Users/user/shared
name: shared
mounted in the guest at: /mnt/hgfs/shared

create the HFS+ symlink

 /Users/user/shared/link

that point to

 /Users/user/shared/folder

Creating a link that point to a folder outside the HFS+ shared folder return "Operation not supported"

f.e. this command in the Linux guest

ln -s /home/user/folder /mnt/hgfs/shared/link
ln: failed to create symbolic link ‘/mnt/hgfs/shared/link’: Operation not supported
john-peterson commented 10 years ago

Reference

The solution is described at https://communities.vmware.com/message/2288964

error: ‘struct dentry’ has no member named ‘d_count’

The command to solve the problem is

# mount cdrom
sudo mkdir -p /media/cdrom
sudo mount /dev/cdrom /media/cdrom

# unpack
rm -rf vmware-tools-distrib; tar -xvf /media/cdrom/VMwareTools-*.tar.gz && cd vmware-tools-distrib

# patch
cd ~/vmware-tools-distrib/lib/modules/source
if [[ ! -f vmhgfs.tar.orig ]]; then cp vmhgfs.tar vmhgfs.tar.orig; fi
rm -rf vmhgfs-only
tar xf vmhgfs.tar
cd vmhgfs-only
wget https://raw.github.com/rasa/vmware-tools-patches/master/patches/vmhgfs/vmhgfs-d_count-kernel-3.11-tools-9.6.0.patch
patch -p1 < vmhgfs-d_count-kernel-3.11-tools-9.6.0.patch
cd ..
tar cf vmhgfs.tar vmhgfs-only
rm -rf vmhgfs-only
cd ~/vmware-tools-distrib

# vmhgfs loaded status
lsmod | grep vm
vmhgfs                 53877  1