🖥️

Setting Up Virtualization with Raspberry Pi

Aug 20, 2024

Lecture Notes on Virtualization and Raspberry Pi Setup

Introduction

  • Focus on setting up virtual environments using VirtualBox, VMware, and QEMU.
  • Discussion on setting up a Raspberry Pi OS in a virtual environment.

Initial Instructions

  • Links provided for necessary downloads.
  • Importance of internet speed for downloads emphasized.

Virtual Environment Setup

  • VirtualBox Method: Issues with Raspberry Pi crashing at start.
  • QEMU: Suitable for Linux users, problematic for Windows users.
  • VMware: Download and install VMware workstation for Windows/Linux.
    • Download Raspberry Pi OS (Bullseye version, ~3GB).

Raspberry Pi Installation

  • VM configuration with VMware.
    • Importance of selecting Linux as the guest operating system.
    • Debian 11 x64 recommended.
  • Allocation of minimum 20GB storage.
  • Install Raspberry Pi OS and set up user credentials.

Configuration and Troubleshooting

  • Network setup: Use NAT for shared host IP address.
  • SSH setup for remote access to the virtual Raspberry Pi.
  • Installation of necessary packages like MQTT broker (Mosquitto).

Commands and Configuration

  • Updating and Installing Packages:
    • sudo apt update
    • sudo apt upgrade
    • sudo apt install mosquitto
  • Enabling Mosquitto service: sudo systemctl enable mosquitto.service
  • Configuration file located at etc/mosquitto/conf.d/default.conf
    • Add listener 1883, protocol mqtt, allow_anonymous true

MQTT Setup

  • Raspberry Pi as MQTT broker.
  • Virtual devices (Python scripts) simulating sensors.
  • Gateway on Raspberry Pi, devices on Windows PC.

Troubleshooting

  • Network issues: Ensure correct network adapter settings.
  • Verification of Mosquitto running using ps aux | grep mosquitto.

Notes on Real-World Application

  • Emphasis on data generation by IoT devices for AI and machine learning applications.
  • Practical application of IoT in smart environments.

Next Steps

  • Implementation of a cloud server to receive data from the Gateway.
  • Creation of a small UI for data visualization.

Conclusion

  • Summary of setup process and configurations.
  • Encouragement to experiment and troubleshoot using provided instructions.