Bridging of QEMU emulated Raspberry pi - Raspberry Pi Forums


hi folks, had struggle lot establish bridging between guest os (raspbian) running on qemu , host os (ubuntu 16.04). found solution. hope information might have been facing similar problem. here steps:

sudo apt-get install bridge-utils
sudo apt-get install uml-utilities
sudo apt-get install qemu-kvm libvirt-bin


type ifconfig
note down name of predictable network interface name. in case, enp0s31f6 ethernet.

create script called dummy.sh (dummy user defined name here) , copy following lines:
#!/bin/bash
sudo brctl addbr br0
sudo ip addr flush dev enp0s31f6
sudo brctl addif br0 enp0s31f6
sudo tunctl -u $(whoami)
sudo brctl addif br0 tap0
sudo ip link set dev br0 up
sudo ip link set dev tap0 up
sudo dhclient br0


run script sudo sh dummy.sh
, start qemu using following command:

sudo qemu-system-arm -kernel kernel-qemu?dl=0 -cpu arm1176 -m 256 -m versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda ~/qemu/raspbian.img -net nic,macaddr=00:16:3e:00:00:01 -net tap,ifname=tap0,script=no,downscript=no -redir tcp:5022::22

type ifconfig in qemu terminal, must see new ip address.

hope helps someone. thank you.



raspberrypi



Comments