有时我得到新创build的文件,我无法访问,虽然我可以列出他们在控制台。 我的Vagrant file
包含这个synced_folder设置:
config.vm.synced_folder "/home/ulkas/Develop/beauty/Beautyportal", "/vagrant/Beautyportal", owner: "vagrant", group: "vagrant", :mount_options => ['dmode=777', 'fmode=777']
它发生时,我创build/修改主机以及在客人的文件,他们只是变得无法访问:
cannot access GuzzleStreamWrapper.php: No such file or directory
什么是值得的是我可以列出他们在控制台,但没有权限(看起来像安装问题):
vagrant@precise64:/vagrant/Beautyportal/vendor/guzzlehttp/streams/src$ ls -al ls: cannot access functions.php: No such file or directory ls: cannot access NoSeekStream.php: No such file or directory ls: cannot access LazyOpenStream.php: No such file or directory ls: cannot access MetadataStreamInterface.php: No such file or directory ls: cannot access StreamInterface.php: No such file or directory ls: cannot access LimitStream.php: No such file or directory ls: cannot access AppendStream.php: No such file or directory ls: cannot access Stream.php: No such file or directory ls: cannot access CachingStream.php: No such file or directory ls: cannot access StreamDecoratorTrait.php: No such file or directory ls: cannot access GuzzleStreamWrapper.php: No such file or directory total 12 drwxrwxr-x 1 vagrant vagrant 4096 Aug 14 11:33 . drwxrwxr-x 1 vagrant vagrant 4096 Aug 14 11:33 .. ?????????? ? ? ? ? ? AppendStream.php ?????????? ? ? ? ? ? CachingStream.php ?????????? ? ? ? ? ? functions.php ?????????? ? ? ? ? ? GuzzleStreamWrapper.php ?????????? ? ? ? ? ? LazyOpenStream.php ?????????? ? ? ? ? ? LimitStream.php ?????????? ? ? ? ? ? MetadataStreamInterface.php ?????????? ? ? ? ? ? NoSeekStream.php ?????????? ? ? ? ? ? StreamDecoratorTrait.php ?????????? ? ? ? ? ? StreamInterface.php ?????????? ? ? ? ? ? Stream.php drwxrwxr-x 1 vagrant vagrant 4096 Aug 14 11:33 .svn
在我重新启动机器( vagrant reload
)后,文件变得可访问,因此我怀疑有安装/重新安装有问题。
这个问题已经出现在Linux mint 13主机以及Windows 7 64位主机上。 box是hashicorp/precise64
我想我已经找到了问题,这是由于重复安装 – 默认情况下,vagrant将主动主机目录/home/user/vagranthost
到/vagrant
。 我所做的是,我添加了额外的子目录作为像/home/user/vagranthost/project
挂载点到/vagrant/project
,从而创建一个冲突,流浪者不认识(还),让它挂载。
因此,解决方案是编辑Vagrantfile
并更改行
config.vm.synced_folder "/home/ulkas/Develop/beauty/Beautyportal", "/vagrant/Beautyportal", owner: "vagrant", group: "vagrant", :mount_options => ['dmode=777', 'fmode=777']
成
config.vm.synced_folder "/home/ulkas/Develop/beauty", "/vagrant", owner: "vagrant", group: "vagrant", :mount_options => ['dmode=775', 'fmode=775']
为了调试,这是在mount
命令的输出之前:
/vagrant on /vagrant type vboxsf (uid=1000,gid=1000,rw) /vagrant/Beautyportal on /vagrant/Beautyportal type vboxsf (uid=33,gid=1000,rw)