Note: The host system is Ubuntu and guest is Debian (mips) in the example below. In this example, eth0 of the host and guest are through the one NIC while eth1 of host and guest are through other NIC. There is a DHCP server running somewhere that gives IP to eth0 of host as well as eth0 of the guest. I run a DHCP server on eth1 of the host to give IP to eth1 of the guest. wget http://ftp.debian.org/debian/dists/Debian5.0.6/main/installer-mips/current/images/malta/netboot/initrd.gzwget http://ftp.debian.org/debian/dists/Debian5.0.6/main/installer-mips/current/images/malta/netboot/vmlinux-2.6.26-2-4kc-maltaqemu-system-mips -M malta -kernel vmlinux-2.6.26-2-4kc-malta -initrd initrd.gz -hda Linux.qcow -append root=/dev/ram c onsole=ttyS0 -nographicI tried with several other machine types beside Malta but they did not work. QEMU just hung there. The interfaces file on host (/etc/network/interfaces) needs to be configured to use two bridged 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 interfaceauto lo eth1 br1 br0 eth0iface lo inet loopback#iface eth0 inet dhcpiface br0 inet dhcp bridge_ports eth0 bridge_maxwait 0iface br1 inet static bridge_ports eth1 bridge_maxwait 0 address 192.168.41.4 netmask 255.255.255.0 broadcast 192.168.41.255 network 192.168.41.0iface eth1 inet static address 0.0.0.0iface eth0 inet static address 0.0.0.0QEMU if up file (/etc/qemu-ifup) looks like this: #!/bin/shecho "Executing /etc/qemu-ifup" Args= $*echo "Bringing up $1 for bridged mode..."sudo /sbin/ifconfig $1 0.0.0.0 promisc upif [ $1 = "tap0" ]; thenecho "Adding $1 to br0..."sudo /usr/sbin/brctl addif br0 $1fiif [ $1 = "tap1" ]; thenecho "Adding $1 to br1..."sudo /usr/sbin/brctl addif br1 $1fisleep 2Note: Make sure that brctl shows this information: $brctl showbridge name bridge id STP enabled interfacesbr0 8000.000c29b09c78 no eth0 tap0br1 8000.000c29b09c82 no eth1 tap1brctl addif br0 tap0brctl addif br1 tap1To run use this: qemu-system-mips -m 256 -M malta -kernel vmlinux-2.6.26-2-4kc-malta -hda Linux.qcow -append "root=/dev/hda1 console=ttyS0" -nographic -net nic,macaddr=00:16:3e:00:00:01,vlan=0 -net tap,vlan=0 -net nic,macaddr=00:16:3e:00:00:02,vlan=1 -net tap,vlan=1Tip: If you encounter dns related issues, its easier to use opendns as the name server. You /etc/resolve.conf can look like this to use opendns as the name server: domain localdomainsearch localdomainnameserver 208.67.222.222 |
Monday, December 13, 2010
Running debian-mips in Qemu (Two NICs)
Subscribe to:
Post Comments (Atom)
2 comments:
C:\Documents and Settings\developer\My Documents\qemu-0.13.0-windows>"C:\Documents and Settings\developer\My Documents\qemu-0.13.0-windows\bin\qemu-system-mips.exe" -m 256 -M malta -kernel "C:\Documents and Settings\developer\My Documents\new\vmlinux-2.6.32-5-4kc-malta" -hda "C:\Documents and Settings\developer\My Documents\new\Linux.qcow" -append "root=/dev/sda1 console=ttyS0" -nographic -serial mon:telnet::4444,server,nowait -net nic,macaddr=00:16:3e:00:00:01,vlan=0 -net tap,ifname=my-tap vlan=0
For squeeze use these line to install:
wget http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-mips/current/images/malta/netboot/initrd.gz
wget http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-mips/current/images/malta/netboot/vmlinux-2.6.32-5-4kc-malta
qemu-system-mips -M malta -kernel vmlinux-2.6.32-5-4kc-malta -initrd initrd.gz -hda Linux.qcow -append root=/dev/ram console=ttyS0 -nographic
Post a Comment