容器内的 virt-install 命令

virt-install command inside a container

到 运行 容器中的 libvirtd 服务 - 使用下面列出的步骤 link- http://www.projectatomic.io/blog/2014/10/libvirtd_in_containers/

已成功在 rhel7 上启动 libvirtd 服务容器。但是当我启动 libvirt-client 容器并尝试 运行 上面的 virt-install 命令来启动 fedora- 我们看到以下错误。

[root@b054f0860441 libvirt]# virt-install --name fedoratest --vcpus=4 --ram 4096 --os-type=linux --disk path=/var/lib/libvirt/images/Fedora-Cloud-Base-24-1.2.x8664.qcow2,format=qcow2,size=9 --check pathinuse=off, --noautoconsole --network bridge=virbr0 --import 警告 KVM 加速不可用,使用 'qemu' 警告磁盘/var/lib/libvirt/images/Fedora-Cloud-Base-24-1.2.x8664.qcow2 已被其他客人使用 ['x', 'y'].

正在开始安装...错误无法在 'virbr0' 上获取接口 MTU:没有这样的设备-------->>>> 这似乎是错误

与 docker0 的连接、virbr0 网络、DNS 连接等 - 一切正常。 ifconfig 命令不列出容器内的接口,但 'ip addr' 列出 docker 内的接口。 任何帮助表示赞赏。

使用 --network none 有助于继续安装。所以如果你想看到 fedora 的登录提示。这是对我有用的命令:This specific Fedora image loads with network none option:

docker 运行 -it --rm -v /var/lib/libvirt:/var/lib/libvirt cisco-kuldeep_libvirt-client virt-install --name fedora_test25 - -vcpus=1 --ram 4096 --os-type=linux --network none --disk path=/var/lib/libvirt/images/Fedora-x86_64-20-20131211. 1-sda.qcow2,format=qcow2,size=9 --check path_in_use=off, --graphics none --network none --import