在 Debian Jessie 中未使用 vagrant libvirt 提供程序挂载 NFS 共享文件夹

在 Debian Jessie 中未使用 vagrant libvirt 提供程序挂载 NFS 共享文件夹

我对 VM 虚拟化和用于挂载 NFA 共享文件夹的 vagrant libvirt 提供程序有疑问。

在 github 上 @Infernix 的帮助下,我能够正确安装 libvirt 的实例,但现在的问题是如何与 VM 挂载共享目录。

安装参考:

https://github.com/vagrant-libvirt/vagrant-libvirt/issues/710

哦,以前用 vagrant 挂载 nfs 从来没有看到错误。 :o

==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
● nfs-kernel-server.service - LSB: Kernel NFS server support
Loaded: loaded (/etc/init.d/nfs-kernel-server)
Active: active (exited) since Sun 2016-12-18 20:21:10 BRST; 15h ago
=> 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=3,udp 192.168.121.1:/home/tosystems/Documents/projects /home/vagrant/vagrant_projects
result=$?
if test $result -eq 0; then
if test -x /sbin/initctl && command -v /sbin/init && /sbin/init 2>/dev/null --version | grep upstart; then
    /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/home/vagrant/vagrant_rojects
fi
else
    exit $result
fi


Stdout from the command:

Stderr from the command:

stdin: is not a tty
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

我按照下面链接中的@HalosGhost 提示进行操作,但没有成功。

挂载 Linux NFS。 rpc.statd 未运行

我更改了 Vagrant 文件中的synced_folders 参数并添加了:

config.vm.synced_folder "~/Documents/projects", "/home/vagrant/vagrant_projects", 
type: "nfs", nfs_version: 4, "nfs_udp": false, mount_options: ["rw", "vers=4", "tcp"]

但这里还输出:

==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
● nfs-kernel-server.service - LSB: Kernel NFS server support
   Loaded: loaded (/etc/init.d/nfs-kernel-server)
   Active: active (exited) since Sun 2016-12-18 20:21:10 BRST; 19h ago
==> 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,rw,vers=4,tcp 192.168.121.1:/home/tosystems/Documents/projects /home/vagrant/vagrant_projects
result=$?
if test $result -eq 0; then
if test -x /sbin/initctl && command -v /sbin/init && /sbin/init 2>/dev/null --version | grep upstart; then
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/home/vagrant/vagrant_projects
fi
else
exit $result
fi


Stdout from the command:

Stderr from the command:

stdin: is not a tty
mount.nfs: Connection timed out

最终没有成功。

编辑:乌津rsync

==> default: Rsyncing folder: /home/tosystems/ => /vagrant


There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /home/tosystems/
Guest path: /vagrant
Command: "rsync" "--verbose" "--archive" "--delete" "-z" "--copy-links" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 22 -o     LogLevel=FATAL  -o ControlMaster=auto -o ControlPath=/tmp/ssh.661 -o ControlPersist=10m  -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i '/home/tosystems/.vagrant/machines/default/libvirt/private_key'" "--exclude" ".vagrant/" "/home/tosystems/" "[email protected]:/vagrant"
Error: symlink has no referent: "/home/tosystems/.config/google-chrome/SingletonCookie"
symlink has no referent: "/home/tosystems/.config/google-chrome/SingletonLock"
rsync: write failed on "/vagrant/.vagrant.d/boxes/ubuntu-amd64/0/libvirt/box.img": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.1]
rsync: [sender] write error: Broken pipe (32)

相关内容