title: How to access Redis running in Vagrant Virtual Machine
body: <p>We are trying to use Vagrant to run a Redis server on Mac (using an Ubuntu Guest OS) with this <a href="https://github.com/dwyl/learn-redis/blob/bcdf498ebb8fcb792d60fce8b90632070de25fce/Vagrantfile" rel="nofollow noreferrer"><strong>Vagrantfile</strong></a></p>
  
  <p>Sadly we are unable to access the Redis database inside the Vagrant Box.</p>
  
  <p>We get this error:</p>
  
  <p><code>Error: Redis connection to 127.0.0.1:6379 failed - read ECONNRESET</code></p>
  
  <p>This is the Network configuration in the VirtualBox VM:</p>
  
  <p><img src="https://i.imgur.com/oGyPs17.png" alt="vagrant ports"></p>
  
  <p>What <em>else</em> do we need to add to the Vagrantfile to expose Redis to Mac?</p>
  
  <p>(Note: the reason for using Vagrant is both to let people try redis without having to install it on their main OS, but more importantly to ensure that other elements of the app run as expected) </p>