Jat*_*mar 8 kvm virtual-machine permission-denied
我已经安装kvm,libvirt戴尔poweredge1000m刀片之一.我使用以下语法从现有映像安装虚拟机(以root身份执行).
virt-install --name=vm_test --ram=1024 --arch=i686 --vcpus=1 --os-type=linux --import --disk path=/root/shared.qcow2,bus=virtio,format=qcow2 --graphics vnc,port=5901,listen=0.0.0.0,password=newone --noautoconsole --description --autostart
Run Code Online (Sandbox Code Playgroud)
我收到以下错误.
Starting install...
ERROR internal error process exited while connecting to monitor: char device redirected to /dev/pts/1
open /dev/kvm: Permission denied
failed to initialize KVM: Operation not permitted
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start vm_test
otherwise, please restart your installation.
Run Code Online (Sandbox Code Playgroud)
我使用了与其他桌面主机完全相同的命令,它在那里工作.我可以virt-manager使用ISO映像安装VM ,virt-manager将磁盘映像存储在默认位置.
这似乎是一个文件权限错误给我,因为它不使用/vms目录,但正在使用其他/home/vm目录.
提前感谢您的帮助
小智 5
我在服务器上收到了相同的错误消息,该消息已libvirt持续数周.设置libvirt为以root身份运行(如链接中所述)对我不起作用.但是,授予读取和执行访问权限以/var/lib/libvirt/images解决我的问题.
chmod go+rx /var/lib/libvirt/images
chmod o-rwx /var/lib/libvirt/images/*
Run Code Online (Sandbox Code Playgroud)
我已经找到了解决问题的方法,就在这里。
真正的原因是,这/vms是一个 NFS 挂载,其配置 ( no_root_squash + rw) 需要通过 root 进行访问。
默认情况下,libvirt 使用用户和组权限运行虚拟机,libvirt-qemu:kvm即使您使用 sudo 权限运行它也会产生问题。所以我们需要在 /etc/libvirt/qemu.conf 中将 qemu 进程的用户和组设置为 root。
另外,正如其他人所指出的,导致此错误的原因可能有多种,令人遗憾的是 libvirt 抛出了这样一个通用错误。
最不令人沮丧的解决方案是授予所有权限,禁用 selinux 并确保它运行。现在一一撤销权限测试它在每一步都有效,终于明白为什么需要授予最终的一组权限了。
| 归档时间: |
|
| 查看次数: |
20388 次 |
| 最近记录: |