title: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
body: <p>Problem: I am trying to run docker inside vagrant, my Vagrantfile contains following:-</p>
  
  <pre><code>  config.vm.provision "docker" do |d|
       d.run "ubuntu",
         cmd: "bash -l",
         args: "-v '/vagrant:/var/www'"
    end
  </code></pre>
  
  <p>docker gets installed but when I run any command it gives the error below:-</p>
  
  <pre><code>Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
  </code></pre>
  
  <p>I have tried </p>
  
  <ol>
  <li><p><a href="https://docs.oracle.com/cd/E52668_01/E75728/html/section_rdz_hmw_2q.html" rel="nofollow noreferrer">https://docs.oracle.com/cd/E52668_01/E75728/html/section_rdz_hmw_2q.html</a></p></li>
  <li><p>logged in as <code>root</code> into vagrant and started docker still same problem.</p></li>
  <li><p>tried <code>chmod on /var/run/docker.sock</code> file</p></li>
  </ol>
  
  <p>nothing seems to work.</p>
  
  <p>output of <code>ps -ef</code> is</p>
  
  <pre><code>/usr/bin/dockerd
  
  docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir 
  /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
  </code></pre>