【问题标题】:vagrant - constantly syncing folder setupvagrant - 不断同步文件夹设置
【发布时间】:2016-02-08 07:58:48
【问题描述】:

我正在尝试使用 virtualbox 在我的 windows10 上构建一个 centos7 虚拟机。我正在使用 cento/7 盒子。 它默认使用 rsync 同步文件夹,我不太喜欢它,因为我必须打开一个额外的 cmd 才能运行 vagrant rsync-auto 以进行持续同步。 我尝试使用 nfs 但没有成功。 这是我的流浪文件。

Vagrant.configure(2) do |config|
  config.vm.box = "centos/7"
  config.vm.synced_folder ".", "/home/vagrant/sync", type: "nfs"
end

当我尝试运行它时。它给了我这个。

Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` home_vagrant_sync /home/vagrant/sync
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` home_vagrant_sync /home/vagrant/sync

The error output from the last command was:

mount: unknown filesystem type 'vboxsf'

我注意到主机所做的更改将同步到访客,但反之则不会。我想让文件夹像共享文件夹一样,来宾和主机都可以对其应用更改。有什么最好的方法吗? 谢谢。

【问题讨论】:

    标签: windows centos vagrant virtualbox centos7


    【解决方案1】:

    您收到的回复是告诉您安装 Virtual Box 来宾添加。这是您必须在安装 Virtual Box 之上执行的单独安装操作。您是否安装了 Virtual Box Guest Additions?

    【讨论】:

    • 谢谢。安装 VBoxGuestAdditions 后,它就可以工作了。我按照这里的手册(virtualbox.org/manual/ch04.html)但是我发现它有点过时了。应该是点击“设备”中的“光驱”挂载VBoxGuestAdditions.iso。然后,使用命令“mount /dev/cdrom /mnt”将 iso 挂载到来宾 vm。这样就更容易遵循手册了。我在想是否有通过 vagrantfile 安装 Virtualbox 来宾添加?
    猜你喜欢
    • 2015-08-21
    • 1970-01-01
    • 2017-01-01
    • 1970-01-01
    • 2016-06-18
    • 2016-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多