notAperson535 / OneClick-macOS-Simple-KVM

Tools to set up a easy, quick macOS VM in QEMU, accelerated by KVM. Works on Linux AND Windows.
https://notAperson535.github.io/OneClick-macOS-Simple-KVM
MIT License
675 stars 52 forks source link

qemu-img convert from dmg to img doesn't work #112

Open darkwar123 opened 4 months ago

darkwar123 commented 4 months ago

Which operating system are you trying to install? macOS Monterey

Describe the bug When I run ./setup.sh on Ubuntu in wsl the command "qemu-img convert BaseSystem.dmg -O raw BaseSystem.img" on line 11 throw an error in the console:

qemu: module block-block-dmg-bz2 not found, do you want to install qemu-block-extra package?
qemu: module block-block-dmg-lzfse not found, do you want to install qemu-block-extra package?
qemu-img: error while reading at byte 0: Input/output error

Expected behavior .dmg file converts to .img

Desktop (please complete the following information):

Additional context Full ./setup output:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3 is already the newest version (3.10.6-1~22.04).
qemu-system is already the newest version (1:6.2+dfsg-2ubuntu6.21).
qemu-utils is already the newest version (1:6.2+dfsg-2ubuntu6.21).
python3-pip is already the newest version (22.0.2+dfsg-1ubuntu0.4).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Formatting 'macOS.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=68719476736 lazy_refcounts=off refcount_bits=16
1. High Sierra (10.13)
2. Mojave (10.14)
3. Catalina (10.15)
4. Big Sur (11)
5. Monterey (12) - Recommended
6. Ventura (13)
7.  Sonoma (14)

Choose a product to download (1-7): 5
Monterey (12) - Recommended
Downloading 012-40515...
Saving http://oscdn.apple.com/content/downloads/36/25/012-40515/f7fz3ubbup5g6lr4yj1x36xydr0fuwomkl/RecoveryImage/BaseSystem.dmg to BaseSystem.dmg...
Note: The total download size is 623.48 MB
Download complete!
Saving http://oscdn.apple.com/content/downloads/36/25/012-40515/f7fz3ubbup5g6lr4yj1x36xydr0fuwomkl/RecoveryImage/BaseSystem.chunklist to BaseSystem.chunklist...
Note: The total download size is 2560 bytes
Download complete!

qemu: module block-block-dmg-bz2 not found, do you want to install qemu-block-extra package?
qemu: module block-block-dmg-lzfse not found, do you want to install qemu-block-extra package?
qemu-img: error while reading at byte 0: Input/output error

Then qemu starts virtual machine but there is no "Mac OS BaseSystem" image.

notAperson535 commented 4 months ago

Maybe try using the dmg2img package? I’ve never seen this issue before

darkwar123 commented 4 months ago

When I'm using dmg2img I'm getting almost the same error, something like "fatal error", I'm trying same installation on the ubuntu installed on hard drive, but getting same error, but without:

qemu: module block-block-dmg-bz2 not found, do you want to install qemu-block-extra package?
qemu: module block-block-dmg-lzfse not found, do you want to install qemu-block-extra package?

but still with:

qemu-img: error while reading at byte 0: Input/output error
notAperson535 commented 4 months ago

@darkwar123 sounds like the basesystem.dmg file didn’t get downloaded properly, could you try again by running ./fetch-macOS-v2.py

Val-d-emar commented 1 month ago

I have had the same errors with qemu-img at Debian 12. Of course, qemu-block-extra package was installed.

qemu: module block-block-dmg-bz2 not found, do you want to install qemu-block-extra package?
qemu: module block-block-dmg-lzfse not found, do you want to install qemu-block-extra package?

When I used dmg2img, conversion passed ok.