我已经为libvirt创建了基本框图像,添加框成功了,它在框列表中可见。
[root@centos7 vagrant]# vagrant box list
rhmaster (libvirt, 0)
[root@centos7 vagrant]#
但是当试图流浪时,抱怨盒子不存在。
[root@centos7 vagrant]# vagrant up --provider=libvirt
Bringing machine 'default' up with 'libvirt' provider...
==> default: Uploading base box image as volume into libvirt
storage...
The box 'rhmaster' does not exist. Please double check and
try again. You can see the boxes that are installed with
`vagrant box list`.
任何指导都非常有用。
我的metadata.json文件:
{
"provider" : "libvirt",
"format" : "qcow2",
"virtual_size" : 30
}
我的Vagrantfile在框图片中添加:
Vagrant.configure("2") do |config|
config.vm.provider :libvirt do |libvirt|
libvirt.driver = "kvm"
libvirt.host = 'localhost'
libvirt.uri = 'qemu:///system'
libvirt.username = 'root'
libvirt.connect_via_ssh = true
end
config.vm.define :new do |rhmaster|
rhmaster.vm.box = "rhmaster"
rhmaster.vm.provider :libvirt do |domain|
domain.memory = 2048
end
end
end