https://github.com/afbjorklund/raspbian-proot
Running Raspbian in PRoot
https://github.com/afbjorklund/raspbian-proot
raspberry-pi
Last synced: about 1 month ago
JSON representation
Running Raspbian in PRoot
- Host: GitHub
- URL: https://github.com/afbjorklund/raspbian-proot
- Owner: afbjorklund
- Created: 2018-09-26T19:38:13.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-14T11:44:41.000Z (over 5 years ago)
- Last Synced: 2025-08-20T01:51:07.176Z (about 2 months ago)
- Topics: raspberry-pi
- Language: Shell
- Homepage:
- Size: 65.4 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Raspbian and Proot
This about running Raspbian GNU/Linux (arm), in a PRoot environment (amd64).
* Debian
* RaspbianDownload:
https://www.raspberrypi.org/downloads/raspbian/
* PRoot
* QemuInstall:
`sudo apt install proot qemu-user`
You will need a Raspbian image, which can be downloaded zipped at around 350M:
``` console
$ wget http://director.downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2018-06-29/2018-06-27-raspbian-stretch-lite.zip
$ unzip 2018-06-27-raspbian-stretch-lite.zip
```We can list the partitions on the standard offical Raspbian image, using `fdisk`:
``` console
$ LANG=C fdisk -l 2018-06-27-raspbian-stretch-lite.img
Disk 2018-06-27-raspbian-stretch-lite.img: 1.8 GiB, 1862270976 bytes, 3637248 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4d3ee428Device Boot Start End Sectors Size Id Type
2018-06-27-raspbian-stretch-lite.img1 8192 96663 88472 43.2M c W95 FAT32 (LBA)
2018-06-27-raspbian-stretch-lite.img2 98304 3637247 3538944 1.7G 83 Linux
```Multiply the sectors by 512, to get a suitable offset for mounting the partions:
``` console
sudo mkdir -p /mnt/img/one
sudo mount -o ro -t vfat -o offset=4194304 2018-06-27-raspbian-stretch-lite.img /mnt/img/one
sudo mkdir -p /mnt/img/two
sudo mount -o ro -t ext4 -o offset=50331648 2018-06-27-raspbian-stretch-lite.img /mnt/img/two
```Then we can start an interactive shell in the mounted partition, with `proot`:
``` console
proot -R /mnt/img/two -q qemu-arm
```Clean up by exiting the shell started, and unmounting the disk images again:
``` console
sudo umount /mnt/img/one
sudo umount /mnt/img/two
```## Lightning Talk
Here is a short presentation that I held at [FOSS Gbg](http://foss-gbg.se/):
* [RaspianProot.pdf](RaspianProot.pdf) ([source](RaspianProot.odp))