I have a Vagrant virtualbox which hosts a Docker container. The host machine has a folder which needs to be accessible in the vm and the container:
Host: /host/p
I had the same issues. The posted solutions didn't fit my requirements.
Here is my solution. If you run more than one container iterate over the cids in /var/lib/vagrant/cids/
The first script disables the docker-deamon container autostart at boot. The second script starts the container by its CID only if it isn't running.
This is working for the initial vagrant up and following vagrant [ up | reload ] --provision
# -*- mode: ruby -*-
# vi: set ft=ruby :
$disableAutostart = <