qemu-system-x86_64:设备 ide-cd 初始化失败:无法获得共享"write"锁



所以我想在Qemu上下载Ubuntu,我在cmd中写了这个命令:

qemu-system-x86_64 -hda ubuntu-20.04.3-desktop-amd64.iso -boot d -cdrom /home/pi/Downloads/ubuntu-20.04.3-desktop-amd64.iso -m 640

但是当我执行它时,终端给了我这个错误:

Unable to init server: Could not connect: Connection refused
WARNING: Image format was not specified for 'ubuntu-20.04.3-desktop-amd64.iso' 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.
qemu-system-x86_64: Initialization of device ide-cd failed: Failed to get shared "write" lock
Is another process using the image [/home/pi/Downloads/ubuntu-20.04.3-desktop-amd64.iso]?

我该怎么办?!

您的命令行尝试使用同一个文件(ubuntu-20.04.3-desktop-amd64.iso)作为硬盘("-hda")和dom ("- cdro")QEMU报错是因为它检查要写入的文件(对于硬盘)没有被其他东西读取(在本例中,与CDROM相同的QEMU进程)。

'-hda'参数需要是其他东西,比如创建一个空磁盘映像作为新的模拟客户硬盘。