【问题标题】:Vagrant failed permissions with nfs only when mounting to apache folders仅在挂载到 apache 文件夹时,Vagrant 使用 nfs 的权限失败
【发布时间】:2013-06-15 07:39:29
【问题描述】:

我使用 Linux Mint 作为主机,使用 CentOS 作为访客,每当我尝试将文件夹共享到 apache 文件夹(下面的示例)时,它都会失败,并且所有其他 apache 操作都失败。

config.vm.share_folder "apache", "/var/www/html", "../src", :extra => 'dmode=775,fmode=775', :nfs => (FFI::Platform::IS_WINDOWS ? false: true)

然后我收到以下错误:

error: unpacking of archive failed on file /var/www/html: cpio: chown failed - Operation not permitted

但是,当我将文件夹挂载到 /html 时,没有任何问题,而且我的 vagrant 运行干净。

我正在拼命地尝试将东西放在它们本来应该存在的文件夹中,知道如何解决这个问题吗?

【问题讨论】:

    标签: vagrant nfs centos6 linux-mint


    【解决方案1】:

    我们也遇到过这种问题。

    这里的工作方式是调整 nfs 导出到的语法:

    config.vm.synced_folder ".", "/vagrant", :nfs => { :mount_options =>  ["dmode=777","fmode=777"] }
    

    26710386中所述

    注意 :nfs 行和挂载选项。您必须将其用作

    nfs => { :mount_options => ["dmode=777","fmode=777"] }
    

    而不是后一种方式 type: "nfs", mount_options: ... was.

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 2014-12-29
      • 2016-04-25
      • 2021-03-31
      • 2023-04-09
      • 1970-01-01
      • 1970-01-01
      • 2013-11-25
      • 2016-06-18
      • 2014-02-13
      相关资源
      最近更新 更多