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 FilesOracleVirtualBoxVBoxManage.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

Filed under: Uncategorized