Preparing Vagrant Yosemite box

Installing from the cloud

ssh scg@scgmini; cd /Users/scg/deployment/vagrant/projects/yosemite
vagrant init jhcook/osx-yosemite-10.10
vagrant up

At this point vagrant created default Vagrantfile, downloaded and imported the box, but failed to load it.

  • Tuning vagrant file at /Users/scg/deployment/vagrant/projects/yosemite/Vagrantfile
    # -*- mode: ruby -*-
    # vi: set ft=ruby :
    Vagrant.configure(2) do |config| = "jhcook/osx-yosemite-10.10" 
      config.vm.synced_folder '.', '/vagrant', disabled: true "private_network", ip: "" 
    config.vm.provider "virtualbox" do |vb|
      vb.customize ["modifyvm", :id, "--memory", "8192"]
      vb.customize ["modifyvm", :id, "--cpus", 2]
      vb.customize ["modifyvm", :id, "--audio", "none", "--usb", "on", "--usbehci", "off"]

vagrant reload
At this point box should be running. You can in principle go to macmini desktop, login, call Virtualbox and see running box in the list.

Updating the box

  • Applying Apple updates

ssh scg@scgmini; cd /Users/scg/deployment/vagrant/projects/yosemite-dev
vagrant ssh # password "vagrant"
softwareupdate --install --all # password "vagrant"

  • Updating for the second time

vagrant reload; vagrant ssh
softwareupdate --install --all # password "vagrant"

  • Modifying authorized_keys in the box with the key from server

vagrant ssh; cd .ssh
scp sch@scgmini:./.ssh/ to .ssh/authorized_keys
scp sch@scgmini:./.ssh/id_rsa to .ssh/id_rsa

this is required because we use ssh to send dmg installer from the box back to the build server

  • Installing homebrew in the box

ruby -e "$(curl -fsSL"
Edit .profile and add there GITHUB API token

Installing xcode in the box

  • Go to macmini desktop, run Virtualbox, connect to already running Yosemite box
  • Donwload XCode 7.2.1 from (Apple developer ID is required)
  • Install XCode;

sudo xcode-select -switch /Applications/
sudo xcodebuild -license

  • vagrant reload
Install BornAgain dependencies in the box
  • brew install llvm
  • brew install git cmake fftw gsl python homebrew/python/matplotlib numpy boost libtiff eigen libyaml yaml-cpp
  • Install Anaconda2 from dmg (using desktop)
  • Install Qt5 from online installer (using desktop)
Packaging box
  • Packaging box

vagrant package --output
mv ~/deployment/vagrant/orig_boxes/.
vagrant destroy
Removing original box
vagrant box remove jhcook/osx-yosemite-10.10

  • Adding just created box

vagrant box add yosemite-dev /Users/scg/deployment/vagrant/orig_boxes/

  • Running box for the first time

vagrant up --no-provision
vagrant ssh; exit
vagrant provision # check how provisioning working, compilation should start

Here box is ready

vagrant destroy