Skip to content

Instantly share code, notes, and snippets.

@thomasvanta
Last active January 1, 2019 16:06
Show Gist options
  • Save thomasvanta/29e26ae05237e3f87cd3eea1211145af to your computer and use it in GitHub Desktop.
Save thomasvanta/29e26ae05237e3f87cd3eea1211145af to your computer and use it in GitHub Desktop.

Revisions

  1. thomasvanta revised this gist Jan 1, 2019. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions RaspiQEMU.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ export QEMU=$(which qemu-system-arm)
    brew install wget
    ```

    ## *get stretch kernel, device tree and raspbian image*
    #### *get stretch kernel, device tree and raspbian image*
    ```
    wget https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.9.59-stretch
    export RPI_KERNEL=./kernel-qemu-4.9.59-stretch
    @@ -17,9 +17,9 @@ wget http://downloads.raspberrypi.org/raspbian/images/raspbian-2018-11-15/2018-1
    unzip 2018-11-13-raspbian-stretch.zip
    export RPI_FS=./2018-11-13-raspbian-stretch.img
    ```
    ## *Here make sure to reference the .img file in the last EXPORT and not the .zip file as per original instructions.*
    #### *Here make sure to reference the .img file in the last EXPORT and not the .zip file as per original instructions.*

    ## *Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards*
    #### *Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards*
    ```
    $QEMU \
    -kernel $RPI_KERNEL \
    @@ -30,13 +30,13 @@ $QEMU \
    -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" \
    -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw"
    ```
    ## *So at this point you should get the emulator window and a terminal you can add the following commands in.*
    #### *So at this point you should get the emulator window and a terminal you can add the following commands in.*
    ```
    sed -i -e 's/^/#/' /etc/ld.so.preload
    sed -i -e 's/^/#/' /etc/ld.so.conf
    sed -i -e 's/^/#/' /etc/fstab
    ```
    ## *Exit that and the next command will start the actual raspberry pi emulation.*
    #### *Exit that and the next command will start the actual raspberry pi emulation.*

    # *Emulate Raspberry Pi*
    ```
    @@ -49,9 +49,9 @@ $QEMU \
    -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw" \
    -net user,hostfwd=tcp::5022-:22 -net nic
    ```
    ## *Available over network with this SSH command.*
    #### *Available over network with this SSH command.*

    ## **Login to Raspberry Pi**
    #### **Login to Raspberry Pi**
    ```
    ssh -p 5022 pi@localhost
    ```
  2. thomasvanta revised this gist Jan 1, 2019. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions RaspiQEMU.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #Install QEMU OSX port with ARM support
    # Install QEMU OSX port with ARM support

    ```
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    @@ -8,7 +8,7 @@ export QEMU=$(which qemu-system-arm)
    brew install wget
    ```

    ##*get stretch kernel, device tree and raspbian image*##
    ## *get stretch kernel, device tree and raspbian image*
    ```
    wget https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.9.59-stretch
    export RPI_KERNEL=./kernel-qemu-4.9.59-stretch
    @@ -17,9 +17,9 @@ wget http://downloads.raspberrypi.org/raspbian/images/raspbian-2018-11-15/2018-1
    unzip 2018-11-13-raspbian-stretch.zip
    export RPI_FS=./2018-11-13-raspbian-stretch.img
    ```
    ##*Here make sure to reference the .img file in the last EXPORT and not the .zip file as per original instructions.*##
    ## *Here make sure to reference the .img file in the last EXPORT and not the .zip file as per original instructions.*

    ##*Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards*##
    ## *Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards*
    ```
    $QEMU \
    -kernel $RPI_KERNEL \
    @@ -30,15 +30,15 @@ $QEMU \
    -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" \
    -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw"
    ```
    ##*So at this point you should get the emulator window and a terminal you can add the following commands in.*##
    ## *So at this point you should get the emulator window and a terminal you can add the following commands in.*
    ```
    sed -i -e 's/^/#/' /etc/ld.so.preload
    sed -i -e 's/^/#/' /etc/ld.so.conf
    sed -i -e 's/^/#/' /etc/fstab
    ```
    ##*Exit that and the next command will start the actual raspberry pi emulation.*##
    ## *Exit that and the next command will start the actual raspberry pi emulation.*

    #**Emulate Raspberry Pi**#
    # *Emulate Raspberry Pi*
    ```
    $QEMU \
    -kernel $RPI_KERNEL \
    @@ -49,9 +49,9 @@ $QEMU \
    -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw" \
    -net user,hostfwd=tcp::5022-:22 -net nic
    ```
    ##*Available over network with this SSH command.*##
    ## *Available over network with this SSH command.*

    ##**Login to Raspberry Pi**##
    ## **Login to Raspberry Pi**
    ```
    ssh -p 5022 pi@localhost
    ```
  3. thomasvanta revised this gist Jan 1, 2019. 1 changed file with 17 additions and 3 deletions.
    20 changes: 17 additions & 3 deletions RaspiQEMU.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #**Install QEMU OSX port with ARM support**#
    #Install QEMU OSX port with ARM support

    ```
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    @@ -21,7 +21,14 @@ export RPI_FS=./2018-11-13-raspbian-stretch.img

    ##*Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards*##
    ```
    $QEMU -kernel $RPI_KERNEL -cpu arm1176 -m 256 -dtb versatile-pb.dtb -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw"
    $QEMU \
    -kernel $RPI_KERNEL \
    -cpu arm1176 -m 256 \
    -dtb versatile-pb.dtb \
    -M versatilepb \
    -no-reboot -serial stdio \
    -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" \
    -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw"
    ```
    ##*So at this point you should get the emulator window and a terminal you can add the following commands in.*##
    ```
    @@ -33,7 +40,14 @@ sed -i -e 's/^/#/' /etc/fstab

    #**Emulate Raspberry Pi**#
    ```
    $QEMU -kernel $RPI_KERNEL -cpu arm1176 -m 256 -dtb versatile-pb.dtb -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw" -net user,hostfwd=tcp::5022-:22 -net nic
    $QEMU \
    -kernel $RPI_KERNEL \
    -cpu arm1176 -m 256 \
    -dtb versatile-pb.dtb -M versatilepb \
    -no-reboot -serial stdio \
    -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" \
    -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw" \
    -net user,hostfwd=tcp::5022-:22 -net nic
    ```
    ##*Available over network with this SSH command.*##

  4. thomasvanta revised this gist Jan 1, 2019. 1 changed file with 22 additions and 19 deletions.
    41 changes: 22 additions & 19 deletions RaspiQEMU.md
    Original file line number Diff line number Diff line change
    @@ -1,40 +1,43 @@
    #**Install QEMU OSX port with ARM support**
    #**Install QEMU OSX port with ARM support**#

    ```
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    && brew update
    && brew install qemu
    export QEMU=$(which qemu-system-arm)
    brew install wget
    ```

    ##*get stretch kernel, device tree and raspbian image*

    ##*get stretch kernel, device tree and raspbian image*##
    ```
    wget https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.9.59-stretch
    export RPI_KERNEL=./kernel-qemu-4.9.59-stretch
    wget https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/versatile-pb.dtb
    wget http://downloads.raspberrypi.org/raspbian/images/raspbian-2018-11-15/2018-11-13-raspbian-stretch.zip
    unzip 2018-11-13-raspbian-stretch.zip
    export RPI_FS=./2018-11-13-raspbian-stretch.img
    ```
    ##*Here make sure to reference the .img file in the last EXPORT and not the .zip file as per original instructions.*##

    ##*Here make sure to reference the .img file in the last EXPORT and not the .zip file as per original instructions.*

    ##*Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards*

    ##*Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards*##
    ```
    $QEMU -kernel $RPI_KERNEL -cpu arm1176 -m 256 -dtb versatile-pb.dtb -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw"

    ##*So at this point you should get the emulator window and a terminal you can add the following commands in.*

    ```
    ##*So at this point you should get the emulator window and a terminal you can add the following commands in.*##
    ```
    sed -i -e 's/^/#/' /etc/ld.so.preload
    sed -i -e 's/^/#/' /etc/ld.so.conf
    sed -i -e 's/^/#/' /etc/fstab
    ```
    ##*Exit that and the next command will start the actual raspberry pi emulation.*##

    ##*Exit that and the next command will start the actual raspberry pi emulation.*

    #**Emulate Raspberry Pi**

    #**Emulate Raspberry Pi**#
    ```
    $QEMU -kernel $RPI_KERNEL -cpu arm1176 -m 256 -dtb versatile-pb.dtb -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw" -net user,hostfwd=tcp::5022-:22 -net nic
    ```
    ##*Available over network with this SSH command.*##

    ##*Available over network with this SSH command.*

    ##**Login to Raspberry Pi**

    ssh -p 5022 pi@localhost
    ##**Login to Raspberry Pi**##
    ```
    ssh -p 5022 pi@localhost
    ```
  5. thomasvanta revised this gist Jan 1, 2019. 1 changed file with 11 additions and 11 deletions.
    22 changes: 11 additions & 11 deletions RaspiQEMU.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    **Install QEMU OSX port with ARM support**
    #**Install QEMU OSX port with ARM support**

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    && brew update
    && brew install qemu
    export QEMU=$(which qemu-system-arm)
    && brew install qemu
    export QEMU=$(which qemu-system-arm)
    brew install wget

    *get stretch kernel, device tree and raspbian image*
    ##*get stretch kernel, device tree and raspbian image*

    wget https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.9.59-stretch
    export RPI_KERNEL=./kernel-qemu-4.9.59-stretch
    @@ -15,26 +15,26 @@ wget http://downloads.raspberrypi.org/raspbian/images/raspbian-2018-11-15/2018-1
    unzip 2018-11-13-raspbian-stretch.zip
    export RPI_FS=./2018-11-13-raspbian-stretch.img

    *Here make sure to reference the .img file in the last EXPORT and not the .zip file as per original instructions.*
    ##*Here make sure to reference the .img file in the last EXPORT and not the .zip file as per original instructions.*

    *Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards*
    ##*Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards*

    $QEMU -kernel $RPI_KERNEL -cpu arm1176 -m 256 -dtb versatile-pb.dtb -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw"

    *So at this point you should get the emulator window and a terminal you can add the following commands in.*
    ##*So at this point you should get the emulator window and a terminal you can add the following commands in.*

    sed -i -e 's/^/#/' /etc/ld.so.preload
    sed -i -e 's/^/#/' /etc/ld.so.conf
    sed -i -e 's/^/#/' /etc/fstab

    *Exit that and the next command will start the actual raspberry pi emulation.*
    ##*Exit that and the next command will start the actual raspberry pi emulation.*

    **Emulate Raspberry Pi**
    #**Emulate Raspberry Pi**

    $QEMU -kernel $RPI_KERNEL -cpu arm1176 -m 256 -dtb versatile-pb.dtb -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw" -net user,hostfwd=tcp::5022-:22 -net nic

    *Available over network with this SSH command.*
    ##*Available over network with this SSH command.*

    *Login to Raspberry Pi*
    ##**Login to Raspberry Pi**

    ssh -p 5022 pi@localhost
  6. thomasvanta revised this gist Jan 1, 2019. 1 changed file with 15 additions and 9 deletions.
    24 changes: 15 additions & 9 deletions RaspiQEMU.md
    Original file line number Diff line number Diff line change
    @@ -1,34 +1,40 @@
    **Install QEMU OSX port with ARM support**

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" && brew update && brew install qemu
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    && brew update
    && brew install qemu
    export QEMU=$(which qemu-system-arm)
    brew install wget

    //get stretch kernel, device tree and raspbian image
    *get stretch kernel, device tree and raspbian image*

    wget https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.9.59-stretch
    export RPI_KERNEL=./kernel-qemu-4.9.59-stretch
    wget https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/versatile-pb.dtb
    wget http://downloads.raspberrypi.org/raspbian/images/raspbian-2018-11-15/2018-11-13-raspbian-stretch.zip
    unzip 2018-11-13-raspbian-stretch.zip
    export RPI_FS=./2018-11-13-raspbian-stretch.img
    //Here make sure to reference the .img file in the last EXPORT and not the .zip file as per original instructions.

    //Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards
    *Here make sure to reference the .img file in the last EXPORT and not the .zip file as per original instructions.*

    *Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards*

    $QEMU -kernel $RPI_KERNEL -cpu arm1176 -m 256 -dtb versatile-pb.dtb -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw"
    //So at this point you should get the emulator window and a terminal you can add the following commands in.

    *So at this point you should get the emulator window and a terminal you can add the following commands in.*

    sed -i -e 's/^/#/' /etc/ld.so.preload
    sed -i -e 's/^/#/' /etc/ld.so.conf
    sed -i -e 's/^/#/' /etc/fstab
    //Exit that and the next command will start the actual raspberry pi emulation.

    //Emulate Raspberry Pi
    *Exit that and the next command will start the actual raspberry pi emulation.*

    **Emulate Raspberry Pi**

    $QEMU -kernel $RPI_KERNEL -cpu arm1176 -m 256 -dtb versatile-pb.dtb -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw" -net user,hostfwd=tcp::5022-:22 -net nic
    //Available over network with this SSH command.

    //Login to Raspberry Pi
    *Available over network with this SSH command.*

    *Login to Raspberry Pi*

    ssh -p 5022 pi@localhost
  7. thomasvanta created this gist Jan 1, 2019.
    34 changes: 34 additions & 0 deletions RaspiQEMU.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    **Install QEMU OSX port with ARM support**

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" && brew update && brew install qemu
    export QEMU=$(which qemu-system-arm)
    brew install wget

    //get stretch kernel, device tree and raspbian image

    wget https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.9.59-stretch
    export RPI_KERNEL=./kernel-qemu-4.9.59-stretch
    wget https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/versatile-pb.dtb
    wget http://downloads.raspberrypi.org/raspbian/images/raspbian-2018-11-15/2018-11-13-raspbian-stretch.zip
    unzip 2018-11-13-raspbian-stretch.zip
    export RPI_FS=./2018-11-13-raspbian-stretch.img
    //Here make sure to reference the .img file in the last EXPORT and not the .zip file as per original instructions.

    //Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards

    $QEMU -kernel $RPI_KERNEL -cpu arm1176 -m 256 -dtb versatile-pb.dtb -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw"
    //So at this point you should get the emulator window and a terminal you can add the following commands in.

    sed -i -e 's/^/#/' /etc/ld.so.preload
    sed -i -e 's/^/#/' /etc/ld.so.conf
    sed -i -e 's/^/#/' /etc/fstab
    //Exit that and the next command will start the actual raspberry pi emulation.

    //Emulate Raspberry Pi

    $QEMU -kernel $RPI_KERNEL -cpu arm1176 -m 256 -dtb versatile-pb.dtb -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -drive "file=2018-11-13-raspbian-stretch.img,index=0,media=disk,format=raw" -net user,hostfwd=tcp::5022-:22 -net nic
    //Available over network with this SSH command.

    //Login to Raspberry Pi

    ssh -p 5022 pi@localhost