Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weaming/975508d7f45856e6ca81ef2f7c65623e to your computer and use it in GitHub Desktop.
Save weaming/975508d7f45856e6ca81ef2f7c65623e to your computer and use it in GitHub Desktop.
MacOS X El Capitan with Vagrant - MacOS X VM on Windows/Linux
mkdir osxvm
cd osxvm
vagrant init jhcook/osx-elcapitan-10.11
  • Edit Vagrantfile
Vagrant.configure("2") do |config|
    config.vm.box = "jhcook/osx-elcapitan-10.11"
    
    # Synced folder are not supported under Mac OS X
    config.vm.synced_folder ".", "/vagrant", :disabled => true

    # Temporary fix for annoying "Replace key" issue
    config.ssh.insert_key = false

    config.vm.provider "virtualbox" do |vb|
        vb.memory = "4096"
        #vb.customize ["modifyvm", :id, "--vram", "2048"]
        
        # 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"]
    end
end
  • Init
vagrant up
vagrant halt

Tested on Windows 7 - VirtualBox 5.0.20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment