Closed rrva closed 9 years ago
What version of Linux? How are you installing the linux-4.0rc6 kernel? If you can provide the commands you used, I can try to duplicate the issue. Thanks
Try the following
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "dreamscapes/archlinux"
config.vm.box_check_update = false
config.vm.define :docker do |t|
end
config.ssh.forward_agent = true
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provision :shell, :inline => <<-HEREDOC
localectl set-locale LANG=en_US.UTF-8
pacman -Syuu --noconfirm
pacman -S --noconfirm linux linux-headers git net-tools wget unzip
HEREDOC
config.vm.provision :reload
config.vm.provision :shell, :inline => <<-HEREDOC
git clone https://github.com/rasa/vmware-tools-patches.git
cd vmware-tools-patches
wget -q https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/7.1.1/2498930/packages/com.vmware.fusion.tools.linux.zip.tar
tar xf com.vmware.fusion.tools.linux.zip.tar
mkdir tmp
cd tmp
unzip ../com.vmware.fusion.tools.linux.zip
mkdir iso
mount -o loop payload/linux.iso iso
cp iso/VMwareTools* ..
cd ..
for x in {0..6}; do mkdir -p /etc/init.d/rc$x.d; done
./untar-and-patch-and-compile.sh
vmware-config-tools.pl -d
echo vmhgfs > /etc/modules-load.d/vmhgfs.conf
HEREDOC
config.vm.provision :shell, :inline => <<-HEREDOC
cat <<EOF > /etc/systemd/system/Users.mount
[Unit]
Description = Users vmhgfs
After = mnt-hgfs.mount
[Mount]
What=/mnt/hgfs/Users
Where=/Users
Type=none
Options=bind
[Install]
WantedBy = multi-user.target
EOF
systemctl enable Users.mount
HEREDOC
config.vm.provision :shell, :inline => <<-HEREDOC
cat <<EOF > /etc/systemd/system/work.mount
[Unit]
Description = work vmhgfs
After = mnt-hgfs.mount
[Mount]
What=/mnt/hgfs/work
Where=/work
Type=none
Options=bind
[Install]
WantedBy = multi-user.target
EOF
systemctl enable work.mount
HEREDOC
config.vm.provision :shell, :inline => <<-HEREDOC
cat <<EOF > /etc/systemd/system/mnt-hgfs.mount
[Unit]
Description=Load VMware shared folders
ConditionPathExists=.host:/
ConditionVirtualization=vmware
[Mount]
What=.host:/
Where=/mnt/hgfs
Type=vmhgfs
Options=defaults,noatime
[Install]
WantedBy=multi-user.target
EOF
systemctl enable mnt-hgfs.mount
HEREDOC
config.vm.provision :shell, :inline => <<-HEREDOC
echo "GRUB_HIDDEN_TIMEOUT=0" >> /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg
HEREDOC
end
After this has installed:
Edit /etc/pacman.conf and remove the commented-out testing repo:
[testing] Include = /etc/pacman.d/mirrorlist
Install linux kernel with (at time of writing this is 4.0 in testing repo)
sudo pacman -Syu --noconfirm testing/linux testing/linux-headers
Rerun vmhgfs compilation
sudo vmware-config-tools.pl (answered default to all)
ls -l
Expected: file copied Actual: 0 byte file
Don't forget to use vagrant up --provider=vmware_fusion
This due to removing mapping->backing_dev_info, we should create a bdi manually
--- vmhgfs-only/filesystem.c.orig
+++ vmhgfs-only/filesystem.c
@@ -386,8 +386,12 @@ HgfsReadSuper(struct super_block *sb, // OUT: Superblock object
return PTR_ERR(si);
}
HGFS_SET_SB_TO_COMMON(sb, si);
+ result = bdi_setup_and_register(&si->bdi, "vmhgfs");
+ if (result)
+ goto exit1;
sb->s_magic = HGFS_SUPER_MAGIC;
sb->s_op = &HgfsSuperOperations;
+ sb->s_bdi = &si->bdi;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
sb->s_d_op = &HgfsDentryOperations;
@@ -427,6 +431,8 @@ HgfsReadSuper(struct super_block *sb, // OUT: Superblock object
exit:
if (result) {
dput(rootDentry);
+ bdi_destroy(&si->bdi);
+exit1:
kfree(si->shareName);
kfree(si);
}
--- vmhgfs-only/module.h.orig
+++ vmhgfs-only/module.h
@@ -29,6 +29,7 @@
#include "driver-config.h"
#include <asm/atomic.h>
+#include <linux/backing-dev.h>
#include "compat_fs.h"
#include "compat_semaphore.h"
#include "compat_slab.h"
@@ -130,6 +131,7 @@ typedef struct HgfsSuperInfo {
uint32 ttl; /* Maximum dentry age (in ticks). */
char *shareName; /* Mounted share name. */
size_t shareNameLen; /* To avoid repeated strlen() calls. */
+ struct backing_dev_info bdi;
} HgfsSuperInfo;
/*
--- vmhgfs-only/super.c.orig
+++ vmhgfs-only/super.c
@@ -152,6 +152,7 @@ HgfsPutSuper(struct super_block *sb) // IN: The superblock
si = HGFS_SB_TO_COMMON(sb);
+ bdi_destroy(&si->bdi);
kfree(si->shareName);
kfree(si);
}
Can you submit that as a PR?
I don't know how to upload a attachment on github. Here is the patch file.
On Fri, Apr 17, 2015 at 12:26 AM, Ross Smith II notifications@github.com wrote:
Can you submit that as a PR?
— Reply to this email directly or view it on GitHub https://github.com/rasa/vmware-tools-patches/issues/38#issuecomment-93777638 .
Use the fork button, upper right corner.
git clone [fork url] add file to patches/vmhgfs (prepend digit to indicate apply order)
add some #if LINUX_VERSION_CODE if needed so it compiles on linux < 4.0
git commit, git push and then go to your fork in github, and there is a create pull request button
@sl4ever: excellent work. Thanks! Closed by #39.
With vmhgfs and linux-4.0rc6 and the patches in this repo, copying a file guest->host gives 0 byte files on host, but shown as >0 byte files when listing them from the guest. Creating files on host are properly recognized on the guest. echo 3 > /proc/sys/vm/drop_caches in the guest or calling sync did not help.
Host is vmware fusion / osx