Class: Vagrant::Systems::Solaris

Inherits:
Base
  • Object
show all
Defined in:
lib/vagrant/systems/solaris.rb

Overview

A general Vagrant system implementation for "solaris".

Contributed by Blake Irvin [email protected]

Defined Under Namespace

Classes: SolarisConfig, SolarisError

Instance Attribute Summary

Attributes inherited from Base

#vm

Instance Method Summary collapse

Methods inherited from Base

#change_host_name, #distro_dispatch, #enable_host_only_network, #initialize, #mount_nfs, #prepare_host_only_network

Constructor Details

This class inherits a constructor from Vagrant::Systems::Base

Instance Method Details

#haltObject

There should be an exception raised if the line

vagrant::::profiles=Primary Administrator

does not exist in /etc/user_attr. TODO



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/vagrant/systems/solaris.rb', line 36

def halt
  vm.env.ui.info I18n.t("vagrant.systems.solaris.attempting_halt")
  vm.ssh.execute do |ssh|
    ssh.exec!("#{vm.env.config.solaris.suexec_cmd} /usr/sbin/poweroff")
  end

  # Wait until the VM's state is actually powered off. If this doesn't
  # occur within a reasonable amount of time (15 seconds by default),
  # then simply return and allow Vagrant to kill the machine.
  count = 0
  while vm.vm.state != :powered_off
    count += 1

    return if count >= vm.env.config.solaris.halt_timeout
    sleep vm.env.config.solaris.halt_check_interval
  end
end

#mount_shared_folder(ssh, name, guestpath) ⇒ Object



54
55
56
57
58
59
# File 'lib/vagrant/systems/solaris.rb', line 54

def mount_shared_folder(ssh, name, guestpath)
  ssh.exec!("#{vm.env.config.solaris.suexec_cmd} mkdir -p #{guestpath}")
  # Using a custom mount method here; could use improvement.
  ssh.exec!("#{vm.env.config.solaris.suexec_cmd} /sbin/mount -F vboxfs #{name} #{guestpath}")
  ssh.exec!("#{vm.env.config.solaris.suexec_cmd} chown #{vm.env.config.ssh.username} #{guestpath}")
end