我去年开始使用fedora 24作为我的学习/工作电脑。我第一次遇到一个问题,我无法在合理的时间内弄清楚。
我们需要将Vagrant用于项目,并且我试图让它在我的计算机上运行。命令 vagrant up 在安装nfs时失败。这是命令后面的输出:
Bringing machine 'default' up with 'libvirt' provider...
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
==> default: Waiting for SSH to become available...
==> default: Creating shared folders metadata...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
[sudo] password for feilz:
Redirecting to /bin/systemctl status nfs-server.service
● nfs-server.service - NFS server and services
Loaded: loaded (/etc/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
Drop-In: /run/systemd/generator/nfs-server.service.d
└─order-with-mounts.conf
Active: active (exited) since Wed 2017-02-15 15:17:58 EET; 19h ago
Main PID: 16889 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 512)
CGroup: /system.slice/nfs-server.service
Feb 15 15:17:58 feilz systemd[1]: Starting NFS server and services...
Feb 15 15:17:58 feilz systemd[1]: Started NFS server and services.
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o 'vers=4' 192.168.121.1:'/home/feilz/env/debian64' /vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
mount.nfs: access denied by server while mounting 192.168.121.1:/home/feilz/env/debian64
我的Vagrantfile看起来像:(我跳过注释掉的行)
Vagrant.configure(2) do |config|
config.vm.box = "debian/jessie64"
config.vm.provider :libvirt do |libvirt|
libvirt.driver = "qemu"
end
end
我可以运行 vagrant ssh 命令登录,然后编写命令
sudo mount -o 'vers=4' 192.168.121.1:'/home/feilz/env/debian64' /vagrant
在流浪汉内再试一次。然后输出变为
mount.nfs: access denied by server while mounting 192.168.121.1:/home/feilz/env/debian64
我已经浏览了大量网页。我修复了丢失的红宝石宝石(nokogiri和libffi)。我尝试修改/ etc / exports文件,它不起作用,并在我运行vagrant halt / up后重置它。
我安装了vagrant插件vagrant-libvirt
我还没尝试过什么,这可以让我为Vagrant使用NFS文件共享?