qemu-system-aarch64 -m <memory size> -M <machine name> -drive if=none,file=<hard drive file name>,id=hd0 \
-device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0
https://translatedcode.wordpress.com/2018/04/25/debian-on-qemus-raspberry-pi-3-model/
>$ ARCHI=64
>$ WORKING_DIR=$(readlink -f `pwd`)
>$ OS_TARGET=rpios${ARCHI}
>$ QEMU_KERNEL=${WORKING_DIR}/qemu_rpios${ARCHI}
>$ BLRT_BUILD_DIR=${WORKING_DIR}/${OS_TARGET}
>$ GIT_XENOMAI_LINUX_DIR=${WORKING_DIR}/xenomai-3
>$ BUILDROOT_DIRECTORY=${WORKING_DIR}/buildroot-2018.02
>$ git clone https://github.com/qemu/qemu.git
>$ ./configure --prefix=/home/happyman/dev_install/qemu12 --enable-debug-stack-usage \
--enable-user --enable-system --enable-modules --enable-tcg-interpreter \
--enable-debug-tcg --python=/usr/bin/python
>$ export PATH=/home/happyman/dev_install/qemu12/bin:$PATH
>$ qemu-system-aarch64 -M virt -cpu help
...
cortex-a15
cortex-a53
cortex-a57
>$ qemu-system-aarch64 -M help
raspi2 Raspberry Pi 2
raspi3 Raspberry Pi 3
>$ cd ${BUILDROOT_DIRECTORY}
>$ make O=${BLRT_BUILD_DIR} list-defconfigs
>$ make O=${BLRT_BUILD_DIR} raspberrypi3_64_defconfig
>$ make O=${BLRT_BUILD_DIR} busybox-menuconfig
>$ make O=${BLRT_BUILD_DIR} linux-menuconfig
>$ make O=${BLRT_BUILD_DIR} menuconfig
>$ make O=${BLRT_BUILD_DIR} source-check
>$ make O=${BLRT_BUILD_DIR} source
>$ make O=${BLRT_BUILD_DIR}
>$ make O=${QEMU_KERNEL} list-defconfigs
>$ make O=${QEMU_KERNEL} qemu_aarch64_virt_defconfig
>$ make O=${QEMU_KERNEL} menuconfig
>$ make O=${QEMU_KERNEL}
#WARNING NONE WORKED
>$ qemu-system-aarch64 -machine virt -cpu cortex-a53 -machine type=virt -nographic \
-smp 4 -m 1024 -kernel ${QEMU_KERNEL}/images/Image --append "console=ttyAMA0" --append "console=ttyAMA0"
>$ qemu-system-aarch64 -machine virt -cpu cortex-a53 -machine type=virt -nographic \
-smp 4 -m 1024 -kernel ${BLRT_BUILD_DIR}/images/sdcard.img --append "console=ttyAMA0"
>$ qemu-system-aarch64 -machine virt -cpu cortex-a53 -nographic -smp 1 -no-reboot -serial stdio \
-hda ${BLRT_BUILD_DIR}/images/sdcard.img -kernel ${QEMU_KERNEL}/images/Image \
-append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" \
-m 1024
Sudo apt-get instll nbd-client nbd-server rbd-nbd
sudo qemu-nbd -c /dev/nbd0 ${QEMU_KERNEL}/images/Image
mkdir qemumnt
sudo mount /dev/nbd0p1 qemumnt
Now let's look at the arguments that configure our system:
-smp 2
- 2 (virtual) cores.-m 1024
- 1024MB of system memory.-M virt
- emulate a generic QEMU ARM machine.-cpu cortex-a53
- the CPU model to emulate.-bios QEMU_EFI.fd
- the BIOS firmware file to use.-nographic
- output goes to the terminal (rather than opening a graphics capable window).-device virtio-blk-device,drive=image
- create a Virtio block device called "image".-drive if=none,id=image,file=ubuntu-16.04-server-cloudimg-arm64-uefi1.img
- create a drive using the "image" device and our cloud server disk image.-device virtio-blk-device,drive=cloud
- create another Virtio block device called "cloud".-drive if=none,id=cloud,file=cloud.img
- create a drive using the "cloud" device and our cloud-config disk image.-device virtio-net-device,netdev=user0
- create a Virtio network device called "user0"-netdev user,id=user0
- create a user mode network stack using device "user0"-redir tcp:2222::22
- map port 2222 on the host to port 22 (the standard ssh port) on the guest.
Here we create a generic QEMU ARM machine
Uh oh!
There was an error while loading. Please reload this page.