(based on this pastebin i've found via Google, markdownified and adjusted to work with the official Yosemite release)
Yosemite's first developer preview was released right after Monday's WWDC opening keynote. For the general public, an open beta will be available to download later this summer. However, for those who want a sneak peek at the new hotness, there is a way to safely install it without risking your machine, using the free and powerful VirtualBox application from Oracle.
(LEGAL DISCLAIMER: This guide aims to explain how to create a virtual machine on a regularly purchased Apple computer, running a genuine Mac OS X operating system, for testing purposes only.)