Raspbian on QEmu
Posted: Fri Apr 26, 2013 3:29 pm
How to run Raspbian with QEmu on Debian 6 (You have to download and compile qemu), Debian 7.
- Download Raspbian Wheezy 2013-02-09
http://www.raspberrypi.org/downloads
- Download Linux kernel for Qemu
http://xecdesign.com/downloads/linux-qemu/kernel-qemu
- mkdir temp
mount 2013-02-09-wheezy-raspbian.img -o offset=62914560 temp
- nano /mnt/etc/ld.so.preload
- Comment out the line in the file (use a # as the first character of the line) and save the file (CTRL+X, then "Y" for yes).
- umount temp
How to configure network
- apt-get install bridge-utils
- brctl addbr br0
- brctl addif br0 eth0
Modify the files (see below)
/etc/network/interfaces
/etc/qemu-ifup
/etc/qemu-ifdown
denis@tomcat:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
iface eth0 inet manual
allow-hotplug br0
iface br0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.254
bridge_ports eth0
auto br0
denis@tomcat:~$
denis@tomcat:~$ cat /etc/qemu-ifup
#!/bin/sh
#sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1
echo "Bringing up $1 for bridged mode..."
/sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
/usr/sbin/brctl addif br0 $1
denis@tomcat:~$
denis@tomcat:~$ cat /etc/qemu-ifdown
#!/bin/sh
echo "Removing $1 from br0..."
/usr/sbin/brctl delif br0 $1
denis@tomcat:~$
How to run Raspbian with QEmu
qemu-system-arm -kernel Raspberry/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda Raspberry/2013-02-09-wheezy-raspbian.img -net nic,macaddr=00:16:3e:00:00:01 -net tap -k it
- Download Raspbian Wheezy 2013-02-09
http://www.raspberrypi.org/downloads
- Download Linux kernel for Qemu
http://xecdesign.com/downloads/linux-qemu/kernel-qemu
- mkdir temp
mount 2013-02-09-wheezy-raspbian.img -o offset=62914560 temp
- nano /mnt/etc/ld.so.preload
- Comment out the line in the file (use a # as the first character of the line) and save the file (CTRL+X, then "Y" for yes).
- umount temp
How to configure network
- apt-get install bridge-utils
- brctl addbr br0
- brctl addif br0 eth0
Modify the files (see below)
/etc/network/interfaces
/etc/qemu-ifup
/etc/qemu-ifdown
denis@tomcat:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
iface eth0 inet manual
allow-hotplug br0
iface br0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.254
bridge_ports eth0
auto br0
denis@tomcat:~$
denis@tomcat:~$ cat /etc/qemu-ifup
#!/bin/sh
#sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1
echo "Bringing up $1 for bridged mode..."
/sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
/usr/sbin/brctl addif br0 $1
denis@tomcat:~$
denis@tomcat:~$ cat /etc/qemu-ifdown
#!/bin/sh
echo "Removing $1 from br0..."
/usr/sbin/brctl delif br0 $1
denis@tomcat:~$
How to run Raspbian with QEmu
qemu-system-arm -kernel Raspberry/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda Raspberry/2013-02-09-wheezy-raspbian.img -net nic,macaddr=00:16:3e:00:00:01 -net tap -k it