Vagrant 在df命令中两次随机装入文件夹

Vagrant 在df命令中两次随机装入文件夹,vagrant,Vagrant,以下是df结果: vagrant@precise64:~$ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/precise64-root 78G 3.7G 70G 6% / udev 172M 4.0K 172M 1% /dev tmpfs 73M 296K 73M

以下是df结果:

vagrant@precise64:~$ df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/precise64-root   78G  3.7G   70G   6% /
udev                        172M  4.0K  172M   1% /dev
tmpfs                        73M  296K   73M   1% /run
none                        5.0M     0  5.0M   0% /run/lock
none                        182M     0  182M   0% /run/shm
cgroup                      182M     0  182M   0% /sys/fs/cgroup
/dev/sda1                   228M   53M  164M  25% /boot
vagrant                     233G   82G  152G  35% /vagrant
vagrant                     233G   82G  152G  35% /vagrant
srv_website                 233G   82G  152G  35% /srv/website
srv_website                 233G   82G  152G  35% /srv/website
密钥装载信息:

config.vm.synced_folder "vagrant_data" ,"/srv/website"
奇怪的是/vagrant安装了两次,所以/srv/website也安装了两次

vagrant                     233G   82G  152G  35% /vagrant
vagrant                     233G   82G  152G  35% /vagrant
srv_website                 233G   82G  152G  35% /srv/website
srv_website                 233G   82G  152G  35% /srv/website
这是我的流浪汉档案:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
  #config.vm.box = "hashicorp/precise64"
  config.vm.box = "afterdocker"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  config.vm.network "private_network", ip: "192.168.33.10"
  #config.vm.network "public_network"
  #config.vm.network "public_network", bridge: "en0: Wi-Fi (AirPort)"
  # Iterating the loop for three times
    (1..2).each do |i|
        # Defining VM properties
        config.vm.define "nvm#{i}" do |node|
            # Specifying the provider as VirtualBox and naming the VM's
            config.vm.provider "virtualbox" do |node|
                # The VM will be named as nvm{i}
                node.name = "nvm#{i}"
            end
        end
    end

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  config.vm.synced_folder "vagrant_data" ,"/srv/website"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  # config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
  # end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
  # such as FTP and Heroku are also available. See the documentation at
  # https://docs.vagrantup.com/v2/push/atlas.html for more information.
  # config.push.define "atlas" do |push|
  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
  # end

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2
  # SHELL
end
#-*-模式:ruby-*-
#vi:set ft=ruby:
#所有的流浪配置都在下面完成。Vagrant.configure中的“2”
#配置配置版本(我们支持较旧的
#向后兼容性)。除非你知道什么,否则请不要改变它
#你在干什么。
Vagrant.configure(“2”)do | config|
#下面对最常见的配置选项进行了说明和评论。
#有关完整的参考资料,请参阅
# https://docs.vagrantup.com.
#每个流浪的开发环境都需要一个盒子。你可以搜索
#盒子在https://atlas.hashicorp.com/search.
#config.vm.box=“hashicorp/precise64”
config.vm.box=“afterdocker”
#禁用自动框更新检查。如果禁用此功能,则
#只有在用户运行时,才会选中复选框进行更新
#“流浪汉盒子过时了”。不建议这样做。
#config.vm.box\u check\u update=false
#创建允许访问特定端口的转发端口映射
#从主机上的端口在计算机内。在下面的例子中,
#访问“localhost:8080”将访问来宾计算机上的端口80。
#config.vm.network“forwarded_port”,来宾:80,主机:8080
#创建专用网络,仅允许主机访问计算机
#使用特定的IP。
config.vm.network“专用_网络”,ip:“192.168.33.10”
#config.vm.network“公共_网络”
#config.vm.network“public_network”,网桥:“en0:Wi-Fi(机场)”
#循环迭代三次
(1..2)每个人都做|
#定义虚拟机属性
config.vm.define“nvm{i}”do|节点|
#将提供程序指定为VirtualBox并命名VM的
config.vm.provider“virtualbox”do |节点|
#虚拟机将命名为nvm{i}
node.name=“nvm{i}”
结束
结束
结束
#创建一个公共网络,它通常与桥接网络相匹配。
#桥接网络使机器显示为计算机上的另一个物理设备
#你的网络。
#config.vm.network“公共_网络”
#将其他文件夹共享到来宾VM。第一个论点是
#主机上实际文件夹的路径。第二个论点是
#来宾服务器上装载文件夹的路径。还有第三个选项
#参数是一组非必需的选项。
config.vm.synced_文件夹“vagrant_data”,“/srv/website”
#提供程序特定的配置,以便您可以微调各种
#为流浪者提供支持。这些公开特定于提供程序的选项。
#VirtualBox的示例:
#
#config.vm.provider“virtualbox”do | vb|
##启动机器时显示VirtualBox GUI
#vb.gui=true
#
##自定义虚拟机上的内存量:
#vb.memory=“1024”
#结束
#
#有关详细信息,请查看您正在使用的提供程序的文档
#关于可用选项的信息。
#为推送到Atlas定义一个流浪推送策略。其他推送策略
#例如FTP和Heroku也可以使用。请参阅位于的文档
# https://docs.vagrantup.com/v2/push/atlas.html 了解更多信息。
#config.push.define“atlas”do | push|
#push.app=“您的\u ATLAS\u用户名/您的\u应用程序\u名称”
#结束
#使用shell脚本启用资源调配。其他供应人,如
#木偶,厨师,Ansible,盐和码头工人也可以。请看
#有关其特定语法和用法的详细信息,请参阅文档。

#config.vm.provision“shell”,inline:您是否注意到Vagrant同步了一个默认文件夹“/Vagrant”,可能您同步了两次。您可以禁用此行为是发生在所有框上还是仅发生在其中一个框上?它似乎适用于所有框。vagrant 233G 93G 141G 40%/vagrant 233G 93G 141G 40%/vagrant禁用同步后,仍然很奇怪:folder/vagrant mount twiceDid您注意到vagrant同步了一个默认文件夹“/vagrant”可能您同步了两次。您可以禁用此行为是在所有框上发生还是仅在其中一个框上发生?看起来这适用于所有框。vagrant 233G 93G 141G 40%/vagrant 233G 93G 141G 40%/禁用同步后的vagrant,仍然很奇怪:文件夹/vagrant装载两次