fgrehm / vagrant-cachier

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

Cachier causing fails #171

Closed Tecktron closed 7 years ago

Tecktron commented 8 years ago

I have a vagrant box with a vbox provisioner, it's nothing very fancy, using the default sync. It's working fine, but takes forever if I have to spin it up several times, and found this plugin that looks to be an amazing shortcut. However, whenever I try and use it, I get an error mounting the cache dir and thus can't use it.

I'm running Ubuntu 15.10 and am using the latest version of debian/jessie64 box. With Virtualbox 5.0.14_Ubuntu and GuestAdditions 5.0.14_Ubuntu This is on vagrant 1.8.1 With Plugins: vagrant-cachier (1.2.1) vagrant-env (0.0.3) vagrant-reload (0.0.1) vagrant-share (1.1.5, system) vagrant-vbguest (0.11.0)

When I add this to my Vagrantfile:

if Vagrant.has_plugin?("vagrant-cachier")
        config.cache.scope = :box
    end

I see it try and mount the folder:

==> VM: Booting VM...
==> VM: Waiting for machine to boot. This may take a few minutes...
    VM: SSH address: 127.0.0.1:2222
    VM: SSH username: vagrant
    VM: SSH auth method: private key
==> VM: Machine booted and ready!
GuestAdditions 5.0.14 running --- OK.
==> VM: Checking for guest additions in VM...
==> VM: Mounting shared folders...
    VM: /opt => /home/tecktron/vm-shared
    VM: /tmp/vagrant-cache => /home/tecktron/.vagrant.d/cache/debian/jessie64

But then, it sits there for a few seconds before it gives me this error:

Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant-cache /tmp/vagrant-cache
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant-cache /tmp/vagrant-cache

The error output from the last command was:

stdin: is not a tty
mount: wrong fs type, bad option, bad superblock on vagrant-cache,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

Everything dies there. It would seem that it's trying to mount the folder before the guest additions are not finished? Maybe there's a permission issue (although I own everything)? IDK.

I ran dmesg | tail as suggested which gives me

[171695.405451] vboxdrv: ffffffffc0544020 VBoxDD2R0.r0
[171746.192598] vboxdrv: ffffffffc0dce020 VMMR0.r0
[171746.261434] vboxdrv: ffffffffc0ec9020 VBoxDDR0.r0
[171746.262293] vboxdrv: ffffffffc058b020 VBoxDD2R0.r0
[172872.795567] vboxdrv: ffffffffc0a80020 VMMR0.r0
[172872.842466] vboxdrv: ffffffffc0b7b020 VBoxDDR0.r0
[172872.843342] vboxdrv: ffffffffc0085020 VBoxDD2R0.r0
[174425.101466] vboxdrv: ffffffffc0b9a020 VMMR0.r0
[174425.157684] vboxdrv: ffffffffc0c95020 VBoxDDR0.r0
[174425.158605] vboxdrv: ffffffffc028e020 VBoxDD2R0.r0

I'm hoping someone has also had this issue and maybe has some answers. Thanks

Tecktron commented 7 years ago

I found this to be the cause of issue VM: /opt => /home/tecktron/vm-shared You should not mount anything directly into /opt directory as the guest additions also uses this folder and if you're making a mount point of it, it can't read that directory, hence the permissions error. The fix was simple, mount on to a different or sub-directory instead.