Sha256: 3e01c3001f9f485fa14cf7d1a59e0dfe76b35739a5fc459e17a960915098ca9e

Contents?: true

Size: 1.58 KB

Versions: 26

Compression:

Stored size: 1.58 KB

Contents

# A general Vagrant system implementation for "solaris 11".
#
# Contributed by Jan Thomas Moldung <janth@moldung.no>

module VagrantPlugins
  module GuestSolaris11
    module Cap
      class MountVirtualBoxSharedFolder
        def self.mount_virtualbox_shared_folder(machine, name, guestpath, options)
          # These are just far easier to use than the full options syntax
          owner = options[:owner]
          group = options[:group]

          # Create the shared folder
          machine.communicate.execute("#{machine.config.solaris11.suexec_cmd} mkdir -p #{guestpath}")

          if owner.is_a? Integer
            mount_uid = owner
          else
            # We have to use this `id` command instead of `/usr/bin/id` since this
            # one accepts the "-u" and "-g" flags.
            mount_uid = "`/usr/xpg4/bin/id -u #{owner}`"
          end

          if group.is_a? Integer
            mount_gid = group
          else
            mount_gid = "`/usr/xpg4/bin/id -g #{group}`"
          end

          # Mount the folder with the proper owner/group
          mount_options = "-o uid=#{mount_uid},gid=#{mount_gid}"
          if options[:mount_options]
            mount_options += ",#{options[:mount_options].join(",")}"
          end

          machine.communicate.execute("#{machine.config.solaris11.suexec_cmd} /sbin/mount -F vboxfs #{mount_options} #{name} #{guestpath}")

          # chown the folder to the proper owner/group
          machine.communicate.execute("#{machine.config.solaris11.suexec_cmd} chown #{mount_uid}:#{mount_gid} #{guestpath}")
        end
      end
    end
  end
end

Version data entries

26 entries across 23 versions & 5 rubygems

Version Path
vagrant-aws-mkubenka-0.7.2.pre.22 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-f3fdbf414272/plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-aws-mkubenka-0.7.2.pre.16 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-1ee58c40e3f5/plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-unbundled-2.0.0.1 plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-unbundled-1.9.8.1 plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-unbundled-1.9.7.1 plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-unbundled-1.9.5.1 plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-unbundled-1.9.1.1 plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-unbundled-1.8.5.2 plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-unbundled-1.8.5.1 plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-unbundled-1.8.4.2 plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-unbundled-1.8.4.1 plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb
vagrant-unbundled-1.8.1.2 plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb