vagrant shell script failing with unexplained error ```read-only file system(runtimeerror)```

Some possibilities:

You might be using a shared folder in VirtualBox that doesn't support symlinks (unless that's been fixed). There's supposedly a VBoxManage command to fix this now, something like

VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1

or this into the Vagrant file (assuming SHARE_NAME is v-root in this one):

config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]

For more possibilities see: https://www.virtualbox.org/ticket/10085#comment:12 or a long forum on the topic at https://github.com/mitchellh/vagrant/issues/713

Another possibility is that you might be running the script so early in the boot process that the root (or possibly just the /tmp) filesystem hasn't been remounted in read/write mode, say, if the script is being run from one of the /etc/rc.2/S(num)(name) scripts and the (num) is too low.

Tags:

Vagrant