ubuntu安装kvm

ubuntu安装kvm

https://help.ubuntu.com/community/KVM/Installation

(一)

用上面的方法安装,在安装VM客户机的时候一直提示:

“下面参数前都是两个“-”

virt-install \
> --network bridge:br0 \
> --name win7 \
> --ram=2048 \
> --vcpus=1 \
> --disk path=/mnt/data/Virtualization/VM/win7/win7.img,size=50 \
> --vnc \
> --cdrom /mnt/data/Virtualization/VM/win7/win7.iso
Error setting up logfile: No write access to directory /home/hank/.cache/virt-manager
WARNING  /mnt/data/Virtualization/VM/win7/win7.img may not be accessible by the hypervisor. You will need to grant the 'libvirt-qemu' user search permissions for the following directories: ['/mnt/data']

Starting install...
Allocating 'win7.img'                                                                                   |  50 GB  00:00:00
ERROR    Cannot access storage file '/mnt/data/Virtualization/VM/win7/win7.img' (as uid:64055, gid:129): Permission denied
Removing disk 'win7.img'                                                                                |    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 win7
otherwise, please restart your installation.

”

我只注意:ERROR    Cannot access storage file ‘/mnt/data/Virtualization/VM/win7/win7.img’ (as uid:64055, gid:129): Permission denied

忽略了WARNING  /mnt/data/Virtualization/VM/win7/win7.img may not be accessible by the hypervisor. You will need to grant the ‘libvirt-qemu’ user search permissions for the following directories: [‘/mnt/data’]

在把libvirt-qemu用户添加到‘/mnt/data’读和执行权限后,可以正常安装客户系统。

(二)

ISO文件要和VM GUEST文件放在同一个目录(或有同样的目录权限),不然会一直提示xxx.iso没有权限。

发表评论