ln:无法创建符号链接:协议错误(在Vagrant中)
我正在使用 Laravel Homestead (Vagrant,Ubuntu).我的主机是运行VirtualBox的Windows 10.
I'm using Laravel Homestead (Vagrant, Ubuntu). My host computer is Windows 10 running VirtualBox.
以管理员身份(因为我已经看到很多回答,说缺乏权限通常是人们符号链接出现问题的原因),所以我打开Git Bash并运行以下命令:
As admin (since I've already seen tons of answers that say lack of permissions is usually why people have problems with symlinks), I open Git Bash and run this:
vagrant@vboxHomestead:~/Code/myproject$ ls -lah /home/vagrant/foo/blah
total 0
drwxrwxrwx 1 vagrant vagrant 0 Mar 17 23:09 .
drwxrwxrwx 1 vagrant vagrant 0 Mar 17 22:36 ..
-rwxrwxrwx 1 vagrant vagrant 0 Mar 17 23:09 asdf.txt
vagrant@vboxHomestead:~/Code/myproject$ sudo ln -s /home/vagrant/foo/blah /home/vagrant/Code/myproject/storage/app/public/blah
ln: failed to create symbolic link '/home/vagrant/Code/myproject/storage/app/public/blah': Protocol error
出什么问题了?它与 Homestead的文件夹映射有关吗? 我如何实现我的目标?
What is the problem? Does it have something to do with the folder mappings of Homestead? How can I achieve my goal?
(我的/home/vagrant/Code/
和/home/vagrant/foo/
映射到Windows计算机上的单独驱动器.)
(My /home/vagrant/Code/
and /home/vagrant/foo/
map to separate drives on my Windows machine.)
P.S.在尝试上述步骤之前,我什至删除了宅基地标准公共符号链接只是为了避免其他可能的并发症.
P.S. And before trying the steps above, I even deleted the Homestead standard public symlink just to avoid other possible complications.
P.P.S.我还尝试在底部附近(上方)添加此旋转盒子之前,我的Homestead Vagrantfile的最后一个end
):
P.P.S. I've also tried adding this near the bottom (above the final end
) of my Homestead Vagrantfile before spinning up the box:
config.vm.provider "virtualbox" do |v|
v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end
使用Homestead时,在Windows的公共目录中建立符号链接也会在流浪汉上创建符号链接.相反,可能会(!)产生此错误,并在Windows目录中留下无效的符号链接.
When using Homestead, making a symlink in your public directory in Windows will also create a symlink on vagrant. The other way round may (!) create this error and will leave a not working symlink in your Windows directory.