5
votes

I am trying to emulate Ubuntu Core for Raspberry Pi 3 using QEMU but it does not work.

I found tutorials about emulating Raspbian using QEMU and tried to apply them to Ubuntu Core:

I could not find the right kernel so I used Raspbian Kernel. It did not work. Then I Mounted Ubuntu Core Image and extracted the kernel.img it also did not work.

I start qemu with this command

qemu-system-arm -kernel ./kernel.img \
-cpu arm1176 \
-m 256 \
-M versatilepb \
-no-reboot \
-serial stdio \
-append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" \
-drive "file=pi3.img,index=0,media=disk,format=raw" \
-redir tcp:2222::22 

QEMU starts but does not load Ubuntu Core.

Does somebody emulated Ubuntu Core(for Raspberry Pi 3) with QEMU?

1
Hallo, I pretty sure now it is impossible to emulate Ubuntu Core for Raspberry Pi 3 on QEMU. But alternative you can emulate, Ubuntu Core for Raspberry Pi 2. I was able to Emulate Ubuntu Core for Raspi 2 on QEMU Using this command: qemu-system-arm -M raspi2 -serial stdio -kernel kernel.img -initrd initrd.img -append "dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty0 elevator=deadline snap_core=core_3750.snap snap_kernel=pi2-kernel_22.snap" -dtb bcm2709-rpi-2-b.dtb -sd ubuntu-core.qcowRustam Isaev
The related Topic is about running Raspbian OS on QEMU. Ubuntu Core seems to be more complicatedRustam Isaev
Yes, not saying it is a dupe or anything. I'd just recommend that you try to get that working first (I didn't manage to get the display working on vanilla kernel so far).Ciro Santilli 新疆再教育营六四事件法轮功郝海东

1 Answers

0
votes

This bit: "-M versatilepb" says "please emulate a VersatilePB development board". (That's a several decades old ARM evaluation board.) "-cpu arm1176" asks for an "arm1176" CPU, which is the ARMv6 CPU that's in the raspberry pi 1. Most userspace code intended for the raspi2 or raspi3 will not run on that (they use a newer ARMv7 CPU). Basically you're trying to use a command line from a tutorial for running a versatilepb kernel on a versatilepb model in order to run raspi 1 userspace images and filesystems. It won't work for raspi2 or raspi3 userspace code.

(Current upstream QEMU does now have a model of a raspi3; I suspect it is not yet complete enough to be able to boot the Ubuntu image, though.)