我正在尝试将我使用vagrant创建的计算机导出到Virtualbox的OVA文件或者在vagrantcloud中托管的程序包。机器导出成功,但是当我启动它时,应该有我的文件的目录是空的。看起来像一个流浪的菜鸟问题。
为什么" / usr / local / fieldpapers /"当我启动导出的VM时,它是空的? 如何在导出后保留该目录中的文件?
Vagrant文件:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.synced_folder "./", "/usr/local/fieldpapers/", id: "vagrant-root",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775,fmode=664"]
config.vm.provider :virtualbox do |vb, override|
vb.memory = 1024
vb.cpus = 1
vb.name = "Field Papers"
override.vm.box = "precise64"
override.vm.box_url = "http://files.vagrantup.com/precise64.box"
override.vm.network :private_network, ip: "192.168.33.10"
override.vm.provision :ansible, :playbook => "provisioning/playbook.yml"
end
end
答案 0 :(得分:0)
首先检查你的流浪汉版本,如果它是最新的。
其次,删除下面的行,vagrant会自动将你的本地文件夹挂载到/ vagrant的远程vagrant实例。
config.vm.synced_folder "./", "/usr/local/fieldpapers/", id: "vagrant-root",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775,fmode=664"]