An Ubuntu 12.04 OS is recommended for ''building'', but any linux distribution is OK for ''flashing'' an image. If you're running Ubuntu 12.04 in a VM, that's perfectly fine: you can mirror your build into your host OS and then flash from your host.
On Ubuntu 12.04, you may need to [http://ubuntuportal.com/2012/07/quick-tips-easy-way-to-disable-auto-mount-on-ubuntu-12-04-lts.html disable automounting of USB drives].
If you built b2g in your host OS, you can skip the following instructions.