#StackBounty: #virtualbox #symbolic-link #docker Docker Symlink from shared folder in virtualbox

Bounty: 50

I’m working on a test server, on my computer. Where I have installed Ubuntu server, as a VM in virtual-box.

Version 5.2.8.r121009

Specs:

  • Ubuntu 17.10 4.13.0-21-generic
  • Docker version 18.04.0-ce, build 3d479c0

I have created two Shared folders.

root@docker:/var/lib/docker# ls /media/ -l
totalt 4
drwxr-xr-x 2 root root   4096 mai    8 23:15 cdrom
drwxrwx--- 1 root vboxsf    0 mai    8 23:46 sf_docker-compose
drwxrwx--- 1 root vboxsf    0 mai    9 00:17 sf_docker-volumes 

When I do

service docker stop && 
rm -fr /var/lib/docker/volumes && 
ln -s /media/sf_docker-volumes /var/lib/docker/volumes && 
service docker restart && 
docker ps

I get the following error

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. 
Is the docker daemon running?

So i revert back, to the defaults:

service docker stop && 
rm -fr /var/lib/docker/volumes && 
service docker restart && 
docker ps

And everything is working again.

So my questions is, how can i fix the permissions issues i get from using a symlink for the /var/lib/docker/volumes/ folder.
Im sure that the issue is that the group owner of the symlink is vboxsf and not root. but i cant seem to manage to change that .


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.