Shared folder problem

Discussions about using Linux guests in VirtualBox.
Post Reply
Tom B
Posts: 6
Joined: 23. Oct 2015, 14:36

Shared folder problem

Post by Tom B »

I'm using Vagrant to set up shared folders and it works perfectly however, I am encountering a very strange error and it seems to be a virtualbox issue rather than a vagrant one. To reproduce this:

1) run `stat test.txt` on the Linux guest when test.txt does not exist. It correctly tells me the file doesn't exist

2) Create test.txt on the host via the shared folder

3) Run ls -aoh on the guest. It now shows:

ls: cannot access test.txt: No such file or directory

As well as:

Code: Select all

-rw-rw-r-- 1 vagrant    7 Oct 23 12:24 test12.css
-????????? ? ?          ?            ? test.txt

If I create the file on the host prior to running stat on the guest it works perfectly. Both Linux and Windows hosts behave the same way.

Any ideas?
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Shared folder problem

Post by loukingjr »

Vagrant is not supported here. If you can recreate the error without Vagrant you should repost.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
Tom B
Posts: 6
Joined: 23. Oct 2015, 14:36

Re: Shared folder problem

Post by Tom B »

The exact same thing happens without vagrant.

Mounting a shared folder /media/srv on the guest to /home/tom/srv on the host then:

1) run stat newfile.css inside the guest

2) Create the file newfile.css on the host

3) Type ls -aoh on the guest

The output shows:

Code: Select all

ls: cannot access newfile.css: No such file or directory

And all permissions are set to ??? even though newfile.css does appear in the list.


The same thing happens on both a Windows and Linux host
Last edited by Tom B on 23. Oct 2015, 16:59, edited 1 time in total.
Tom B
Posts: 6
Joined: 23. Oct 2015, 14:36

Re: Shared folder problem

Post by Tom B »

I've just worked out that running:

Code: Select all

echo 3 > /proc/sys/vm/drop_caches 
on the guest fixes the problem... so it appears to be to do with the filesystem cache on the guest
Post Reply