I keep getting a permissions error when trying to dump the Redis .rdb file to my vagrant shared folder. The saves are working fine when going to the default /var/lib/redis location.

A few things I've tried (suggested in various forums / threads):

1) adding the following to /etc/init.d/redis-server:


2) Changing the umask flag to 022 in /etc/init.d/redis-server

3) Opening up permissions on the vagrant shared folder itself.

Pretty sure this one's just going over my head and that I'm doing something wrong. Spent 2 or 3 hours on it though and am starting to lose hair ;)

  • What OS is hosting vagrant and what OS are you using for your box? – user113230 Oct 2 '13 at 22:35

On Ubuntu 13.04 (Raring-Ringtail) Server you need to modify the /etc/init.d/redis-server. Look for the following two sections that need to be changed:


  echo -n "Starting $DESC: "
  mkdir -p $RUNDIR
  touch $PIDFILE
  chown redis:redis $RUNDIR $PIDFILE  # <---- Old Line
  chown vagrant:vagrant $RUNDIR $PIDFILE # <---- New Line


  # <-- Old Line
  if start-stop-daemon --start --quiet --umask 007 --pidfile $PIDFILE --chuid redis:redis --exec $DAEMON -- $DAEMON_ARGS
  # <-- New Line
  if start-stop-daemon --start --quiet --umask 007 --pidfile $PIDFILE --chuid vagrant:vagrant --exec $DAEMON -- $DAEMON_ARGS


Basically you are looking for instances of the redis:redis (owner / group) text strings and replacing them with the equivalent vagrant:vagrant ones.

If you have run the redis-server at least once under the default redid user then you will also have to change the ownership of the log directory to the vagrant user otherwise the redis server will not restart.

chown -R vagrant:vagrant /var/log/redis

After you have restarted the redid-server you should be able to generate a dump to your /vagrant folder by issuing:

redis-cli save

re you using virtualbox as the provider here, or something else. if virtualbox, whats the host environment?

It might help to show us the error message you get, or (better) the point in strace output where the failure occurs. I'm wondering what exactly the failed operation is. Opening a file? Obtaining a lock?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.