vagrant-xhyve icon indicating copy to clipboard operation
vagrant-xhyve copied to clipboard

Figure out why sometimes vmnet refuse to create interface

Open sirn opened this issue 8 years ago • 0 comments

Vmnet notes:

  • vmnet will refuse to create interface for some UUIDs.
    • SecureRandom.uuid (UUIDv4) hit the above bug every ~~10~~ 20 UUIDs or so created.
    • XPC_TYPE_UUID actually conforms DCE 1.1 UUIDs (per uuid(3))
      • Maybe just call xpc_uuid_create and sidestep this incompatibility altogether.
  • vmnet limits single process to create only about 4-5 interfaces.
  • vmnet require codesign and com.apple.vm.networking entitlement (this is why sudo is required).
  • generating about 100+ vmnet interfaces will crash the host machine. (Don't)

Test with (sudo ruby -Ilib test.rb):

require 'securerandom'
require 'vagrant-xhyve/support/vmnet_mac'

uuid = SecureRandom.uuid
puts "#{uuid} - #{VagrantPlugins::Xhyve::Support::VmnetMac.from_uuid(uuid)}"

For example, e083cf15-cbfc-4f31-a92b-0de72c86e857 reliably fails on my local machine.

sirn avatar Apr 15 '16 02:04 sirn