我正在尝试在Ubuntu 13.04上模拟树莓派。我安装了qemu,除了网络以外,它都运行良好。
我遵循了这个程序。在虚拟机上,文件/etc/network/interface
如下所示
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.20.106 # your IP
gateway 192.168.20.1 # IP of the Router
netmask 255.255.255.0 # Network mask
我像这样启动qemu sudo qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -append "root=/dev/sda2" -hda 2013-09-25-wheezy-raspbian.img -kernel kernel-qemu -redir tcp:5022::22
。
在ubuntu上,当我执行时ifconfig
,我得到以下结果:
br0 Link encap:Ethernet HWaddr 8e:0f:b1:ad:1c:18
inet adr:10.10.10.2 Bcast:10.255.255.255 Masque:255.0.0.0
adr inet6: fe80::8c0f:b1ff:fead:1c18/64 Scope:Lien
UP BROADCAST MULTICAST MTU:1500 Metric:1
Packets reçus:8 erreurs:0 :8 overruns:0 frame:0
TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
Octets reçus:792 (792.0 B) Octets transmis:5092 (5.0 KB)
eth0 Link encap:Ethernet HWaddr 90:2b:34:39:b4:1d
UP BROADCAST MULTICAST MTU:1500 Metric:1
Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B)
lo Link encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
adr inet6: ::1/128 Scope:Hôte
UP LOOPBACK RUNNING MTU:65536 Metric:1
Packets reçus:12770 erreurs:0 :0 overruns:0 frame:0
TX packets:12770 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
Octets reçus:2121321 (2.1 MB) Octets transmis:2121321 (2.1 MB)
wlan1 Link encap:Ethernet HWaddr ac:f1:df:79:01:80
inet adr:192.168.20.106 Bcast:192.168.20.255 Masque:255.255.255.0
adr inet6: fe80::aef1:dfff:fe79:180/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Packets reçus:5283 erreurs:0 :48 overruns:0 frame:0
TX packets:5252 errors:0 dropped:5 overruns:0 carrier:0
collisions:0 lg file transmission:1000
Octets reçus:2806386 (2.8 MB) Octets transmis:1461531 (1.4 MB)
在虚拟机上运行,ping 192.168.20.106
因为它是本地地址,但ping 192.168.20.1
不起作用。我还尝试为真实和虚拟机设置一个不同的地址。
我该怎么办?
-redir
选项。