![带有 NVME 引导的 QEMU 命令可以正常工作,但无法转换为 virt-install 参数](https://linux22.com/image/220949/%E5%B8%A6%E6%9C%89%20NVME%20%E5%BC%95%E5%AF%BC%E7%9A%84%20QEMU%20%E5%91%BD%E4%BB%A4%E5%8F%AF%E4%BB%A5%E6%AD%A3%E5%B8%B8%E5%B7%A5%E4%BD%9C%EF%BC%8C%E4%BD%86%E6%97%A0%E6%B3%95%E8%BD%AC%E6%8D%A2%E4%B8%BA%20virt-install%20%E5%8F%82%E6%95%B0.png)
我正在尝试将工作 qemu 命令转换为 virt-install 参数。工作命令是:
qemu-system-x86_64 -bios /usr/share/OVMF/OVMF_CODE.fd -boot c -drive file=/vm/image.qcow2,if=none,id=NVME1 -device nvme,drive=NVME1,serial=nvme-1 -m 4G -cpu host -enable-kvm
...我什么想法使用 virt-install 进行一对一转换最终会出现错误:
sudo virt-install --boot loader=/usr/share/OVMF/OVMF_CODE.fd --boot cdrom,hd --disk none --qemu-commandline='-drive file=/vm/image.qcow2,format=qcow2,if=none,id=NVME1 -device nvme,drive=NVME1,serial=nvme-1' --memory 4096 --os-variant rhel9.0 --name Test
这会导致此错误:
Starting install... ERROR internal error: process exited while connecting to monitor: 2023-06-01T00:16:40.801184Z qemu-system-x86_64: -drive file=/vm/image.qcow2,format=qcow2,if=none,id=NVME1: Could not open '/vm/image.qcow2': 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 Test otherwise, please restart your installation.
我很困惑。我是 QEMU/KVM/libvirt 新手,所以我深入研究了文档,但无济于事。