Skip to content

Instantly share code, notes, and snippets.

@sagittarius-a
Forked from Liryna/ARMDebianUbuntu.md
Created June 2, 2017 15:43
Show Gist options
  • Save sagittarius-a/3f812e45db768fcb6b3d4320c2ed2f1e to your computer and use it in GitHub Desktop.
Save sagittarius-a/3f812e45db768fcb6b3d4320c2ed2f1e to your computer and use it in GitHub Desktop.

Revisions

  1. @Liryna Liryna renamed this gist May 13, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @Liryna Liryna renamed this gist May 13, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @Liryna Liryna revised this gist May 13, 2014. No changes.
  4. @Liryna Liryna revised this gist Apr 15, 2014. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -207,6 +207,16 @@ Linux cis-linux-arm 2.6.32 #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 armv7l GNU

    N.B: After test, qemu 1.1 (Debian wheezy) had some strange behaviour but the 1.5 (Ubuntu saucy) was working perfectly !

    When you finished your work you should unmount everything to avert bad behaviour.
    Do not forget to not start your VM with Qemu before unmount everything !
    ```
    sudo umount /mnt/arm-vm/proc
    sudo umount /mnt/arm-vm/dev
    sudo umount /mnt/arm-vm/sys
    sudo umount /mnt/arm-vm
    sudo kpartx -d -v armdisk.img
    ```

    ##### References

    [1] http://www.linuxforu.com/2011/05/quick-quide-to-qemu-setup/
  5. @Liryna Liryna revised this gist Apr 15, 2014. 1 changed file with 46 additions and 0 deletions.
    46 changes: 46 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -163,9 +163,55 @@ qemu-system-arm .... -redir tcp:5555::22 &

    Then you can connect to SSH just like `ssh -p 5555 localhost`.

    #### Chroot Voodoo your ARM VM (architectural chroot with QEMU)

    After the install of your ARM, you will probably see that it is really slow.
    To speed up your arm, you can chroot it natively and let `qemu-user-static` interpret the ARM instruction. [5]
    ```
    sudo apt-get install qemu-user-static kpartx
    ```

    We mount the image using loopback
    ```
    sudo kpartx -a -v armdisk.img
    sudo mkdir /mnt/arm-vm
    sudo mount /dev/mapper/loop0p2 /mnt/arm-vm
    ```

    Copy the static binary
    ```
    sudo cp /usr/bin/qemu-arm-static /mnt/arm-vm/usr/bin
    sudo mount -o bind /proc /mnt/arm-vm/proc
    sudo mount -o bind /dev /mnt/temp/dev
    sudo mount -o bind /sys /mnt/temp/sys
    ```

    We register `qemu-arm-static` as ARM interpreter to the kernel linux. [6]
    ```
    #This can only be run as root (sudo don't work)
    sudo su
    echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register
    exit
    ```

    Now we chroot to our VM.
    ```
    sudo chroot /mnt/arm-vm
    ```

    Let see if it work:
    ```
    $ uname -a
    Linux cis-linux-arm 2.6.32 #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 armv7l GNU/Linux
    ```

    N.B: After test, qemu 1.1 (Debian wheezy) had some strange behaviour but the 1.5 (Ubuntu saucy) was working perfectly !

    ##### References

    [1] http://www.linuxforu.com/2011/05/quick-quide-to-qemu-setup/
    [2] http://blog.troyastle.com/2010/07/building-arm-powered-debian-vm-with.html
    [3] [Differences between ARM926, ARM1136, A8 and A9](http://processors.wiki.ti.com/index.php/Feature_Comparison:_ARM_926,_1136_and_Cortex-A8)
    [4] http://www.makestuff.eu/wordpress/running-debian-for-arm-powerpc-on-qemu/
    [5] http://www.darrinhodges.com/chroot-voodoo/
    [6] https://en.wikipedia.org/wiki/Binfmt_misc
  6. @bdsatish bdsatish revised this gist Feb 15, 2014. 1 changed file with 12 additions and 2 deletions.
    14 changes: 12 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -18,15 +18,25 @@ Then compile your programs in amd64 directly:
    cat > hello.c << EOF
    #include <stdio.h>
    int main(void) { return printf("Hello ARM!"); }
    int main(void) { return printf("Hello ARM!\n"); }
    EOF
    arm-linux-gnueabihf-gcc hello.c -ohello
    arm-linux-gnueabihf-gcc -static -ohello hello.c
    file hello
    hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked,
    ./hello
    Hello ARM!
    ```

    If you want a dynamically-linked executable, you've to pass the linker path too:
    ```
    arm-linux-gnueabihf-gcc -ohello hello.c
    qemu-arm -L /usr/arm-linux-gnueabihf/ ./hello # or qemu-arm-static
    ```

    [Debugging using GDB](http://ubuntuforums.org/showthread.php?t=2010979&s=096fb05dbd59acbfc8542b71f4b590db&p=12061325#post12061325)

    ### Install QEMU
    ```
  7. @bdsatish bdsatish revised this gist Feb 15, 2014. 1 changed file with 26 additions and 0 deletions.
    26 changes: 26 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,32 @@ You might want to read [this](http://www.memetic.org/raspbian-benchmarking-armel

    If the below is too much, you can try [Ubuntu-ARMv7-Qemu](https://wiki.ubuntu.com/Kernel/Dev/QemuARMVexpress) but note it contains non-free blobs.


    ### Running ARM programs under linux (without starting QEMU VM!)

    First, cross-compile user programs with GCC-ARM toolchain. Then install ``qemu-arm-static`` so that you can run ARM executables directly on linux


    ```
    # armel packages also exist
    sudo apt-get install gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-arm-static
    ```

    Then compile your programs in amd64 directly:
    ```
    cat > hello.c << EOF
    #include <stdio.h>
    int main(void) { return printf("Hello ARM!"); }
    EOF
    arm-linux-gnueabihf-gcc hello.c -ohello
    ./hello
    Hello ARM!
    ```


    ### Install QEMU
    ```
    sudo apt-get install qemu
  8. @bdsatish bdsatish revised this gist Nov 16, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -117,7 +117,9 @@ Once again, note the device (`mmcblk0p1`) and partition (`armhf.img`) reflect SD

    #### Connecting to the SSH server

    Just redirect some random port on the host to guest's port 22
    Login to the guest OS and create a private/public key pair: `ssh-keygen -t rsa`.

    On the host, just redirect some random port from the host to guest's port 22 (or whichever port the SSH server is running on, see /etc/ssh/sshd_config)

    ```
    qemu-system-arm .... -redir tcp:5555::22 &
  9. @bdsatish bdsatish revised this gist Nov 16, 2013. 1 changed file with 11 additions and 7 deletions.
    18 changes: 11 additions & 7 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -47,13 +47,8 @@ qemu-system-arm -m 1024M -sd armdisk.img \

    Specifying `-cpu` is optional. It defaults to `-cpu=any`. However, `-M` is mandatory.

    This will start a new QEMU window and the Debian installer will kick-in. Just proceed with the installation (takes maybe 3 hours or so).
    This will start a new QEMU window and the Debian installer will kick-in. Just proceed with the installation (takes maybe 3 hours or so). Make sure you install "ssh-server" in tasksel screen.

    You can start your virtual machine after the installation complete as follows:
    ```
    qemu -m 1024 -hda armdisk.img
    ```

    NOTE: For creating ARMv6, just pass `versatilepb`:

    @@ -113,13 +108,22 @@ Extract & copy the boot files exactly as before (but for armhf.img) and pass whi
    qemu-system-arm -m 1024M -M vexpress-a9 \
    -kernel armhf-extracted/vmlinuz-3.2.0-4-vexpress \
    -initrd armhf-extracted/initrd.img-3.2.0-4-vexpress \
    -append "root=/dev/mmcblk0p1" -sd armhf.img
    -append "root=/dev/mmcblk0p1" -sd armhf.img
    ```

    Once again, note the device (`mmcblk0p1`) and partition (`armhf.img`) reflect SD-card usage.


    #### Connecting to the SSH server

    Just redirect some random port on the host to guest's port 22

    ```
    qemu-system-arm .... -redir tcp:5555::22 &
    ```

    Then you can connect to SSH just like `ssh -p 5555 localhost`.

    ##### References

  10. @bdsatish bdsatish revised this gist Nov 16, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    You might want to read [this](http://www.memetic.org/raspbian-benchmarking-armel-vs-armhf/) to get an introduction to armel vs armhf.

    If the below is too much, you can try [Ubuntu-ARMv7-Qemu](https://wiki.ubuntu.com/Kernel/Dev/QemuARMVexpress) but note it contains non-free blobs.

    ### Install QEMU
    ```
  11. @bdsatish bdsatish revised this gist Nov 16, 2013. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -72,12 +72,6 @@ Download netboot ISO for [armhf](http://cdimage.debian.org/debian-cd/7.2.0/armhf
    WAIT! Apparently, these Debian CD images are not bootable! But Ubuntu's ARM CD image works [2].



    [1] http://www.linuxforu.com/2011/05/quick-quide-to-qemu-setup/
    [2] http://blog.troyastle.com/2010/07/building-arm-powered-debian-vm-with.html
    [3] [Differences between ARM926, ARM1136, A8 and A9](http://processors.wiki.ti.com/index.php/Feature_Comparison:_ARM_926,_1136_and_Cortex-A8)


    ### First boot from newly installed system

    You need to copy vmlinuz from the installed disk image and pass it again to qemu-system-img [Qemu wiki]
    @@ -126,3 +120,9 @@ Once again, note the device (`mmcblk0p1`) and partition (`armhf.img`) reflect SD



    ##### References

    [1] http://www.linuxforu.com/2011/05/quick-quide-to-qemu-setup/
    [2] http://blog.troyastle.com/2010/07/building-arm-powered-debian-vm-with.html
    [3] [Differences between ARM926, ARM1136, A8 and A9](http://processors.wiki.ti.com/index.php/Feature_Comparison:_ARM_926,_1136_and_Cortex-A8)
    [4] http://www.makestuff.eu/wordpress/running-debian-for-arm-powerpc-on-qemu/
  12. @bdsatish bdsatish revised this gist Nov 16, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -121,7 +121,8 @@ qemu-system-arm -m 1024M -M vexpress-a9 \
    -append "root=/dev/mmcblk0p1" -sd armhf.img
    ```
    Once again, note the device and partition reflect SD-card usage.

    Once again, note the device (`mmcblk0p1`) and partition (`armhf.img`) reflect SD-card usage.



  13. @bdsatish bdsatish revised this gist Nov 16, 2013. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -110,7 +110,18 @@ qemu-system-arm -M versatilepb -m 1024M \

    And there you go, play with ARM to your heart's extent!

    #### For armhf

    Extract & copy the boot files exactly as before (but for armhf.img) and pass while invoking:

    ```
    qemu-system-arm -m 1024M -M vexpress-a9 \
    -kernel armhf-extracted/vmlinuz-3.2.0-4-vexpress \
    -initrd armhf-extracted/initrd.img-3.2.0-4-vexpress \
    -append "root=/dev/mmcblk0p1" -sd armhf.img
    ```
    Once again, note the device and partition reflect SD-card usage.



  14. @bdsatish bdsatish revised this gist Nov 15, 2013. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -91,7 +91,12 @@ sudo qemu-nbd -c /dev/nbd0 armel.img
    mkdir ~/qemu-mounted
    sudo mount /dev/nbd0p1 ~/qemu-mounted
    mkdir after-copy
    cp ~/qemu-mounted/boot/* after-copy/
    sudo umount ~/qemu-mounted
    sudo qemu-nbd -d /dev/nbd0
    sudo killall qemu-nbd
    ```

    Then pass the copied kernel and initrd to qemu-system-img. Also note that we are now booting from `/dev/sda1` because that is where Linux was installed
  15. @bdsatish bdsatish revised this gist Nov 15, 2013. 1 changed file with 32 additions and 0 deletions.
    32 changes: 32 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -77,3 +77,35 @@ WAIT! Apparently, these Debian CD images are not bootable! But Ubuntu's ARM CD i
    [2] http://blog.troyastle.com/2010/07/building-arm-powered-debian-vm-with.html
    [3] [Differences between ARM926, ARM1136, A8 and A9](http://processors.wiki.ti.com/index.php/Feature_Comparison:_ARM_926,_1136_and_Cortex-A8)


    ### First boot from newly installed system

    You need to copy vmlinuz from the installed disk image and pass it again to qemu-system-img [Qemu wiki]
    (http://en.wikibooks.org/wiki/QEMU/Images#Mounting_an_image_on_the_host").

    #### For armel

    ```
    sudo modprobe nbd max_part=16
    sudo qemu-nbd -c /dev/nbd0 armel.img
    mkdir ~/qemu-mounted
    sudo mount /dev/nbd0p1 ~/qemu-mounted
    mkdir after-copy
    cp ~/qemu-mounted/boot/* after-copy/
    ```

    Then pass the copied kernel and initrd to qemu-system-img. Also note that we are now booting from `/dev/sda1` because that is where Linux was installed

    ```
    qemu-system-arm -M versatilepb -m 1024M \
    -kernel after-copy/vmlinuz-3.2.0-4-versatile \
    -initrd after-copy/initrd.img-3.2.0-4-versatile \
    -hda armel.img -append "root=/dev/sda1"
    ```

    And there you go, play with ARM to your heart's extent!





  16. @bdsatish bdsatish revised this gist Nov 15, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -35,10 +35,10 @@ You can emulate ARMv6 which Debian calls as `armel` by downloading the correspon
    Note that you need `armel` for ARMv5, v6. Raspberry Pi uses ARMv6. In this case, the cpu is `arm1176` and machine is `versatilepb`.


    Create a virtual machine with 1024 MB RAM and a Cortex-A9 CPU.
    Create a virtual machine with 1024 MB RAM and a Cortex-A9 CPU. Note that we must `-sd` instead of `-sda` because vexpress kernel doesn't support PCI SCSI hard disks. You'll install Debian on on MMC/SD card, that's all it means.

    ```
    qemu-system-arm -m 1024M -hda armdisk.img \
    qemu-system-arm -m 1024M -sd armdisk.img \
    -M vexpress-a9 -cpu cortex-a9 \
    -kernel vmlinuz-3.2.0-4-vexpress -initrd initrd.gz \
    -append "root=/dev/ram" -no-reboot
  17. @bdsatish bdsatish revised this gist Nov 15, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,7 @@ Create a virtual machine with 1024 MB RAM and a Cortex-A9 CPU.
    qemu-system-arm -m 1024M -hda armdisk.img \
    -M vexpress-a9 -cpu cortex-a9 \
    -kernel vmlinuz-3.2.0-4-vexpress -initrd initrd.gz \
    -append "root=/dev/ram"
    -append "root=/dev/ram" -no-reboot
    ```

    Specifying `-cpu` is optional. It defaults to `-cpu=any`. However, `-M` is mandatory.
    @@ -59,7 +59,7 @@ NOTE: For creating ARMv6, just pass `versatilepb`:
    ```
    qemu-system-arm -m 1024M -M versatilepb \
    -kernel vmlinuz-3.2.0-4-versatile -initrd initrd.gz \
    -append "root=/dev/ram" -hda armdisk.img
    -append "root=/dev/ram" -hda armdisk.img -no-reboot
    ```


  18. @bdsatish bdsatish revised this gist Nov 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@ In this example, I chose the `cortex-a9` CPU and `vexpress-a9` machine. This is


    You can emulate ARMv6 which Debian calls as `armel` by downloading the corresponding files for [Wheezy armel netboot](http://ftp.debian.org/debian/dists/wheezy/main/installer-armel/current/images/versatile/netboot/).
    Note that you need `armel` for ARMv5, v6. Raspberry Pi uses ARMv6. In this case, the cpu is `arm1126` and machine is `versatilepb`.
    Note that you need `armel` for ARMv5, v6. Raspberry Pi uses ARMv6. In this case, the cpu is `arm1176` and machine is `versatilepb`.


    Create a virtual machine with 1024 MB RAM and a Cortex-A9 CPU.
  19. @bdsatish bdsatish revised this gist Nov 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@ In this example, I chose the `cortex-a9` CPU and `vexpress-a9` machine. This is


    You can emulate ARMv6 which Debian calls as `armel` by downloading the corresponding files for [Wheezy armel netboot](http://ftp.debian.org/debian/dists/wheezy/main/installer-armel/current/images/versatile/netboot/).
    Note that you need `armel` for ARMv5, v6. Raspberry Pi uses ARMv6. In this case, the cpu is `arm926` and machine is `versatilepb`.
    Note that you need `armel` for ARMv5, v6. Raspberry Pi uses ARMv6. In this case, the cpu is `arm1126` and machine is `versatilepb`.


    Create a virtual machine with 1024 MB RAM and a Cortex-A9 CPU.
  20. @bdsatish bdsatish revised this gist Nov 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ You can emulate ARMv6 which Debian calls as `armel` by downloading the correspon
    Note that you need `armel` for ARMv5, v6. Raspberry Pi uses ARMv6. In this case, the cpu is `arm926` and machine is `versatilepb`.


    Create a virtual machine with 1024 MB RAM and a Cortex-A9 CPU:
    Create a virtual machine with 1024 MB RAM and a Cortex-A9 CPU.

    ```
    qemu-system-arm -m 1024M -hda armdisk.img \
  21. @bdsatish bdsatish revised this gist Nov 15, 2013. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    You might want to read [this](http://www.memetic.org/raspbian-benchmarking-armel-vs-armhf/) to get an introduction to armel vs armhf.


    ### Install QEMU
    ```
    sudo apt-get install qemu
  22. @bdsatish bdsatish revised this gist Nov 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ In this example, I chose the `cortex-a9` CPU and `vexpress-a9` machine. This is


    You can emulate ARMv6 which Debian calls as `armel` by downloading the corresponding files for [Wheezy armel netboot](http://ftp.debian.org/debian/dists/wheezy/main/installer-armel/current/images/versatile/netboot/).
    Note that you need 'armel' for ARM v5, v6. Raspberry Pi uses ARMv6. In this case, the cpu is `arm926` and machine is `versatilepb`.
    Note that you need `armel` for ARMv5, v6. Raspberry Pi uses ARMv6. In this case, the cpu is `arm926` and machine is `versatilepb`.


    Create a virtual machine with 1024 MB RAM and a Cortex-A9 CPU:
  23. @bdsatish bdsatish revised this gist Nov 15, 2013. 1 changed file with 28 additions and 5 deletions.
    33 changes: 28 additions & 5 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -4,9 +4,9 @@ sudo apt-get install qemu
    ```

    ### Create a hard disk
    Create a hard disk for your virtual machine
    Create a hard disk for your virtual machine with required capacity.
    ```
    qemu-img create -f raw armdisk-cortex-a9.img 8G
    qemu-img create -f raw armdisk.img 8G
    ```

    You can then install Debian using an ISO CD or directly from vmlinuz
    @@ -29,15 +29,37 @@ In this example, I chose the `cortex-a9` CPU and `vexpress-a9` machine. This is


    You can emulate ARMv6 which Debian calls as `armel` by downloading the corresponding files for [Wheezy armel netboot](http://ftp.debian.org/debian/dists/wheezy/main/installer-armel/current/images/versatile/netboot/).
    Note that you need 'armel' for ARM v5, v6 and 'armhf' for ARM v7. Raspberry Pi used ARMv6. In this case, the cpu is ``
    Note that you need 'armel' for ARM v5, v6. Raspberry Pi uses ARMv6. In this case, the cpu is `arm926` and machine is `versatilepb`.


    Start a virtual machine with 1024 MB RAM and a Cortex-A9 CPU.
    Create a virtual machine with 1024 MB RAM and a Cortex-A9 CPU:

    ```
    qemu-system-arm -m 1024M -cpu cortex-a9 -M versatilepb -kernel vmlinuz-3.2.0-4-versatile -initrd initrd.gz -hda armdisk-cortex-a9.img -append "root=/dev/ram"
    qemu-system-arm -m 1024M -hda armdisk.img \
    -M vexpress-a9 -cpu cortex-a9 \
    -kernel vmlinuz-3.2.0-4-vexpress -initrd initrd.gz \
    -append "root=/dev/ram"
    ```

    Specifying `-cpu` is optional. It defaults to `-cpu=any`. However, `-M` is mandatory.

    This will start a new QEMU window and the Debian installer will kick-in. Just proceed with the installation (takes maybe 3 hours or so).

    You can start your virtual machine after the installation complete as follows:
    ```
    qemu -m 1024 -hda armdisk.img
    ```

    NOTE: For creating ARMv6, just pass `versatilepb`:

    ```
    qemu-system-arm -m 1024M -M versatilepb \
    -kernel vmlinuz-3.2.0-4-versatile -initrd initrd.gz \
    -append "root=/dev/ram" -hda armdisk.img
    ```


    ### Netboot from ISO


    @@ -50,4 +72,5 @@ WAIT! Apparently, these Debian CD images are not bootable! But Ubuntu's ARM CD i

    [1] http://www.linuxforu.com/2011/05/quick-quide-to-qemu-setup/
    [2] http://blog.troyastle.com/2010/07/building-arm-powered-debian-vm-with.html
    [3] [Differences between ARM926, ARM1136, A8 and A9](http://processors.wiki.ti.com/index.php/Feature_Comparison:_ARM_926,_1136_and_Cortex-A8)

  24. @bdsatish bdsatish revised this gist Nov 15, 2013. 1 changed file with 20 additions and 4 deletions.
    24 changes: 20 additions & 4 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -13,8 +13,23 @@ You can then install Debian using an ISO CD or directly from vmlinuz

    ### Netboot from vmlinuz

    Download vmlinuz and initrd from [Wheezy netboot](http://ftp.debian.org/debian/dists/wheezy/main/installer-armhf/current/images/vexpress/netboot/). Note that you need 'armel' for ARM v5, v6 and 'armhf' for ARM v7.
    Cortex-A8, A9, A15 are all ARMv7 CPUs.
    First, you should decide what CPU and machine type you want to emulate.

    You can get a list of all supported CPUs (to be passed with `-cpu` option, see later below):
    ```
    qemu-system-arm -cpu help
    ```

    You can get a list of all supported machines (to be passed with `-M` option, see later below):
    ```
    qemu-system-arm -machine help
    ```

    In this example, I chose the `cortex-a9` CPU and `vexpress-a9` machine. This is an ARMv7 CPU which Debian calls as `armhf` (ARM hard float). You must download vmlinuz and initrd files for, say [Wheezy armhf netboot](http://ftp.debian.org/debian/dists/wheezy/main/installer-armhf/current/images/vexpress/netboot/). Cortex-A8, A9, A15 are all ARMv7 CPUs.


    You can emulate ARMv6 which Debian calls as `armel` by downloading the corresponding files for [Wheezy armel netboot](http://ftp.debian.org/debian/dists/wheezy/main/installer-armel/current/images/versatile/netboot/).
    Note that you need 'armel' for ARM v5, v6 and 'armhf' for ARM v7. Raspberry Pi used ARMv6. In this case, the cpu is ``


    Start a virtual machine with 1024 MB RAM and a Cortex-A9 CPU.
    @@ -25,11 +40,12 @@ qemu-system-arm -m 1024M -cpu cortex-a9 -M versatilepb -kernel vmlinuz-3.2.0-4-

    ### Netboot from ISO


    Download netboot ISO for [armhf](http://cdimage.debian.org/debian-cd/7.2.0/armhf/iso-cd/) or [armel](http://cdimage.debian.org/debian-cd/7.2.0/armel/iso-cd/) as needed.

    ```

    ```
    WAIT! Apparently, these Debian CD images are not bootable! But Ubuntu's ARM CD image works [2].



    [1] http://www.linuxforu.com/2011/05/quick-quide-to-qemu-setup/
  25. @bdsatish bdsatish revised this gist Nov 14, 2013. 1 changed file with 25 additions and 4 deletions.
    29 changes: 25 additions & 4 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,37 @@
    ### Install QEMU
    ```
    sudo apt-get install qemu
    ```

    ### Create a hard disk
    Create a hard disk for your virtual machine
    ```
    qemu-img create -f raw armdisk-cortex-a9.img 8G
    ```

    You can then install Debian using an ISO CD or directly from vmlinuz

    ### Netboot from vmlinuz

    Download vmlinuz and initrd from [Wheezy netboot](http://ftp.debian.org/debian/dists/wheezy/main/installer-armhf/current/images/vexpress/netboot/). Note that you need 'armel' for ARM v5, v6 and 'armhf' for ARM v7.
    Cortex-A8, A9, A15 are all ARMv7 CPUs.

    Create a hard disk for your virtual machine

    Start a virtual machine with 1024 MB RAM and a Cortex-A9 CPU.

    ```
    qemu-img create -f raw armdisk-cortex-a9.img 8G
    qemu-system-arm -m 1024M -cpu cortex-a9 -M versatilepb -kernel vmlinuz-3.2.0-4-versatile -initrd initrd.gz -hda armdisk-cortex-a9.img -append "root=/dev/ram"
    ```

    Start a virtual machine with 1024 MB RAM and a Cortex-A9 CPU.
    ### Netboot from ISO

    Download netboot ISO for [armhf](http://cdimage.debian.org/debian-cd/7.2.0/armhf/iso-cd/) or [armel](http://cdimage.debian.org/debian-cd/7.2.0/armel/iso-cd/) as needed.

    ```
    ```


    [1] http://www.linuxforu.com/2011/05/quick-quide-to-qemu-setup/
    [2] http://blog.troyastle.com/2010/07/building-arm-powered-debian-vm-with.html

    qemu-system-arm -m 1024M -cpu cortex-a9 -M versatilepb -kernel vmlinuz-3.2.0-4-versatile -initrd initrd.gz -hda armdisk-cortex-a9.img -append "root=/dev/ram"
  26. @bdsatish bdsatish created this gist Nov 14, 2013.
    16 changes: 16 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    ```
    sudo apt-get install qemu
    ```

    Download vmlinuz and initrd from [Wheezy netboot](http://ftp.debian.org/debian/dists/wheezy/main/installer-armhf/current/images/vexpress/netboot/). Note that you need 'armel' for ARM v5, v6 and 'armhf' for ARM v7.
    Cortex-A8, A9, A15 are all ARMv7 CPUs.

    Create a hard disk for your virtual machine
    ```
    qemu-img create -f raw armdisk-cortex-a9.img 8G
    ```

    Start a virtual machine with 1024 MB RAM and a Cortex-A9 CPU.

    qemu-system-arm -m 1024M -cpu cortex-a9 -M versatilepb -kernel vmlinuz-3.2.0-4-versatile -initrd initrd.gz -hda armdisk-cortex-a9.img -append "root=/dev/ram"