首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >QEMU - (Index=0)

QEMU - (Index=0)
EN

Server Fault用户
提问于 2022-02-11 04:51:51
回答 1查看 3K关注 0票数 0

当我尝试使用以下特定行运行qemu时,我会得到这个index=0 exists错误:

命令:

代码语言:javascript
复制
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

输出:

代码语言:javascript
复制
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上)

命令:

代码语言:javascript
复制
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。

命令:

代码语言:javascript
复制
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的文件。

EN

回答 1

Server Fault用户

发布于 2022-02-11 06:56:26

仔细阅读错误信息。例如,

代码语言:javascript
复制
         Specify the 'raw' format explicitly to remove the restrictions.

如果您确定这是原始图像,请告诉QEMU不要尝试自动检测:file=...,format=raw。警告将与对第0项的限制一起消失。

media属性与此无关。它告诉QEMU如何将存储显示到VM中,而不是如何在主机中支持它。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1093335

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档