当我尝试使用以下特定行运行qemu时,我会得到这个index=0 exists错误:
命令:
qemu-system-x86_64 `
-cpu "Penryn-v1" `
-boot order=c,once=d `
-m 4096 `
-smp 2,sockets=2,cores=2,threads=2,maxcpus=8 `
-drive file="F:\Maquinas Virtuais\VMs\Kali.img",media=disk `
-drive file="F:\Maquinas Virtuais\ISOs\kali-linux-2021.4a-installer-amd64.iso",media=cdrom输出:
WARNING: Image format was not specified for 'F:\Maquinas Virtuais\VMs\Kali.img' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
F:\qemu\qemu-system-x86_64.exe: ,media=disk: drive with bus=0, unit=0 (index=0) exists
PS F:\Maquinas Virtuais\VMs>如果我要删除media=的部分,那么QEMU就会启动,但是看起来它找不到文件( .img和.iso文件没有加载在QEMU上)
命令:
qemu-system-x86_64 `
-cpu "Penryn-v1" `
-boot order=c,once=d `
-m 4096 `
-smp 2,sockets=2,cores=2,threads=2,maxcpus=8 `
-drive file="F:\Maquinas Virtuais\VMs\Kali.img" `
-drive file="F:\Maquinas Virtuais\ISOs\kali-linux-2021.4a-installer-amd64.iso"我试图在bus,unit and index标志上显式地告诉qemu -drive,但是每次错误都是一样的。
通过删除-drive行并为.img disk发出-hda和为.iso cdrom发出-cdrom,我成功地启动了QEMU。
命令:
qemu-system-x86_64 `
-cpu "Penryn-v1" `
-boot order=c,once=d `
-m 4096 `
-smp 2,sockets=2,cores=2,threads=2,maxcpus=8 `
-hda "F:\Maquinas Virtuais\VMs\Kali.img" `
-cdrom "F:\Maquinas Virtuais\ISOs\kali-linux-2021.4a-installer-amd64.iso"有人知道为什么QEMU在使用传递index=0 exists的特定属性的-drive标志运行QEMU时发出错误?即使没有media=,QEMU也不会按预期启动,因为它找不到启动cdrom或HD的文件。
发布于 2022-02-11 06:56:26
仔细阅读错误信息。例如,
Specify the 'raw' format explicitly to remove the restrictions.如果您确定这是原始图像,请告诉QEMU不要尝试自动检测:file=...,format=raw。警告将与对第0项的限制一起消失。
media属性与此无关。它告诉QEMU如何将存储显示到VM中,而不是如何在主机中支持它。
https://serverfault.com/questions/1093335
复制相似问题