内部错误:process exited while connecting to monitor: qemu-system-x86_64报错解决

错误: 内部错误:early end of file from monitor, possible problem: 2020-03-18T14:35:03.329327Z qemu-system-x86_64: -drive file=/image/ubuntu-134.qcow2,format=qcow2,if=none,id=drive-virtio-disk0: Could not open backing file: Could not open '/yang/image/ubuntu-16.04.raw': Permission denied

错误: 内部错误:process exited while connecting to monitor: 2020-03-18T14:35:03.329327Z qemu-system-x86_64: -drive file=/image/ubuntu-134.qcow2,format=qcow2,if=none,id=drive-virtio-disk0: Could not open backing file: Could not open '/yang/image/ubuntu-16.04.raw': Permission denied

+ virsh define ubuntu-122.xml
定义域 ubuntu-122(从 ubuntu-122.xml)
+ virsh start ubuntu-122
错误: 开始域 ubuntu-122 失败
错误: 内部错误:process exited while connecting to monitor: 2020-03-17T11:46:39.835075Z qemu-system-x86_64: -drive file=/image/ubuntu-122.qcow2,format=qcow2,if=none,id=drive-virtio-disk0,cache=none: Could not open backing file: Could not open '/image/ubuntu-12.10.raw': Permission denied

笔者分别使用Ubuntu-12.10.raw 镜像和Ubuntu-16.04.raw 批量创建qcow2镜像虚拟机报如上报错,因报权限问题,经多方查找资料,及两个不同版本操作系统实测,怀疑是将raw镜像放于root  属主下级目录导致。实测以下措施可解决

1、将镜像移到片普通用户任意二级目录下
root@field_A0:/yang/image# ll ubuntu-16.04.raw*
-rwxrwxrwx 1 libvirt-qemu kvm 1610612730 3月  18 22:19 ubuntu-16.04.raw*
root@field_A0:/yang/image# cp ubuntu-16.04.raw /home/fieldyang/yang/.
root@field_A0:/home/fieldyang/yang# ll ubuntu-16.04.raw*
-rwxr-xr-x 1 libvirt-qemu kvm 16106127360 3月  18 22:59 ubuntu-16.04.raw*
root@field_A0:/home/fieldyang/yang#
2、修改属主属组为root
root@field_A0:/home/fieldyang/yang# chown -R root:root ubuntu-16.04.raw*
3、修改创建命令中绝对路径
#基于ubuntu-16.04.raw创建qcow2镜像
qemu-img create -f qcow2 -o cluster_size=2M,backing_file=/home/fieldyang/yang/ubuntu-16.04.raw ubuntu-$ip.qcow2 50G

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章