diff --git a/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb b/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb index 4f2a23d..d8ac068 100644 --- a/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb +++ b/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb @@ -22,7 +22,7 @@ def self.sshfs_forward_is_folder_mounted(machine, opts) # If the path doesn't exist at all in the machine then we # can safely say it is not mounted - exists = machine.communicate.test("test -e #{guest_path}") + exists = machine.communicate.test("test -e #{guest_path}", sudo: true) return false unless exists # find the absolute path so that we can properly check if it is mounted diff --git a/lib/vagrant-sshfs/cap/guest/linux/sshfs_get_absolute_path.rb b/lib/vagrant-sshfs/cap/guest/linux/sshfs_get_absolute_path.rb index 24ca144..085bc67 100644 --- a/lib/vagrant-sshfs/cap/guest/linux/sshfs_get_absolute_path.rb +++ b/lib/vagrant-sshfs/cap/guest/linux/sshfs_get_absolute_path.rb @@ -4,7 +4,7 @@ module Cap class SSHFSGetAbsolutePath def self.sshfs_get_absolute_path(machine, path) abs_path = "" - machine.communicate.execute("readlink -f #{path}") do |type, data| + machine.communicate.execute("readlink -f #{path}", sudo: true) do |type, data| if type == :stdout abs_path = data end