Skip to content

Instantly share code, notes, and snippets.

@WayneBuckhanan
Last active July 13, 2019 15:55
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save WayneBuckhanan/15de1bb8b3fb3bd4f7af to your computer and use it in GitHub Desktop.
Save WayneBuckhanan/15de1bb8b3fb3bd4f7af to your computer and use it in GitHub Desktop.
OSX Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# https://github.com/AndrewDryga/vagrant-box-osx
config.vm.box = "osx-yosemite"
# Use NFS for the shared folder
config.vm.synced_folder ".", "/vagrant",
id: "core",
:nfs => true,
:mount_options => ['nolock,vers=3,udp,noatime,actimeo=1,resvport'],
:export_options => ['async,insecure,no_subtree_check,no_acl,no_root_squash']
# NFS needs host-only network
config.vm.network :private_network, ip: "10.0.0.100"
config.vm.box_check_update = false
config.ssh.forward_agent = true
config.ssh.insert_key = false
config.vm.provider "virtualbox" do |vb|
# Do/don't boot with headless mode
vb.gui = true
# Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "4096"]
### OSX guest specific settings
# vb.customize ["modifyvm", :id, "--cpuidset", "00000001","000206a7","02100800","1fbae3bf","bfebfbff"] # get OSX to boot past "hfs ..." message
vb.customize ["modifyvm", :id, "--cpuidset", "00000001","000306a9","00020800","80000201","178bfbff"] # boot past "Missing Bluetooth Controller Transport" error
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"]
# set resolution on OSX:
# 0,1,2,3,4,5 :: 640x480, 800x600, 1024x768, 1280x1024, 1440x900, 1920x1200
vb.customize ["setextradata", :id, "VBoxInternal2/EfiGopMode", "5"]
# vb.customize ["setextradata", :id, "VBoxInternal2/EfiGraphicsResolution", "1920x1080"]
end
end
@vmarkovtsev
Copy link

Thanks man!

@WayneBuckhanan
Copy link
Author

Glad it helped, @vmarkovtsev. It took a while to find all the pieces to get it working properly!

I also just updated it to include working NFS mounting to get /vagrant within the box working like other OSes that have VB guest extensions.

@mh-cbon
Copy link

mh-cbon commented May 19, 2016

awesome, i got the gui : D thanks !

@WayneBuckhanan
Copy link
Author

Hmm, needs updated to reflect the EFI graphics modes now available in Virtualbox.

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