Class: Vagrant::Driver::VirtualBox_4_2

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

Instance Method Summary collapse

Instance Method Details

#read_mac_addressesObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/vagrant-windows/monkey_patches/driver.rb', line 9

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