This is a little guide to emulate the Raspbian operating system for ARM on QEMU with network connectivity.

I found most resources on this outdated, relying on broken links, and lacking the steps for network access, so I reviewed them and streamlined the process.

Long story short

If you haven’t yet, install QEMU on your system. On my Arch machine this means

sudo pacman -S qemu qemu-arch-extra bridge-utils 1 sudo pacman -S qemu qemu-arch-extra bridge-utils

on Debian based

sudo apt-get install kvm qemu bridge-utils 1 sudo apt-get install kvm qemu bridge-utils

Then, clone my qemu-raspbian-network repository, download a raspbian image and launch qemu-pi.sh

git clone https://github.com/nachoparker/qemu-raspbian-network.git cd qemu-raspbian-network wget https://downloads.raspberrypi.org/raspbian_lite_latest -O raspbian_lite_latest.zip unzip rasbian_lite_latest.zip sudo ./qemu-pi.sh 2017-01-11-raspbian-jessie-lite.img # correct to real name 1 2 3 4 5 git clone https://github.com/nachoparker/qemu-raspbian-network.git cd qemu-raspbian-network wget https://downloads.raspberrypi.org/raspbian_lite_latest -O raspbian_lite_latest.zip unzip rasbian_lite_latest.zip sudo ./qemu-pi.sh 2017-01-11-raspbian-jessie-lite.img # correct to real name

If you want network access, edit qemu-pi.sh line 30 and set

NO_NETWORK=0 1 NO_NETWORK=0

If you do this, the script will setup a bridge called br0 on your enp3s0 interface, and restore your routes after QEMU exits. If you want to modify this behaviour, change the relevant lines in the script.

NO_NETWORK=1 # set to 1 to skip network configuration IFACE=enp3s0 # interface that we currently use for internet BRIDGE=br0 # name for the bridge we will create to share network with the raspbian img 1 2 3 NO_NETWORK=1 # set to 1 to skip network configuration IFACE=enp3s0 # interface that we currently use for internet BRIDGE=br0 # name for the bridge we will create to share network with the raspbian img

Now your Raspbian image will have network connectivity, so you can SSH to it, and apt-get from it.

For QEMU to have access to the network bridge configuration, this needs to be in /etc/sudoers . Access with sudo visudo.

Cmnd_Alias QEMU=/usr/bin/ip,/usr/bin/modprobe,/usr/bin/brctl %kvm ALL=NOPASSWD: QEMU 1 2 Cmnd_Alias QEMU=/usr/bin/ip,/usr/bin/modprobe,/usr/bin/brctl %kvm ALL=NOPASSWD: QEMU

If you ever need more disk space, you can

qemu-img resize 2017-01-11-raspbian-jessie-lite.img +2G 1 qemu-img resize 2017-01-11-raspbian-jessie-lite.img +2G

When you are done modifying the image, you can dd it to an SD card and run it directly on a Raspberry Pi.

Remember to use <CTRL><ALT>g in order to regain mouse control on QEMU.

Long story long

The Raspbian operating system is a Debian based GNU/Linux distribution that targets the Raspberry Pi board.

It can be convenient to play around with the OS without the need for a Rasberry Pi or an SD card. For this, we want to run it on the QEMU virtual machine.

The original Raspberry Pi has an ARM11 (ARMv6) processor, RPi2 has an ARM Cortex-A7, and RPi3 has an ARM Cortex-A53. I recommend going easy for the arm1136 or arm1176 . To see what your qemu-system-arm can emulate run

$ qemu-arm -cpu help Available CPUs: arm1026 arm1136 arm1136-r2 arm1176 arm11mpcore arm926 arm946 cortex-a15 cortex-a7 cortex-a8 cortex-a9 cortex-m3 cortex-m4 cortex-r5 pxa250 pxa255 pxa260 pxa261 pxa262 pxa270-a0 pxa270-a1 pxa270 pxa270-b0 pxa270-b1 pxa270-c0 pxa270-c5 sa1100 sa1110 ti925t any 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 $ qemu-arm -cpu help Available CPUs: arm1026 arm1136 arm1136-r2 arm1176 arm11mpcore arm926 arm946 cortex-a15 cortex-a7 cortex-a8 cortex-a9 cortex-m3 cortex-m4 cortex-r5 pxa250 pxa255 pxa260 pxa261 pxa262 pxa270-a0 pxa270-a1 pxa270 pxa270-b0 pxa270-b1 pxa270-c0 pxa270-c5 sa1100 sa1110 ti925t any

The problem is that the kernel that ships with Raspbian is taylored for the Raspberry Pi board, which is not supported by QEMU.

For this reason, the kernel needs to be patched and cross-compiled in order to be run on the ARM Versatile development board, which is supported by QEMU. I included a modified kernel 4.4.34 is in my repo.

After this, it is a matter of invoking qemu with the -kernel option to replace the one that comes with Raspbian, and the -M versatilepb option to specify the emulated hardware.

Then, we are only left with the task of interfacing the block devices that raspbian expects, which are of the form mmcblk0 to what it will receive from the QEMU virtual block device, which come on the form sda . That is what the following lines of the script do

cat > tmpmnt/etc/udev/rules.d/90-qemu.rules <<EOF KERNEL=="sda", SYMLINK+="mmcblk0" KERNEL=="sda?", SYMLINK+="mmcblk0p%n" KERNEL=="sda2", SYMLINK+="root" EOF 1 2 3 4 5 cat > tmpmnt/etc/udev/rules.d/90-qemu.rules <<EOF KERNEL=="sda", SYMLINK+="mmcblk0" KERNEL=="sda?", SYMLINK+="mmcblk0p%n" KERNEL=="sda2", SYMLINK+="root" EOF

In order to achieve network connectivity, it is common to use TUNTAP with QEMU.

TUNTAP creates a virtual network interface that can be accesed by a hypervisor. All packets sent to this virtual interface will appear on the hypervisor’s network stack and viceversa, allowing communication with the virtual machine through the regular network interface.

Therefore, we will include both the real interface and the TUNTAP interface on a network bridge, which will cause any packet sent to the bridge from outside to appear on both interfaces, and any packet sent from inside will appear as if it originates on the bridge.

QEMU requires hooks on /etc/qemu-ifup and /etc/qemu-ifdown to manage the TUNTAP interface, which is dealt with by the following lines taken from the Arch wiki.

cat > /etc/qemu-ifup <<EOF #!/bin/sh echo "Executing /etc/qemu-ifup" echo "Bringing up \$1 for bridged mode..." sudo /usr/bin/ip link set \$1 up promisc on echo "Adding \$1 to $BRIDGE..." sudo /usr/bin/brctl addif $BRIDGE \$1 sleep 2 EOF cat > /etc/qemu-ifdown <<EOF #!/bin/sh echo "Executing /etc/qemu-ifdown" sudo /usr/bin/ip link set \$1 down sudo /usr/bin/brctl delif $BRIDGE \$1 sudo /usr/bin/ip link delete dev \$1 EOF 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 cat > /etc/qemu-ifup <<EOF #!/bin/sh echo "Executing /etc/qemu-ifup" echo "Bringing up \$1 for bridged mode..." sudo /usr/bin/ip link set \$1 up promisc on echo "Adding \$1 to $BRIDGE..." sudo /usr/bin/brctl addif $BRIDGE \$1 sleep 2 EOF cat > /etc/qemu-ifdown <<EOF #!/bin/sh echo "Executing /etc/qemu-ifdown" sudo /usr/bin/ip link set \$1 down sudo /usr/bin/brctl delif $BRIDGE \$1 sudo /usr/bin/ip link delete dev \$1 EOF

Cross-compile or get a newer kernel

The first ones to share this work as far as I know were Xecdesign, for the 3.10.25 kernel. At some point, their website went down, so Dhruv Vyas rescued the kernel patches and has been providing newer kernels as well as cross-compiling instructions on his github.

Code

#!/bin/bash # Run a raspbian image in qemu with network access # Tested with 2017-01-11-raspbian-jessie.img (and lite) # # Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com> # GPL licensed (see end of file) * Use at your own risk! # # Usage: # qemu-pi.sh 2017-01-11-raspbian-jessie.img # or any other image # # Notes: # If NO_NETWORK=0 it will include your network interface on a bridge # with the same gateway and routes, and restore it when exiting qemu # # If NO_NETWORK=1 (default), that configuration will have to be done manually # in order to obtain network access inside raspbian # # It requires a modified kernel image for qemu. (variable $KERNEL) # # It enables SSH on the image # # For the network bridge configuration, this needs to be in /etc/sudoers # Cmnd_Alias QEMU=/usr/bin/ip,/usr/bin/modprobe,/usr/bin/brctl # %kvm ALL=NOPASSWD: QEMU IMG=$1 KERNEL=kernel-qemu-4.4.34-jessie NO_NETWORK=1 # set to 1 to skip network configuration BRIDGE=br0 # name for the bridge we will create to share network with the raspbian img MAC='52:54:be:36:42:a9' # comment this line for random MAC (maybe annoying if on DHCP) BINARY_PATH=/usr/bin # path prefix for binaries NO_GRAPHIC=0 # set to 1 to start in no graphic mode # sanity checks type qemu-system-arm &>/dev/null || { echo "QEMU ARM not found" ; exit 1; } test -f $IMG && test -f $KERNEL || { echo "$IMG or $KERNEL not found"; exit 1; } IFACE="$( ip r | grep "default via" | awk '{ print $5 }' | head -1 )" [[ "$IFACE" == "" ]] || [[ "$BRIDGE" == "" ]] && NO_NETWORK=1 # some more checks [[ "$NO_NETWORK" != "1" ]] && { IP=$( ip address show dev "$IFACE" | grep global | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 ) [[ "$IP" == "" ]] && { echo "no IP found for $IFACE"; NO_NETWORK=1; } type brctl &>/dev/null || { echo "brctl is not installed"; NO_NETWORK=1; } modprobe tun &>/dev/null grep -q tun <(lsmod) || { echo "need tun module" ; NO_NETWORK=1; } } # network configuration [[ "$NO_NETWORK" != "1" ]] && { test -f /etc/qemu-ifup && cp -nav /etc/qemu-ifup /etc/qemu-ifup.bak test -f /etc/qemu-ifdown && cp -nav /etc/qemu-ifdown /etc/qemu-ifdown.bak cat > /etc/qemu-ifup <<EOF #!/bin/sh echo "Executing /etc/qemu-ifup" echo "Bringing up \$1 for bridged mode..." sudo $BINARY_PATH/ip link set \$1 up promisc on echo "Adding \$1 to $BRIDGE..." sudo $BINARY_PATH/brctl addif $BRIDGE \$1 sleep 2 EOF cat > /etc/qemu-ifdown <<EOF #!/bin/sh echo "Executing /etc/qemu-ifdown" sudo $BINARY_PATH/ip link set \$1 down sudo $BINARY_PATH/brctl delif $BRIDGE \$1 sudo $BINARY_PATH/ip link delete dev \$1 EOF chmod 750 /etc/qemu-ifdown /etc/qemu-ifup chown root:kvm /etc/qemu-ifup /etc/qemu-ifdown IPFW=$( sysctl net.ipv4.ip_forward | cut -d= -f2 ) sysctl net.ipv4.ip_forward=1 echo "Getting routes for interface: $IFACE" ROUTES=$( ip route | grep $IFACE ) echo "Changing those routes to bridge interface: $BRIDGE" BRROUT=$( echo "$ROUTES" | sed "s=$IFACE=$BRIDGE=" ) echo "Creating new bridge: $BRIDGE" brctl addbr $BRIDGE echo "Adding $IFACE interface to bridge $BRIDGE" brctl addif $BRIDGE $IFACE echo "Setting link up for: $BRIDGE" ip link set up dev $BRIDGE echo "Flusing routes to interface: $IFACE" ip route flush dev $IFACE echo "Adding IP address to bridge: $BRIDGE" ip address add $IP dev $BRIDGE echo "Adding routes to bridge: $BRIDGE" echo "$BRROUT" | tac | while read l; do ip route add $l; done echo "Routes to bridge $BRIDGE added" precreationg=$(ip tuntap list | cut -d: -f1 | sort) ip tuntap add user $USER mode tap postcreation=$(ip tuntap list | cut -d: -f1 | sort) TAPIF=$(comm -13 <(echo "$precreationg") <(echo "$postcreation")) [[ "$MAC" == "" ]] && printf -v MAC "52:54:%02x:%02x:%02x:%02x" \ $(( $RANDOM & 0xff )) $(( $RANDOM & 0xff )) $(( $RANDOM & 0xff )) $(( $RANDOM & 0xff )) NET_ARGS="-net nic,macaddr=$MAC -net tap,ifname=$TAPIF" } # prepare the image SECTOR1=$( fdisk -l $IMG | grep FAT32 | awk '{ print $2 }' ) SECTOR2=$( fdisk -l $IMG | grep Linux | awk '{ print $2 }' ) OFFSET1=$(( SECTOR1 * 512 )) OFFSET2=$(( SECTOR2 * 512 )) # make 'boot' vfat partition available locally mkdir -p tmpmnt mount $IMG -o offset=$OFFSET1 tmpmnt touch tmpmnt/ssh # this enables ssh umount tmpmnt # make 'linux' ext4 partition available locally mount $IMG -o offset=$OFFSET2 tmpmnt cat > tmpmnt/etc/udev/rules.d/90-qemu.rules <<EOF KERNEL=="sda", SYMLINK+="mmcblk0" KERNEL=="sda?", SYMLINK+="mmcblk0p%n" KERNEL=="sda2", SYMLINK+="root" EOF # Work around a known issue with qemu-arm, versatile board and raspbian for at least qemu-arm < 2.8.0 # This works but modifies the image so it is recommended to upgrade QEMU # Ref: http://stackoverflow.com/questions/38837606/emulate-raspberry-pi-raspbian-with-qemu QEMU_MAJOR=$( qemu-system-arm --version | grep -oP '\d+\.\d+\.\d+' | head -1 | cut -d. -f1 ) QEMU_MINOR=$( qemu-system-arm --version | grep -oP '\d+\.\d+\.\d+' | head -1 | cut -d. -f2 ) if [[ $QEMU_MAJOR == 2 ]] && [[ $QEMU_MINOR < 8 ]]; then sed -i '/^[^#].*libarmmem.so/s/^\(.*\)$/#\1/' tmpmnt/etc/ld.so.preload; fi if [[ $QEMU_MAJOR < 2 ]] ; then sed -i '/^[^#].*libarmmem.so/s/^\(.*\)$/#\1/' tmpmnt/etc/ld.so.preload; fi umount -l tmpmnt rmdir tmpmnt &>/dev/null PARAMS_KERNEL="root=/dev/sda2 panic=1" if [[ "$NO_GRAPHIC" == "1" ]]; then PARAMS_QEMU="-nographic" PARAMS_KERNEL="$PARAMS_KERNEL vga=normal console=ttyAMA0" fi # do it qemu-system-arm -kernel $KERNEL -cpu arm1176 -m 256 -M versatilepb $NET_ARGS \ $PARAMS_QEMU -no-reboot -drive format=raw,file=$IMG -append "$PARAMS_KERNEL" # restore network to what it was [[ "$NO_NETWORK" != "1" ]] && { ip link set down dev $TAPIF ip tuntap del $TAPIF mode tap sysctl net.ipv4.ip_forward="$IPFW" ip link set down dev $BRIDGE brctl delbr $BRIDGE echo "$ROUTES" | tac | while read l; do ip route add $l; done } # License # # This script is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This script is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this script; if not, write to the # Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 #!/bin/bash # Run a raspbian image in qemu with network access # Tested with 2017-01-11-raspbian-jessie.img (and lite) # # Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com> # GPL licensed (see end of file) * Use at your own risk! # # Usage: # qemu-pi.sh 2017-01-11-raspbian-jessie.img # or any other image # # Notes: # If NO_NETWORK=0 it will include your network interface on a bridge # with the same gateway and routes, and restore it when exiting qemu # # If NO_NETWORK=1 (default), that configuration will have to be done manually # in order to obtain network access inside raspbian # # It requires a modified kernel image for qemu. (variable $KERNEL) # # It enables SSH on the image # # For the network bridge configuration, this needs to be in /etc/sudoers # Cmnd_Alias QEMU=/usr/bin/ip,/usr/bin/modprobe,/usr/bin/brctl # %kvm ALL=NOPASSWD: QEMU IMG = $ 1 KERNEL = kernel - qemu - 4.4.34 - jessie NO_NETWORK = 1 # set to 1 to skip network configuration BRIDGE = br0 # name for the bridge we will create to share network with the raspbian img MAC = '52:54:be:36:42:a9' # comment this line for random MAC (maybe annoying if on DHCP) BINARY_PATH = / usr / bin # path prefix for binaries NO_GRAPHIC = 0 # set to 1 to start in no graphic mode # sanity checks type qemu - system - arm & > / dev / null || { echo "QEMU ARM not found" ; exit 1 ; } test - f $IMG && test - f $KERNEL || { echo "$IMG or $KERNEL not found" ; exit 1 ; } IFACE = "$( ip r | grep " default via " | awk '{ print $5 }' | head -1 )" [ [ "$IFACE" == "" ] ] || [ [ "$BRIDGE" == "" ] ] && NO_NETWORK = 1 # some more checks [ [ "$NO_NETWORK" != "1" ] ] && { IP = $ ( ip address show dev "$IFACE" | grep global | grep - oP '\d{1,3}(.\d{1,3}){3}' | head - 1 ) [ [ "$IP" == "" ] ] && { echo "no IP found for $IFACE" ; NO_NETWORK = 1 ; } type brctl & > / dev / null || { echo "brctl is not installed" ; NO_NETWORK = 1 ; } modprobe tun & > / dev / null grep - q tun < ( lsmod ) || { echo "need tun module" ; NO_NETWORK = 1 ; } } # network configuration [ [ "$NO_NETWORK" != "1" ] ] && { test - f / etc / qemu - ifup && cp - nav / etc / qemu - ifup / etc / qemu - ifup .bak test - f / etc / qemu - ifdown && cp - nav / etc / qemu - ifdown / etc / qemu - ifdown .bak cat > / etc / qemu - ifup << EOF #!/bin/sh echo "Executing /etc/qemu-ifup" echo "Bringing up \$1 for bridged mode..." sudo $BINARY_PATH / ip link set \ $ 1 up promisc on echo "Adding \$1 to $BRIDGE..." sudo $BINARY_PATH / brctl addif $BRIDGE \ $ 1 sleep 2 EOF cat > / etc / qemu - ifdown << EOF #!/bin/sh echo "Executing /etc/qemu-ifdown" sudo $BINARY_PATH / ip link set \ $ 1 down sudo $BINARY_PATH / brctl delif $BRIDGE \ $ 1 sudo $BINARY_PATH / ip link delete dev \ $ 1 EOF chmod 750 / etc / qemu - ifdown / etc / qemu - ifup chown root : kvm / etc / qemu - ifup / etc / qemu - ifdown IPFW = $ ( sysctl net .ipv4 .ip_forward | cut - d = - f2 ) sysctl net .ipv4 .ip_forward = 1 echo "Getting routes for interface: $IFACE" ROUTES = $ ( ip route | grep $IFACE ) echo "Changing those routes to bridge interface: $BRIDGE" BRROUT = $ ( echo "$ROUTES" | sed "s=$IFACE=$BRIDGE=" ) echo "Creating new bridge: $BRIDGE" brctl addbr $BRIDGE echo "Adding $IFACE interface to bridge $BRIDGE" brctl addif $BRIDGE $IFACE echo "Setting link up for: $BRIDGE" ip link set up dev $BRIDGE echo "Flusing routes to interface: $IFACE" ip route flush dev $IFACE echo "Adding IP address to bridge: $BRIDGE" ip address add $IP dev $BRIDGE echo "Adding routes to bridge: $BRIDGE" echo "$BRROUT" | tac | while read l ; do ip route add $l ; done echo "Routes to bridge $BRIDGE added" precreationg = $ ( ip tuntap list | cut - d : - f1 | sort ) ip tuntap add user $USER mode tap postcreation = $ ( ip tuntap list | cut - d : - f1 | sort ) TAPIF = $ ( comm - 13 < ( echo "$precreationg" ) < ( echo "$postcreation" ) ) [ [ "$MAC" == "" ] ] && printf - v MAC "52:54:%02x:%02x:%02x:%02x" \ $ ( ( $RANDOM & 0xff ) ) $ ( ( $RANDOM & 0xff ) ) $ ( ( $RANDOM & 0xff ) ) $ ( ( $RANDOM & 0xff ) ) NET_ARGS = "-net nic,macaddr=$MAC -net tap,ifname=$TAPIF" } # prepare the image SECTOR1 = $ ( fdisk - l $IMG | grep FAT32 | awk '{ print $2 }' ) SECTOR2 = $ ( fdisk - l $IMG | grep Linux | awk '{ print $2 }' ) OFFSET1 = $ ( ( SECTOR1 * 512 ) ) OFFSET2 = $ ( ( SECTOR2 * 512 ) ) # make 'boot' vfat partition available locally mkdir - p tmpmnt mount $IMG - o offset = $OFFSET1 tmpmnt touch tmpmnt / ssh # this enables ssh umount tmpmnt # make 'linux' ext4 partition available locally mount $IMG - o offset = $OFFSET2 tmpmnt cat > tmpmnt / etc / udev / rules .d / 90 - qemu .rules << EOF KERNEL == "sda" , SYMLINK += "mmcblk0" KERNEL == "sda?" , SYMLINK += "mmcblk0p%n" KERNEL == "sda2" , SYMLINK += "root" EOF # Work around a known issue with qemu-arm, versatile board and raspbian for at least qemu-arm < 2.8.0 # This works but modifies the image so it is recommended to upgrade QEMU # Ref: http://stackoverflow.com/questions/38837606/emulate-raspberry-pi-raspbian-with-qemu QEMU_MAJOR = $ ( qemu - system - arm -- version | grep - oP '\d+\.\d+\.\d+' | head - 1 | cut - d . - f1 ) QEMU_MINOR = $ ( qemu - system - arm -- version | grep - oP '\d+\.\d+\.\d+' | head - 1 | cut - d . - f2 ) if [ [ $QEMU_MAJOR == 2 ] ] && [ [ $QEMU_MINOR < 8 ] ] ; then sed - i '/^[^#].*libarmmem.so/s/^ \ ( . * \ ) $/#\1/' tmpmnt / etc / ld .so .preload ; fi if [ [ $QEMU_MAJOR < 2 ] ] ; then sed - i '/^[^#].*libarmmem.so/s/^ \ ( . * \ ) $/#\1/' tmpmnt / etc / ld .so .preload ; fi umount - l tmpmnt rmdir tmpmnt & > / dev / null PARAMS_KERNEL = "root=/dev/sda2 panic=1" if [ [ "$NO_GRAPHIC" == "1" ] ] ; then PARAMS_QEMU = "-nographic" PARAMS_KERNEL = "$PARAMS_KERNEL vga=normal console=ttyAMA0" fi # do it qemu - system - arm - kernel $KERNEL - cpu arm1176 - m 256 - M versatilepb $NET_ARGS \ $PARAMS_QEMU - no - reboot - drive format = raw , file = $IMG - append "$PARAMS_KERNEL" # restore network to what it was [ [ "$NO_NETWORK" != "1" ] ] && { ip link set down dev $TAPIF ip tuntap del $TAPIF mode tap sysctl net .ipv4 .ip_forward = "$IPFW" ip link set down dev $BRIDGE brctl delbr $BRIDGE echo "$ROUTES" | tac | while read l ; do ip route add $l ; done } # License # # This script is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This script is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this script; if not, write to the # Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA

This was tested on Arch Linux (qemu-arm version 2.8.0), and only some parts on a Debian container.

In the next post we will do something useful with this.