Skip to content

Commit 4225b8b

Browse files
authored
Merge pull request #505 from mpdude/fix-504
Map the `share` option to the `prl_fsd --share` flag
2 parents ea1cdef + 97c83bc commit 4225b8b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

lib/vagrant-parallels/guest_cap/linux/mount_parallels_shared_folder.rb

+15-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,23 @@ def self.mount_parallels_shared_folder(machine, name, guestpath, options)
3838

3939
# prl_fsd does not support the _netdev option, so we need to remove it from the mount options
4040
# for supported mount_options check prl_fsd --help in guest machine after installing Parallels Tools
41-
prl_fsd_mount_options = mount_options.split(',').reject { |opt| opt == '_netdev' }.join(',')
41+
42+
# the `share` option needs to be passed as an extra `--share` argument
43+
44+
prl_fsd_mount_options = mount_options.split(',').reject { |opt| opt == '_netdev' }
45+
46+
if mount_options.include?('share')
47+
share_flag = '--share'
48+
prl_fsd_mount_options.reject! { |opt| opt == 'share' || opt.start_with?('uid=', 'gid=') }
49+
else
50+
share_flag = ''
51+
end
52+
53+
o_options = prl_fsd_mount_options.join(',')
54+
4255
mount_command = <<-CMD
4356
if [ -f /usr/bin/prl_fsd ]; then
44-
prl_fsd #{guest_path} -o big_writes,#{prl_fsd_mount_options},fsname=#{name},subtype=prl_fsd --sf=#{name}
57+
prl_fsd #{guest_path} -o big_writes,#{o_options},fsname=#{name},subtype=prl_fsd #{share_flag} --sf=#{name}
4558
else
4659
mount -t #{mount_type} -o #{mount_options} #{name} #{guest_path}
4760
fi

0 commit comments

Comments
 (0)