Sha256: 57eba173d5b7adfdcea08ffe0eceb3f80ee7c800c301ea40eb2ecba61d72f241

Contents?: true

Size: 1.21 KB

Versions: 6

Compression:

Stored size: 1.21 KB

Contents

require_relative '../../helper'

module VagrantWindows
  module Guest
    module Cap
      class MountSharedFolder
        
        def self.mount_virtualbox_shared_folder(machine, name, guestpath, options)
          mount_shared_folder(machine, name, guestpath, "\\\\vboxsrv\\")
        end
        
        def self.mount_vmware_shared_folder(machine, name, guestpath, options)
          mount_shared_folder(machine, name, guestpath, "\\\\vmware-host\\Shared Folders\\")
        end

        def self.mount_parallels_shared_folder(machine, name, guestpath, options)
          mount_shared_folder(machine, name, guestpath, "\\\\psf\\")
        end

        protected
        
        def self.mount_shared_folder(machine, name, guestpath, vm_provider_unc_base)
          share_name = VagrantWindows::Helper.win_friendly_share_id(name)
          options = {
            :mount_point => guestpath,
            :share_name => share_name,
            :vm_provider_unc_path => vm_provider_unc_base + share_name}
          mount_script = VagrantWindows.load_script_template("mount_volume.ps1", :options => options)
          machine.communicate.execute(mount_script, {:shell => :powershell})
        end
        
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-windows-1.7.0.pre.2 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.7.0.pre.1 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.6.0 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.6.0.pre.1 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.5.1 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.5.0 lib/vagrant-windows/guest/cap/mount_shared_folder.rb