Skip to content

Latest commit

 

History

History
84 lines (56 loc) · 2.03 KB

README.md

File metadata and controls

84 lines (56 loc) · 2.03 KB

Raspberry Pi Raspbian ARM Emulation on macOS (Intel)

This repository provides a guide and related scripts for emulating a Raspberry Pi running Raspbian OS on an Intel-based macOS system. This setup is ideal for testing Ansible playbooks for Raspberry Pi without the need for actual hardware.

📋 Table of Contents

  1. Challenges
  2. Prerequisites
  3. Installation
  4. Usage
  5. Handy Commands
  6. References

🤔 Challenges

  • Running headless Raspbian (No UI)
  • Raspbian does not provide a default login since 2022
  • QEMU setup can be complicated
  • Docker image by Luke Childs simplifies the QEMU setup but requires user configuration

🛠 Prerequisites

  • Docker
  • Vagrant
  • xz (decompression utility)

📦 Installation

  1. Pull the Docker Image

    docker pull lukechilds/dockerpi:vm
  2. Download Raspberry Pi OS Lite Image

    Download the image from Raspberry Pi OS.

  3. Decompress the Image

    xz -d 2023-02-21-raspios-bullseye-armhf-lite.img.xz
  4. Configure User Settings with Vagrant

    Use Vagrant to mount the image and set up a login user.

    vagrant up
    sudo ./firstboot.sh .....img

🚀 Usage

  1. Run the Emulated Raspbian

    docker run -it --mount type=bind,source="$(pwd)"/2023-02-21-raspios-bullseye-armhf-lite.img,target=/sdcard/filesystem.img -p 5022:5022 lukechilds/dockerpi:vm

📚 Handy Commands

  • Reconfigure SSH

    sudo dpkg-reconfigure openssh-server
  • Start SSH Service

    sudo systemctl start ssh.service
  • SSH into Emulated Pi

    ssh -p 5022 berryboot@localhost

📚 References