virt-install could not open disk image
2016-02-13 21:15
621 查看
简介
本文介绍如何解决因qemu的用户和组配置错误导致virt-install无法读取磁盘映像问题。问题描述
在使用virt-install安装虚拟机时,出现无法读取ISO磁盘映像问题,日志如下:[root@CentOS65 ~]# virt-install --name=centos65 --ram=2048 --vcpu=1 --os-type=linux --hvm --cdrom=/root/CentOS-6.5-x86_64-minimal.iso --file=/home/kvm/centos65.img --file-size=10 --bridge=br0 --vnc --vncport=5920 Starting install... Creating storage file centos65.img | 10 GB 00:00 ERROR internal error Process exited while reading console log output: char device redirected to /dev/pts/4 2016-01-27T08:56:58.986952Z qemu-kvm: -drive file=/root/CentOS-6.5-x86_64-minimal.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw: could not open disk image /root/CentOS-6.5-x86_64-minimal.iso: Permission denied Domain installation does not appear to have been successful. If it was, you can restart your domain by running: virsh --connect qemu:///system start centos65 otherwise, please restart your installation.
问题分析与解决方案
上述“Permission denied”问题,属于用户权限问题,查看/etc/libvirt/qemu.conf配置文件,查找到如下相关的配置项:# The user for QEMU processes run by the system instance. It can be # specified as a user name or as a user id. The qemu driver will try to # parse this value first as a name and then, if the name doesn't exist, # as a user id. # # Since a sequence of digits is a valid user name, a leading plus sign # can be used to ensure that a user id will not be interpreted as a user # name. # # Some examples of valid values are: # # user = "qemu" # A user named "qemu" # user = "+0" # Super user (uid=0) # user = "100" # A user named "100" or a user with uid=100 # #user = "root" # The group for QEMU processes run by the system instance. It can be # specified in a similar way to user. #group = "root"需要配置qemu进程的用户和组相关配置,可根据自己的实际情况进行修改,作者将user和group都设置成root:
# The user for QEMU processes run by the system instance. It can be # specified as a user name or as a user id. The qemu driver will try to # parse this value first as a name and then, if the name doesn't exist, # as a user id. # # Since a sequence of digits is a valid user name, a leading plus sign # can be used to ensure that a user id will not be interpreted as a user # name. # # Some examples of valid values are: # # user = "qemu" # A user named "qemu" # user = "+0" # Super user (uid=0) # user = "100" # A user named "100" or a user with uid=100 # user = "root" # The group for QEMU processes run by the system instance. It can be # specified in a similar way to user. group = "root"
配置修改完成后,需要重启libvirtd服务
[root@CentOS65 ~]# service libvirtd restart
4000
相关文章推荐
- SASS ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/sass
- Linux history命令
- Linux下文件的三种时间
- Linux环境下系统函数的使用
- Ubuntu 15.10 安装 小米/360 2代等随身WIFI驱动
- OpenCV实现人脸识别
- Docker实践2:安装Docker及weblogic镜像
- ubuntu14.04 PCL1.8 OPENNI2.0 OPENCV3.0安装小结
- bash脚本之二(语法+测试)
- CxImage Linux的编译
- Shell脚步学习指南提点
- 网站的编写的重点
- 网站的编写顺序
- destoon后台与前端做商城网站
- Linux tail,cat,head命令
- OpenGL3--1--概述
- Codeforces 622D Optimal Number Permutation 【贪心】
- Renascence架构原理——遗传规划算法
- git使用--可视化工具
- Linux下忘记mysql密码该如何修改mysql密码