/vagrant 未填充文件

2024-02-10

我已经使用 Vagrant (1.7.4) 配置了默认配置vagrant init在 OS X (10.11.4) 上使用最新版本的 VirtualBox (5.0.16 r105871) 和最新版本ubuntu/trusty64盒子版本(v20160323.0.0)。

我的虚拟机有匹配版本的来宾添加,但我似乎无法获取共享/vagrant工作目录。这/vagrant/虚拟机上存在目录,但是如果我运行ls上面完全是空的。如果我touch来宾上显示的文件/vagrant但不会同步回我的计算机上的项目文件夹,并且在重新启动时消失。 VirtualBox GUI 显示共享文件夹:

https://i.stack.imgur.com/2kYR8.png https://i.stack.imgur.com/2kYR8.png

编辑:流浪文件:

# -*- 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 = "ubuntu/trusty64"

  # 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"

  # 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 "../data", "/vagrant_data"

  # 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
  #   sudo apt-get update
  #   sudo apt-get install -y apache2
  # SHELL
end

我已经弄清楚问题是什么了 - 虽然/vagrant目录存在于计算机上,尽管在 GUI 中将自动挂载功能设置为打开,并且调试输出表明它确实已挂载,但 VirtualBox 并未自动挂载共享文件夹。

Running sudo mount -t vboxsf vagrant /vagrant手动解决问题。我将这一行放入我的新贵工作的预启动脚本中以启动我的服务器。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

/vagrant 未填充文件 的相关文章

  • Homestead 2 xdebug 不起作用

    我有一个 Homestead vagrant VM 设置 Xdebug 是开箱即用的远程调试的所有设置 我可以在这里看到这个 etc php5 fpm conf d 20 xdebug ini 并通过做一个php i grep xdebug
  • 如何用Vagrant处理Mysql、网站源等数据?

    如何使用 Vagrant 处理 Mysql 网站源等数据 作为一名程序员 我喜欢能够轻松设置开发环境 因此 我创建了一个流浪盒子并为其配置了木偶 但我问自己 盒子中的数据怎么样 如果我需要销毁盒子并重新创建它会怎样 我的所有数据都将被删除
  • 无法使用不安全的私钥通过 ssh 连接到 vagrant VM(vagrant 1.7.2)

    我有一个包含 3 个虚拟机的集群 这是 Vagrant 文件 mode ruby vi set ft ruby hosts host0 gt 192 168 33 10 host1 gt 192 168 33 11 host2 gt 192
  • 通过 Vagrant 在 Docker 中共享卷

    我有一个 Vagrant virtualbox 它托管一个 Docker 容器 主机有一个需要在虚拟机和容器中访问的文件夹 Host host path gt VM vagrant path gt Container docker path
  • Mac:执行 Vagrant 使用的 CLI“VBoxManage”时出现错误

    我正在使用 aerospike 并使用 vagrant virtual box 安装它 安装后 当我尝试启动虚拟机时 出现以下错误 执行时出现错误VBoxManage Vagrant 使用的 CLI 用于控制 VirtualBox 命令和
  • 如何一次“vagrant up”多个节点?

    我有一个定义了多个节点的 Vagrantfile 比如节点1 节点2 节点3 我想运行一个命令 vagrant up provision node1 node2 但这似乎在一个命令行中不可能 唯一的方法似乎是并行运行两个命令 vagrant
  • Vagrant:* 未知的配置部分“disksize”

    在我的机器上配置 Vagrant 环境期间 我收到了以下消息 流浪汉 未知的配置部分 disksize 它是在插件安装后显示的 这里是vagrantfile mode ruby vi set ft ruby All Vagrant conf
  • 在虚拟机共享目录上运行“grunt”

    将 Vagrant 与 Windows 主机和 Linux 客户机一起使用 grunt尝试运行作业时返回以下错误 据我了解 在主机 来宾共享目录中 此文件路径超出了 Windows 的 255 个字符限制 npm ERR Error EPE
  • Vagrant 的端口转发不起作用[关闭]

    Closed 这个问题是无关 help closed questions 目前不接受答案 我在最后遇到了一个小问题入门指南vagrant http vagrantup com docs getting started ports html
  • Vagrant 同步文件夹权限

    我已经在 Vagrant 中设置了一个从 Windows 主机到来宾的同步文件夹 最初 文件的权限过于开放 因此我添加了以下安装选项 config vm synced folder my folder home vagrant my fol
  • 使用 Vagrant,为什么 puppet 配置比自定义打包盒更好?

    我正在创建一个虚拟机来模仿我们的生产 Web 服务器 以便我可以与新开发人员共享它 让他们尽快上手 我已经阅读过 Vagrant 文档 但是我不明白使用通用基础盒并使用 Puppet 配置所有内容与打包已安装和配置所有内容的自定义盒相比有何
  • Vagrant - 使用私有接口时如何配置 vagrant ssh?

    我有一个包含 3 个虚拟机的多虚拟机 vagrantfile 设置 其中两个虚拟机的 NAT 网络接口已禁用 并且仅在内部接口上使用静态 IP 副作用是我无法再跑步vagrant ssh foo连接到虚拟机 mode ruby vi set
  • Windows10上打开/创建内网Vagrant失败

    我昨天将 Windows 10 升级到了最新更新 现在启动时vagrant up命令 我收到此错误 gt default Booting VM gt default Waiting for machine to boot This may
  • 如何在 Vagrant 中使用 VirtualBox 创建具有两个 CPU 的虚拟机?

    在 Windows 7 64 位上尝试启动 VM Ubuntu 32 位 尽管添加了以下内容 但我仍无法让我的虚拟机显示两个核心modify vm我的 Vagrantfile 中的命令 我的 Vagrant 版本是 1 2 2 mode r
  • 如何在公网访问Vagrant Box

    我在 vagrant 内的 e box 上创建了 在 Vagrantfile 中 我将网络指定为 Create a private network which allows host only access to the machine u
  • Vagrant + Chef:配置错误“虚拟机上缺少 Chef 所需的共享文件夹。”

    我已经使用 Chef library Chef 安装了 Vagrant Virtualbox 当我做vagrant up第一次 食谱被正确加载 但是 当我事后进行配置时 无论是vagrant provision vagrant reload
  • 是否可以将 Vagrant 与 intelliJ 一起使用?

    假设我正在使用 Java 并使用 IntelliJ 来执行构建和部署等操作以及其他类似操作 我以前没有使用过 Vagrant 但是在运行 Vagrant 实例时是否可以继续使用 IntelliJ 进行构建和部署 是的 您可以将 IDE 与
  • 开发/生产中的 Ansible 服务器/组

    我所处的情况是看不到正确的使用方法 我有多个分配了不同角色的服务器 分布在多个组中 与生产 登台环境相比 我在本地 Vagrant 环境中遇到了一些使用 group vars 的困难 在生产中 有更多的服务器 分配的组更少 在我的 Vagr
  • 无法在 Vagrant 上运行的 CentOS 7 上安装 Docker

    使用 Vagrant 文件的全新实例 VAGRANTFILE API VERSION 2 Vagrant configure VAGRANTFILE API VERSION do config config vm box chef cent
  • Vagrant 盒子无法找到错误

    我正在尝试使用虚拟盒设置虚拟机 我已经在我的 Windows 7 64 位机器上安装了 Virtual Box 和 vagrant 我还使用puphpet搭建了一个环境 但每当我尝试安装盒子 ubuntu1404 x64 时 它都会抛出错误

随机推荐