Class: Veewee::Provider::Virtualbox::Box

Inherits:
Core::Box show all
Includes:
BoxCommand
Defined in:
lib/veewee/provider/virtualbox/box.rb

Constant Summary

Constants included from BoxCommand

Veewee::Provider::Virtualbox::BoxCommand::UNSYNCED_VERSIONS

Instance Attribute Summary

Attributes inherited from Core::Box

#definition, #env, #name, #provider

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BoxCommand

#add_floppy_controller, #add_ide_controller, #add_sata_controller, #add_shared_folder, #add_ssh_nat_mapping, #add_winrm_nat_mapping, #attach_disk_common, #attach_disk_ide, #attach_disk_sata, #attach_floppy, #attach_guest_additions, #attach_isofile, #attach_serial_console, #build, #build_info, #console_type, #create, #create_disk, #create_vm, #delete_forwarding, #destroy, #download_vbox_guest_additions_iso, #exists?, #export_vagrant, #forwarding, #get_mac_address, #get_vbox_home, #halt, #host_ip_as_seen_by_guest, #ip_address, #natinterface, #poweroff, #running?, #screenshot, #send_keycode, #send_virtualbox_sequence, #sleep_guess, #ssh, #ssh_options, #suppress_messages, #transfer_buildinfo, #up, #validate_vagrant, #vbox_os_type_id, #vbox_version, #vboxga_version, #winrm, #winrm_options

Methods inherited from Core::Box

#gem_available?, #reload, #set_definition, #ui

Methods included from Core::BoxCommand

#check_output_run, #check_output_sudorun, #checks_linux, #checks_windows, #copy_to_box, #create_floppy, #create_wget_vbs_command, #escape_and_echo, #exec, #halt, #issh, #poweroff, #run_hook, #scp, #send_vnc_keycode, #ssh, #ssh_command_string, #string_to_vnccode, #sudo, #validate_tags, #vnc_type, #wget_vbs, #wget_vbs_file, #wincp, #winrm, #winrm_command_string

Methods included from Core::Helper::Iso

#download_iso, #download_progress, #hashsum, #no_proxy?, #verify_iso, #verify_sum

Methods included from Core::Helper::Comm

#comm_execute, #comm_method, #comm_transfer_file, #when_comm_login_works

Methods included from Core::Helper::Ssh

#build_ssh_options, #ssh_connection, #ssh_execute, #ssh_key_to_a, #ssh_options, #ssh_transfer_file, #tcp_test_ssh, #when_ssh_login_works

Methods included from Core::Helper::Shell

#shell_exec

Methods included from Core::Helper::Web

#allow_for_http_request, #wait_for_http_request

Methods included from Core::Helper::Tcp

#execute_when_tcp_available, #get_local_ip, #guess_free_port, #guess_free_ssh_port, #host_ip_as_seen_by_guest, #is_tcp_port_open?

Constructor Details

#initialize(name, env) ⇒ Box


33
34
35
36
# File 'lib/veewee/provider/virtualbox/box.rb', line 33

def initialize(name, env)
  @vboxcmd = self.class.determine_vboxcmd
  super(name, env)
end

Class Method Details

.default_vboxcmdObject


53
54
55
# File 'lib/veewee/provider/virtualbox/box.rb', line 53

def self.default_vboxcmd
  'VBoxManage'
end

.determine_vboxcmdObject


57
58
59
# File 'lib/veewee/provider/virtualbox/box.rb', line 57

def self.determine_vboxcmd
  @command ||= windows_vboxcmd || default_vboxcmd
end

.windows_vboxcmdObject


38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/veewee/provider/virtualbox/box.rb', line 38

def self.windows_vboxcmd
  # based on Vagrant/plugins/providers/virtualbox/driver/base.rb
  if OS.windows?
    if ENV.key?('VBOX_INSTALL_PATH') ||
       ENV.key?('VBOX_MSI_INSTALL_PATH')
      path = ENV['VBOX_INSTALL_PATH'] || ENV['VBOX_MSI_INSTALL_PATH']
      path.split(File::PATH_SEPARATOR).each do |single|
        vboxmanage = File.join(single, 'VBoxManage.exe')
        return "\"#{vboxmanage}\"" if File.file?(vboxmanage)
      end
    end
  end
  nil
end