Home > Software design >  qemu-system-x86_64: Initialization of device ide-cd failed: Failed to get shared "write" l
qemu-system-x86_64: Initialization of device ide-cd failed: Failed to get shared "write" l

Time:09-29

So I'm trying to download Ubuntu on Qemu, and I wrote this command into the 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

but when I execute it, the terminal gives me this error:

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]?

What do I do?!

CodePudding user response:

Your commandline tries to use the same file (ubuntu-20.04.3-desktop-amd64.iso) both as a hard disk ("-hda") and as a crdom ("-cdrom"). QEMU complains because it checks that the file it's going to write to (for the hard disk) is not also being read by something else (in this case, the same QEMU process as a CDROM).

The '-hda' argument needs to be something else, such as an empty disk image that you create to be your new emulated guest hard disk.

  • Related