The guide below tries to explains how to easily install Mac OS X Yosemite 10.10 in a virtual machine using VirtualBox. It’s based on this pastebin which I found via Google, adjusted to work with Yosemite.

Source: Install OS X 10.10 Yosemite in VirtualBox · frdmn’s Notes