Class: Vagrant::Driver::VirtualBox_4_0

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

Instance Method Summary collapse

Instance Method Details

#read_mac_addressesObject



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/vagrant-windows/monkey_patches/driver.rb', line 39

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