[color=#0000FF]
Establishing an ethernet/wifi bridge network between the Ubuntu host and the Debian ARM VM on QEMU:[/color]
This is very useful for transfering files between the host and the VM. You can follow these 2 links to understand it better.
mediaonfire.com/tech_tips/QE … rking.html
blog.ericwhite.ca/articles/2011/ … ss-bridge/
edit these 2 files on the Debian ARM VM:
[color=#0000FF]1. $ sudo nano /etc/network/interfaces[/color]
The loopback network interface
auto lo
iface lo inet loopback
This is for static ip. If you do NOT want static ip, uncomment the 2 lines. If you uncomment, DHCP will allocate 10.0.2.3.
#allow-hotplug eth0
#iface eth0 inet dhcp
################################
This is for static ip. If you do NOT want static ip, comment out all the 8 lines.
auto eth0
iface eth0 inet static
address 192.168.1.80
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
[color=#0040FF]2. sudo nano /etc/resolv.conf[/color]
nameserver 8.8.8.8
nameserver 8.8.4.4
For a quick setup of “tapo” bridge via “wlan0” on your laptop, just download the “QEMU wlan.zip” file, unzip and copy the “kvm_networking” script file into the emulator folder, edit the user name and ip addresses as per the comments and enter the command
[color=#0000FF]On Ubuntu host:[/color]
$ sudo modprobe tun
$ echo tun >> /etc/modules
$ sudo apt-get install uml-utilities
$ sudo kvm_networking start
user@ubuntult:~/emulator$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:1e:68:5f:e4:23
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:155919 errors:0 dropped:0 overruns:0 frame:0
TX packets:155919 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:32861159 (32.8 MB) TX bytes:32861159 (32.8 MB)
tap0 Link encap:Ethernet HWaddr e2:09:90:1a:bf:05
inet addr:192.168.1.100 Bcast:0.0.0.0 Mask:255.255.255.255
inet6 addr: fe80::e009:90ff:fe1a:bf05/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:579 errors:0 dropped:0 overruns:0 frame:0
TX packets:688 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:74293 (74.2 KB) TX bytes:81324 (81.3 KB)
wlan0 Link encap:Ethernet HWaddr 00:1f:3b:9c:a0:cd
inet addr:192.168.1.7 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21f:3bff:fe9c:a0cd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:81656 errors:0 dropped:1 overruns:0 frame:0
TX packets:37944 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:38401362 (38.4 MB) TX bytes:5183650 (5.1 MB)
[color=#0000FF]Launch Debian arm with tap0:[/color]
user@ubuntult:~/emulator$ sudo qemu-system-arm -M vexpress-a9 -net tap,ifname=tap0,script=no,downscript=no -net nic -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” -m 512 -no-reboot -serial stdio
user@debian-armhf:~$ sudo ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:00:12:34:56
inet addr:192.168.1.80 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:108 errors:0 dropped:0 overruns:0 frame:0
TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12577 (12.2 KiB) TX bytes:9911 (9.6 KiB)
Interrupt:47
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
[color=#0040FF]Now we can do ssh from the host and trasfer files between the host and VM using the “Filezilla FTP” software.[/color]
$ sudo ssh -X -Y user@192.168.1.80
Change the “user” and IP address as per your etho “inet addr” as shown above.
With tap0 bridge on wlano, it may NOT be possible to connnet the Debian VM to the internet and update. In this case, we must remove “tap0” bridge and disable static ip on the VM by editing the “/etc/network/interfaces” file as explained above.
To remove “tapo” bridge from the host:
$ sudo kvm_networking stop
If you want to emulate Raxpberry pi on QEMU, follow this link:
xecdesign.com/qemu-emulating-ras … -easy-way/
QEMU wlan.zip (411 KB)