Checkout mozilla-central and use "ac_add_options --enable-application=b2g/dev" in your mozconfig.
=== How do I run FxOS B2G OS on it? ===Updated instructions are available on [https://developer.mozilla.org/en-US/docs/Mozilla/B2G_OS/Mulet Mulet MDN page]
Checkout the gaia repo, then build a regular profile (just run make within your gaia folder).
Once your gaia profile is built, open mulet with this profile.