Writing /var/lib/dokuwiki/data/meta/tutorials/debian_buster_for_rpi3_with_qemu.meta failed
tutorials:debian_buster_for_rpi3_with_qemu
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:debian_buster_for_rpi3_with_qemu [2019/11/04 23:59] – admin | tutorials:debian_buster_for_rpi3_with_qemu [2022/09/20 00:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
This guide explains how to get Debian Buster using a RaspberryPi 3 image running with Qemu. These images are 64bits (aarch64), therefore, taking advantage of RPi 3 and 4 newest hardware. | This guide explains how to get Debian Buster using a RaspberryPi 3 image running with Qemu. These images are 64bits (aarch64), therefore, taking advantage of RPi 3 and 4 newest hardware. | ||
- | These configuration is useful in order to use a big PC to precompile and afterwards export the binaries to the slower/real Raspberry Pi. | + | This configuration is useful in order to use a big PC to precompile and afterwards export the binaries to the slower/real Raspberry Pi. |
This will be used to get ROS2 installed. | This will be used to get ROS2 installed. | ||
+ | |||
+ | ===== Preparing your host system ===== | ||
+ | |||
+ | * Install aarch64 qemu and other dependencies | ||
+ | |||
+ | sudo apt-get install qemu-system-arm xz-utils | ||
+ | |||
+ | * Create a directory for your emulated system | ||
+ | |||
+ | mkdir ~/ | ||
+ | cd ~/ | ||
+ | |||
+ | * Download the raspberry pi image (Browse for newer images if possible, if you select the raspberry pi 3 image, you'll get a 64bit system): | ||
+ | |||
+ | wget https:// | ||
+ | |||
+ | * Qemu requires the kernel and initrd image as separate files. First we decompress the image: | ||
+ | |||
+ | xz --decompress 20190628_raspberry-pi-3_buster_PREVIEW.img.xz | ||
+ | |||
+ | * Now we have to mount the first (/boot) partition of this image to extract the kernel and initrd files. But we need to determine the file byte offset for the first partition in order to mount it. We use fdisk for this: | ||
+ | |||
+ | sudo fdisk -l 20190628_raspberry-pi-3_buster_PREVIEW.img | ||
+ | |||
+ | * It should print something like this: | ||
+ | |||
+ | < | ||
+ | Disk 20190628_raspberry-pi-3_buster_PREVIEW.img: | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | Disklabel type: dos | ||
+ | Disk identifier: 0x36969c21 | ||
+ | |||
+ | Device | ||
+ | 20190628_raspberry-pi-3_buster_PREVIEW.img1 | ||
+ | 20190628_raspberry-pi-3_buster_PREVIEW.img2 | ||
+ | </ | ||
+ | |||
+ | * Use the start sector (2048) of the first partition and multiply it with the sector size (512). 2048*512=1048576 | ||
+ | * Use this number to mount with offset the first partition: | ||
+ | |||
+ | mkdir -p ~/mnt/test | ||
+ | sudo mount -o offset=1048576 20190628_raspberry-pi-3_buster_PREVIEW.img ~/mnt/test | ||
+ | |||
+ | * Now copy the kernel and initrd files: | ||
+ | |||
+ | cp ~/ | ||
+ | cp ~/ | ||
+ | |||
+ | |||
+ | * Now we are ready to run the emulated system: | ||
+ | |||
+ | qemu-system-aarch64 -M virt -m 1024 -smp 4 -cpu cortex-a53 | ||
+ | |||
+ | |||
+ | * Username: root, password: raspberry | ||
+ | * The network interface included in the " | ||
+ | |||
+ | nano / | ||
+ | |||
+ | * Inside of this file put the following content: | ||
+ | |||
+ | < | ||
+ | auto enp0s2 | ||
+ | |||
+ | # TODO: switch back to iptables-persistent once it re-enters testing | ||
+ | iface enp0s2 inet dhcp | ||
+ | pre-up iptables-restore < / | ||
+ | pre-up ip6tables-restore < / | ||
+ | </ | ||
+ | |||
+ | * Poweroff the VM: | ||
+ | |||
+ | poweroff | ||
+ | |||
+ | * Restart the VM | ||
+ | |||
+ | * The hostfwd in the qemu command was necessary to be able to access this computer from your host computer. You can do this with: | ||
+ | |||
+ | ssh root@localhost -p 2222 | ||
+ | |||
+ | * ssh in the guest system was hanging during startup. It was hanging in a getrandom() system call. To avoid this hanging the qemu option " | ||
+ | |||
+ | |||
Line 11: | Line 96: | ||
https:// | https:// | ||
+ | |||
https:// | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
tutorials/debian_buster_for_rpi3_with_qemu.1572911949.txt.gz · Last modified: 2022/09/20 00:08 (external edit)