Code Monkey home page Code Monkey logo

mac-dev-box's Introduction

mac-dev-box

Introduction

I want to automate my Mac OS X Yosemite setup, because you never know when it might crash. After buying my MBP I have started a manual logbook what I have installed. But using Vagrant for a long time I know there must be a better way.

So I try my automation script in a Vagrant environment. I'm using just a simple shell provider for these reasons:

  • learn how to automate some steps (like install a .dmg file)
  • have a provision script that could be loaded from HTTP and executed on a real MBP.

What others did

But before you ask, I also know BOXEN:

QUIT WORRYING ABOUT YOUR TOOLS.
Automate the pain out of your development environment.
Boxen installs your dependencies so you can focus on getting things done.

But they also have to do the Xcode Command Line Tool download in a semi automated way.

Another thing I have learned so far is caskroom.io

"To install, drag this icon..." no more!

Here you find many more packages to install from command line.

Shopping

To build a mac-dev-box on your MBP, you will need the following:

The basebox

You have to build an OS X Yosemite basebox from boxcutter/osx.

You will need a downloaded InstallESD.dmg file with eg. OS X 10.10.4. Please read the boxcutter docs for details. These were my steps to build the osx1010-desktop basebox.

git clone https://github.com/boxcutter/osx
cd osx
mkdir -p "iso/OS X Yosemite"
cp ../InstallESD.dmg "iso/OS X Yosemite/InstallESD.dmg"
sed -i.bak -e 's/Install\\ OS\\ X\\ Yosemite\.app/InstallESD.dmg/' Makefile
make vmware/osx1010-desktop
vagrant box add osx1010-desktop box/vmware/osx1010-desktop-nocm-1.0.1.box

Vagrant up

These are my current steps to build the mac-dev-box:

git clone https://github.com/StefanScherer/mac-dev-box
cd mac-dev-box
vagrant up --provider vmware_fusion

Where is Retina?

The Vagrantfile sets an option to start the VM with Retina (HiDPI). The provision script scripts/enable-hidpi.sh enables HiDPI inside the VM. At the moment you have to logout and login again to make this change work. Then open the System Preferences, set the display to "scaled" using the HiDPI setting. Enjoy!

Time saver

To speed up the development of such a provision script, I always use the vagrant-multiprovider-snap plugin.

vagrant plugin install vagrant-multiprovider-snap

So you build a clean machine with this and take a snapshot:

vagrant up --no-provision
vagrant snap take

Then you can do what you want with the box, manually or with vagrant provision scripts. After your provision script has improved enough, test it again with:

vagrant snap rollback
vagrant provision

Licensing

Copyright (c) 2014 Stefan Scherer

MIT License, see LICENSE for more details.

mac-dev-box's People

Contributors

stefanscherer avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.