当使用virt-install出现错误时
事件
尝试使用virt-install创建或导入虚拟机时,会出现以下错误。
# virt-install --name centos6.5 --vcpus 1 --ram 1024 --disk path=/tmp/qemu/centos6.5.img,size=10,sparse=true --network network:default --graphics vnc --cdrom /tmp/CentOS-7.0-1406-x86_64-DVD.iso
Starting install...
Creating storage file centos6.5 | 10 GB 00:00
ERROR 内部エラー console ログ出力の読み込み中にプロセスが終了しました: char device redirected to /dev/pts/7
2015-02-22T09:03:05.388038Z qemu-kvm: -drive file=/tmp/CentOS-7.0-1406-x86_64-DVD.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw: could not open disk image /tmp/CentOS-7.0-1406-x86_64-DVD.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 centos6.5
otherwise, please restart your installation.
处理办法 cè)
将虚拟磁盘和映像文件的所有权转移到qemu。
# chown qemu:qemu /tmp/CentOS-7.0-1406-x86_64-DVD.iso