fgrehm / vagrant-cachier

Caffeine reducer
http://fgrehm.viewdocs.io/vagrant-cachier
MIT License
1.07k stars 111 forks source link

Issue with cachier and Ubuntu 16.04 #182

Closed kiklop74 closed 7 years ago

kiklop74 commented 7 years ago

I am currently experimenting with vagrant and Ubuntu 16.04 64bit using bento/ubuntu-16.04. While performing tests that included vagrant-cachier I noticed unfortunate behavior.

In order to provide cached packages cachier creates a temporary directory that points within the VM os to /tmp/vagrant-cache/apt/ and is symlinked to /var/cache/apt/archives/ . All nice and neat except one thing. The directory /tmp/vagrant-cache/apt/ is created and owned by the user vagrant. That in turn generated following warning message when installing any package using apt-get.

sudo apt-get install libjs-jquery-lazyload

Reading package lists... Done
<snipped extra stuff>

W: Can't drop privileges for downloading as file '/var/cache/apt/archives/partial/libjs-jquery_1.11.3+dfsg-4_all.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
scanepa commented 7 years ago

Adding the following lines in your config should to the trick:

 config.cache.synced_folder_opts = {
      owner: "_apt",
      group: "_apt"
    }

I'm thinking the right solution is create another synced folder.

keengene commented 7 years ago

Had the same problem. This did it for me:

config.cache.synced_folder_opts = {
      owner: "_apt",
      group: "vagrant"
    }
kiklop74 commented 7 years ago

Thanks