Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native-emulation variant does not start, SD card size error #3

Closed
j0bro opened this issue Feb 11, 2021 · 4 comments
Closed

native-emulation variant does not start, SD card size error #3

j0bro opened this issue Feb 11, 2021 · 4 comments

Comments

@j0bro
Copy link

j0bro commented Feb 11, 2021

This is my output, apparently the SD card size is wrong:

+ main
+ has_qemu
+ command -v qemu-system-aarch64
+ run_qemu
+ qemu-system-aarch64 -m 1G -M raspi3 -smp 4 -usb -device usb-mouse -device usb-kbd -device usb-net,netdev=net0 -netdev user,id=net0,hostfwd=tcp::5022-:22 -sd /Users/jeroen/qemu_vms_native/2020-02-13-raspbian-buster-lite.img -dtb /Users/jeroen/qemu_vms_native/bcm2710-rpi-3-b-plus.dtb -kernel /Users/jeroen/qemu_vms_native/kernel8.img -append 'rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1' -no-reboot -nographic
WARNING: Image format was not specified for '/Users/jeroen/qemu_vms_native/2020-02-13-raspbian-buster-lite.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.
qemu-system-aarch64: Invalid SD card size: 1.72 GiB
SD card size has to be a power of 2, e.g. 2 GiB.
You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
(note that this will lose data if you make the image smaller than it currently is).
@faf0
Copy link
Owner

faf0 commented Feb 16, 2021

try

IMAGE="/Users/jeroen/qemu_vms_native/2020-02-13-raspbian-buster-lite.img"; qemu-img resize -f raw "$IMAGE" 2G

@leafac
Copy link

leafac commented Mar 22, 2021

I ran into the same issue and the suggested command worked for me. I suppose you could include this command on the scripts, or at least mention this issue on the documentation.

For the record, I’m on macOS Big Sur 11.2.3 running QEMU 5.2.0.

@faf0
Copy link
Owner

faf0 commented Mar 22, 2021

Thanks, @leafac . The resize command is now part of the install script:

qemu-img resize -f raw "${IMAGE}.img" 2G

@faf0 faf0 closed this as completed Mar 22, 2021
@leafac
Copy link

leafac commented Apr 9, 2021

Great 👍

And thank you for this project. It’s really nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants