This guide provides a step-by-step walkthrough for setting up a network environment for QEMU, and for running MIPS, MIPSEL, and ARM virtual machines.
First, we need to install the necessary tools and create a network bridge to allow the virtual machine to communicate with the host.
Install bridge-utils and uml-utilities:
sudo apt-get update
sudo apt-get install bridge-utils
sudo apt-get install uml-utilities-
Create a bridge interface named
Virbr0:sudo brctl addbr Virbr0
-
Assign an IP address to
Virbr0and bring it up:sudo ifconfig Virbr0 192.168.153.1/24 up
-
Create a tap interface named
tap0:sudo tunctl -t tap0
-
Assign an IP address to
tap0and bring it up:sudo ifconfig tap0 192.168.153.11/24 up
-
Add the
tap0interface to theVirbr0bridge:sudo brctl addif Virbr0 tap0
Download the required disk images and kernel files to run the emulated systems.
-
MIPSEL:
Bash
wget https://people.debian.org/~aurel32/qemu/mipsel/debian_wheezy_mipsel_standard.qcow2 wget https://people.debian.org/~aurel32/qemu/mipsel/vmlinux-3.2.0-4-4kc-malta -
MIPS: (You will need to acquire
debian_wheezy_mips_standard.qcow2separately)- Kernel:
vmlinux-3.2.0-4-4kc-malta
- Kernel:
-
ARM:
- Download resources from: https://people.debian.org/~aurel32/qemu/armhf/
Default Credentials:
- Username:
root - Password:
root
-
MIPSEL:
sudo qemu-system-mipsel -M malta \ -kernel vmlinux-3.2.0-4-4kc-malta \ -hda debian_wheezy_mipsel_standard.qcow2 \ -append "root=/dev/sda1 console=tty0" \ -netdev tap,id=tapnet,ifname=tap0,script=no \ -device rtl8139,netdev=tapnet \ -nographic -
MIPS:
sudo qemu-system-mips -M malta \ -kernel vmlinux-3.2.0-4-4kc-malta \ -hda debian_wheezy_mips_standard.qcow2 \ -append "root=/dev/sda1 console=tty0" \ -netdev tap,id=tapnet,ifname=tap0,script=no \ -device rtl8139,netdev=tapnet \ -nographic -
ARM:
sudo qemu-system-arm -M vexpress-a9 \ -kernel vmlinuz-3.2.0-4-vexpress \ -initrd initrd.img-3.2.0-4-vexpress \ -drive if=sd,file=debian_wheezy_armhf_standard.qcow2 \ -append "root=/dev/mmcblk0p2 console=ttyAMA0" \ -net nic -net tap,ifname=tap0,script=no,downscript=no \ -nographic
Once the virtual machine is running, you need to configure its network interface to communicate with the host.
-
Bring up the
eth0interface and assign an IP address: Note: This IP should be in the same subnet as the bridge on the host.ifconfig eth0 192.168.153.2/24 up
Alternatively, you can create a bridge within the VM:
ip link add name br0 type bridge ip addr add 192.168.153.2/24 dev br0 ip link set br0 up ifconfig br0 192.168.153.2/24
-
Verify connectivity by pinging the host's tap interface:
ping 192.168.153.11