Vagrant.configure("2") do |config|
  # Set welcome message
  # config.vm.post_up_message = "Welcome to Mac OS X Yosemite box. Issue tracker: https://github.com/AndrewDryga/vagrant-box-osx"

  # Synced folder are not supported under Mac OS X
  config.vm.box = "{{ machine_name }}"
  config.vm.box_url = 'file://{{ location }}'

  {% if sync_from_location %}
  config.vm.synced_folder "{{ sync_from_location }}", "{{ sync_to_location }}", type: "rsync"
  {% endif %}

  config.vm.provider "virtualbox" do |vb|
    # Fix "hfs mounted macintosh hd on device root_device" issue
    vb.customize ["modifyvm", :id, "--cpuidset", "1","000206a7","02100800","1fbae3bf","bfebfbff"]

    # Some more hacks for device recognition
    vb.customize ["setextradata", :id, "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct", "MacBookPro11,3"]
    vb.customize ["setextradata", :id, "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion", "1.0"]
    vb.customize ["setextradata", :id, "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct", "Iloveapple"]
    vb.customize ["setextradata", :id, "VBoxInternal/Devices/smc/0/Config/DeviceKey", "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"]
    #vb.customize ["setextradata", :id, "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC", "1"]
    
    vb.customize ["modifyvm", :id, "--usb", "off"]
    vb.customize ["modifyvm", :id, "--usbehci", "off"]
  end
end
