【问题】
折腾:
期间,虽然已经解决了:
【已解决】Ubuntu下QEMU启动内核时出错:/etc/qemu-ifup: 19: /etc/qemu-ifup: /usr/sbin/openvpn: not found
但是还是有其他错误:
crifan@ubuntu:ifup_ifdown$ sudo /opt/qemu/bin/qemu-system-arm -M versatilepb -nographic -net nic -net tap,ifname=tap0 -kernel /home/crifan/develop/crosscompile/uboot/u-boot-2013.07/u-boot /sbin/ifdown: interface eth0 not configured SIOCSIFADDR: No such device br0: ERROR while getting interface flags: No such device SIOCSIFNETMASK: No such device SIOCSIFBRDADDR: No such device br0: ERROR while getting interface flags: No such device SIOCADDRT: Network is unreachable /etc/qemu-ifup: 39: /etc/qemu-ifup: /sbin/service: not found /etc/qemu-ifup: could not launch network script qemu-system-arm: -net tap,ifname=tap0: Device 'tap' could not be initialized
即
SIOCSIFADDR: No such device |
【解决过程】
1.参考:
说是要有个ne2k-pci的模块。
2.参考:
Re: [Qemu-devel] Setting up tun/tap network doesn’t work
好像说是,是linux guest,即qemu里面的那个linux需要ne2k-pci驱动。
(而不是我当前的Ubuntu)
3。然后参考:
也说是,需要重新编译kernel,加上“NIC device driver ”。
所以就去重新配置kernel:
crifan@ubuntu:linux-3.10.7$ make ARCH=arm CROSS_COMPILE=arm-xscale-linux-gnueabi- menuconfig HOSTCC scripts/kconfig/lxdialog/checklist.o HOSTCC scripts/kconfig/lxdialog/inputbox.o HOSTCC scripts/kconfig/lxdialog/menubox.o HOSTCC scripts/kconfig/lxdialog/textbox.o HOSTCC scripts/kconfig/lxdialog/util.o HOSTCC scripts/kconfig/lxdialog/yesno.o HOSTCC scripts/kconfig/mconf.o HOSTLD scripts/kconfig/mconf scripts/kconfig/mconf Kconfig
加上对应的nic:
4.结果是找了半天,menuconfig里面也没找到NIC device driver。
5。但是貌似里面是有关于:
Device Drivers > Network device support -> Universal TUN/TAP device driver support
的配置的,之前没有选上,现在去选上:
对应的配置是:
.config – Linux/arm 3.10.7 Kernel Configuration Universal TUN/TAP device driver support │ CONFIG_TUN: │ via physical media writes them to the user space program. │ devices, driver will automatically delete tunXX or tapXX device and |
6.然后重新编译:
make ARCH=arm CROSS_COMPILE=arm-xscale-linux-gnueabi- uImage
crifan@ubuntu:linux-3.10.7$ make ARCH=arm CROSS_COMPILE=arm-xscale-linux-gnueabi- uImage scripts/kconfig/conf --silentoldconfig Kconfig CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h make[1]: `include/generated/mach-types.h' is up to date. CALL scripts/checksyscalls.sh CC scripts/mod/devicetable-offsets.s GEN scripts/mod/devicetable-offsets.h HOSTCC scripts/mod/file2alias.o HOSTLD scripts/mod/modpost CHK include/generated/compile.h CC drivers/net/tun.o LD drivers/net/built-in.o LD drivers/built-in.o CC net/socket.o LD net/built-in.o LINK vmlinux LD vmlinux.o MODPOST vmlinux.o GEN .version CHK include/generated/compile.h UPD include/generated/compile.h CC init/version.o LD init/built-in.o KSYM .tmp_kallsyms1.o KSYM .tmp_kallsyms2.o LD vmlinux SORTEX vmlinux SYSMAP System.map OBJCOPY arch/arm/boot/Image Kernel: arch/arm/boot/Image is ready GZIP arch/arm/boot/compressed/piggy.gzip AS arch/arm/boot/compressed/piggy.gzip.o LD arch/arm/boot/compressed/vmlinux OBJCOPY arch/arm/boot/zImage Kernel: arch/arm/boot/zImage is ready UIMAGE arch/arm/boot/uImage Image Name: Linux-3.10.7 Created: Sun Aug 18 21:50:41 2013 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 1898744 Bytes = 1854.24 kB = 1.81 MB Load Address: 00008000 Entry Point: 00008000 Image arch/arm/boot/uImage is ready crifan@ubuntu:linux-3.10.7$
然后再去运行试试,结果错误依旧:
crifan@ubuntu:ifup_ifdown$ sudo /opt/qemu/bin/qemu-system-arm -M versatilepb -nographic -net nic -net tap,ifname=tap0 -kernel /home/crifan/develop/crosscompile/uboot/u-boot-2013.07/u-boot /sbin/ifdown: interface eth0 not configured SIOCSIFADDR: No such device br0: ERROR while getting interface flags: No such device SIOCSIFNETMASK: No such device SIOCSIFBRDADDR: No such device br0: ERROR while getting interface flags: No such device SIOCADDRT: Network is unreachable /etc/qemu-ifup: 39: /etc/qemu-ifup: /sbin/service: not found /etc/qemu-ifup: could not launch network script qemu-system-arm: -net tap,ifname=tap0: Device 'tap' could not be initialized
此时,才注意到,此刻,根本就还没去加载uImage呢,而只是针对于-kernel给的是u-boot,即:
此处的错误,和uImage,没有任何关系,而只是QEMU哪里没配置好或者是当前Ubuntu哪里配置不支持,而导致的错误。
7.参考:
虚拟机备份转移后,网络启动异常,提示“SIOCSIFADDR: No such device”的解决方案
去试试ping和重启,结果(貌似是)正常的:
crifan@ubuntu:ifup_ifdown$ ping www.baidu.com ping: unknown host www.baidu.com crifan@ubuntu:ifup_ifdown$ sudo /etc/init.d/networking networking networking.dpkg-new crifan@ubuntu:ifup_ifdown$ sudo /etc/init.d/networking restart Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service networking restart Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the stop(8) and then start(8) utilities, e.g. stop networking ; start networking. The restart(8) utility is also available. networking stop/waiting networking start/running crifan@ubuntu:ifup_ifdown$
【总结】
暂时没有解决此问题。
暂时放弃此问题。
因为,觉得,之前看到的:
自己此处,没有完全符号要求,所以才会在网络方面出现问题。
所以,打算参考上述教程,去弄好网络配置后,再去折腾此问题。
转载请注明:在路上 » 【未解决】Ubuntu下用QEMU启动内核时出错:SIOCSIFADDR: No such device