创建kvm虚拟机报错

centos7.4 创建kvm虚拟机时报错
问题:[root@oldboy ~]# virt-install --virt-type kvm --os-type=linux --os-variant rhel7 --name centos7 --memory 1024 --vcpus 1 --disk /opt/centos2.raw,format=raw,size=10 --cdrom /root/CentOS-7-x86_64-DVD-1804.iso --network network=default --graphics vnc,listen=0.0.0.0 --noautoconsoleStarting install…Allocating ‘centos2.raw’ | 10 GB 00:00:00 ERROR internal error: process exited while connecting to monitor: 2019-04-26T02:40:30.310751Z qemu-kvm: -drive file=/root/CentOS-7-x86_64-DVD-1804.iso,format=raw,if=none,id=drive-ide0-0-0,readonly=on: could not open disk image /root/CentOS-7-x86_64-DVD-1804.iso: Could not open ‘/root/CentOS-7-x86_64-DVD-1804.iso’: Permission deniedRemoving disk ‘centos2.raw’ | 0 B 00:00:00 Domain installation does not appear to have been successful.If it was, you can restart your domain by running: virsh --connect qemu:///system start centos7otherwise, please restart your installation.

原因:创建过程中qemu用户会读取/root/目录下的CentOS-7-x86_64-DVD-1804.iso镜像,但是qemu用户没有读取/root目录的权限,

所以报错解决方法:将镜像移动到opt目录下,修改创建的命令,进行创建,检查端口,成功[root@openstack ~]# mv CentOS-7-x86_64-DVD-1804.iso /opt/[root@openstack ~]# virt-install --virt-type kvm --os-type=linux --os-variant rhel7 --name centos7 --memory 1024 --vcpus 1 --disk /opt/centos2.raw,format=raw,size=10 --cdrom /opt/CentOS-7-x86_64-DVD-1804.iso --network network=default --graphics vnc,listen=0.0.0.0 --noautoconsole[root@openstack ~]# netstat -lntup|grep 5900tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN 2586/qemu-kvm

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值