Class: Vagrant::Driver::VirtualBox_4_1

Inherits:
VirtualBoxBase
  • Object
show all
Defined in:
lib/vagrant-windows/monkey_patches/driver.rb

Instance Method Summary collapse

Instance Method Details

#read_mac_addressesObject



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/vagrant-windows/monkey_patches/driver.rb', line 24

def read_mac_addresses
  macs = {}
  info = execute("showvminfo", @uuid, "--machinereadable", :retryable => true)
  info.split("\n").each do |line|
    if matcher = /^macaddress(\d+)="(.+?)"$/.match(line)
      adapter = matcher[1].to_i
      mac = matcher[2].to_s
      macs[adapter] = mac
    end
  end
  macs
end