How to build an ubuntu VM that compiles B2G

1. Download Virtual Box and install it:
2. Download the 12.04 image:
3. “C:\Program Files\Oracle\VirtualBox\VBoxManage.exe” modifyhd ubuntu_12.04.vdi –resize 524288
Note: 524288 for 512 gigs of space.

4. Launch Virtual Box
5. Create New
6. select : B2G, Type: Linux, Version: Ubuntu
7. Select the 12.04 image and create the image
8. Set the CD/DVD player to be live
9. use a ubuntu image to boot off.
10. Use gparted tool off a Ubuntu CD to repartition the space ( see : )

11. launch image: Active user account(s) (username/password): ubuntu/reverse

Note: If you want to share your Desktop, make sure the image is selected, then go to settings-> Shared Folders and select the “+” folder icon to the right.
Once you do that put in the folder path and the folder name and select the checkbox on how you want to set that folder.

12. install java : ,
13. install android sdk :
14. devices set :
15. update android sdk

16. setup prereq:
17. sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib git ia32-libs-multiarch:i386 libncurses5-dev:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip

18. set ccache
19. shutdown the VM, setup the USB so that the device can be seen through the Virtual machine
20. leave the device plugged into the machine.  Make sure that the device can be adb pulled from.

21. Do a git clone from mozilla-b2g/B2G.git
git clone B2G

22. run ./ <target device>
note: if you’re wanting to make v1-train run: BRANCH=v1-train ./ <target device>

23 run ./repo sync
24. run ./

Troubleshoot any issues.  chances are that you may have issues do to the device pull.
here are steps to resolve that:
a) rm -rf backup-<devicename>
b) go to the folder that contains ie devices/<whatever, whatever>/<device name>/
c) run adb root
d) run adb remount
e) sudo ./

then build again

25. run ./ to flash the device.

Note: su might not hold the environment.  It’s because there’s a feature to use secure paths:

you can change this by : sudo visudo

About shizen008

Breaking things and getting in trouble for it since '74. Disclaimer: I am not responsible if I make your head explode reading this blog! The writings here are my own expression and not of any companies. I currently work on being a QA for B2G aka Firefox OS
This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to How to build an ubuntu VM that compiles B2G

  1. gaso lin says:

    I’m writing a project that auto-configure FirefoxOS Build Environment in a VM via vagrant . It might saves new contributors burden. It will be nice if you could take a look and give some advices.

  2. shizen008 says:

    Oh interesting. Thanks Gaso lin. I’ll see if I can find some time to look at it.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s