Pre-built environment for Raspberry Pi cross-compiling and NFS booting


I’ve just deployed my first project developed with this workflow on a standalone rPi. The project used slimmed down versions of ofxTimeline and ofxUI, which had previously taken 1-1.5 hours to compile on the pi. Using this workflow, each compile cycle took about 3 minutes.

@eric_gradman I’d like to help add to your read_me for this process. what’s the best way forward for that?


Oh man, that’s cool.
Fork my repository, and send me pull requests!


Thanks a lot for sharing!


this looks awesome! will try it out and report back how it goes!


Thanks A LOT!
It saves so much time compiling oF!

But I’m a newbie and have quite some difficulties to understand:

  1. where to put your project in order to compile them and sync them to the PI
    but especially how to turn the NFS boot “off” on the rpi SD to get a standalone image.
    I don’t really get what do to when you say:
  2. On the Raspberry Pi root partition, alter /etc/fstab and restore the mount point for /
  3. On the Raspberry Pi boot partition, remove the stuff after “rootwait”

do you make a sudo nano on fstab?
where to remove the stuff rootwait ?

Thanks for the help


the stuff after rootwait in cmdline.txt on the /boot partition. (NOT including rootwait)


Thanks for this! I am starting with all this mess of cross compiling with OSX & RPi.

I have seen the “official” guide too ( and this one also:

I will try to get this method working… but I have a doubt:
Can I use Parallels? or it must be done with Virtual Box? (I ask this because I tryed to make VB work without success. I get some problems with Ubuntu and Ati graphics)


Yes you can use Parallels! I am using Parallels myself, but I decided to release this with VirtualBox because it’s free.

Substituting this line in your Vagrantfile should make it “just work” = “parallels/ubuntu-12.04”


ok. I am testing now. I edited the line ou told me and I get this error:

McZ:rpi-build-and-boot manu$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'parallels/ubuntu-12.04' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'parallels/ubuntu-12.04'
    default: URL:
The box you're attempting to add doesn't support the provider
you requested. Please find an alternate box or use an alternate
provider. Double-check your requested provider to verify you didn't
simply misspell it.

Name: parallels/ubuntu-12.04
Requested provider: [:virtualbox]

I changed the wired ip on OSX, and accessing internet by the wifi.
This command should build an Ubuntu image from scratch? … I tested with my installed Ubuntu 14.04 LTS in Parallels running too. I have not changed his ip. Maybe I need to change the ip of the Ubuntu?

Maybe is too hard for me…

EDIT: I just followed all the “oficial” cross compile guide, and I get the PK CONFIG ERRORS…


I am back trying to setup this. I have a more precise question (i hope)…
Must I do the last “Post-Install Setup” step on this ?
I mean to configure the servers like this ?


OK! finally I made the ‘vagrant up’ command work !! :slight_smile:
The problem was I didn’t was getting access to the internet from the terminal, and then it didn’t found the server.
I solved this sharing in preferences the internet access from the wifi to the wired one.


It sure looks like you’re still using the virtualbox provider… is it running properly in Parallels now?


I am using Virtual Box, to minimize differences with your instructions.

Now I am in the ‘NFS boot your Pi’ step.
It stops after booting a little time, I think it not founds the networked VM.

Should I connect the RPi to the OSX machine directly with a ethernet cable? or must I plug both to the router hub?
I am not sure because I don’t now if the router can handle 2 different masks networks…


it doesn’t matter if you use a switch/hub. it should work either way (unless your router isn’t routing packets properly).

make sure another computer (not a rpi!) on that router can ping the virtual machine.


Some note on getting this Vagrant running with Parallels

first you need this vagrant plugin installed by using this line
vagrant plugin install vagrant-parallels

then get vagrant box for parallels install with this line
vagrant box add parallels/ubuntu-12.04

I also changed this line in Vagrantfile according to @eric_gradman = "parallels/ubuntu-12.04"

Then when you vagrant up you can avoid calling default provider (VirtualBox) by run
vagrant up --provider parallels


Thanks. I’ll try again all this thing soon. I decided to surrender some time ago.
I was stucked with some python problems. I think there were 2 different python versions “in conflict” or something.
Now I am needing it again because all RPi compiling it’s very slow here.


Thanks for putting this together! This has saved me so much frustration!


I’m running into the same problem. At around 5 seconds into booting the pi says

bootserver=, rootserver=, rootpath=

and then nothing, until around 310 seconds:

VFS: Unable to mount root fs via NFS, trying floppy

I don’t have an other machine on the network to try pinging, but (at least) from my (OS X) terminal I can ping the Vagrant ( machine fine, and vice versa (vagrant pings alright and can also ssh into OS X.)

Any ideas?


is there some option to login as pi user? I cant seem to get write access with this.


You missed a semicolon at the end of the line of the first Acquire. It should be

Acquire::http::proxy "";
Acquire::https::proxy "";

How did you make to get internet access for the RPI? Following your instructions I could do apt-get, but not wget, ping, etc


Replying to myself, I had to do this to route all traffic from the RPI to the internet (Found in

In your Ubuntu VM, assuming that eth0: internet, eth1: your RPI connected via ethernet cable

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo iptables -A FORWARD -o eth0 -i eth1 -s -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A POSTROUTING -t nat -j MASQUERADE
sudo iptables-save | sudo tee /etc/iptables.sav

uncomment this line in /etc/sysctl.conf


Also, I removed all references to the proxy, but not sure if that affected… i did many things at the same time, such a bad methodology