Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Im using QEMU 1.4.0 Ubuntu 13.04 distribution. Im trying to make the virtrual machine part of the host network so Im ussing this command:

sudo qemu-system-arm -M overo -m 1024 -sd ./test.img -clock unix -device usb-mouse -device usb-kbd -serial pty -monitor pty -net nic,vlan=1,macaddr=00:aa:00:60:00:01,model=lan9118 -net tap,vlan=1,ifname=tap0,script=no

In QEMU's monitor I see this:

(qemu) info network                                                             
hub 1                                                                           
 \ tap.0: index=0,type=tap,ifname=tap0,script=no,downscript=/etc/qemu-ifdown    
 \ lan9118.0: index=0,type=nic,model=lan9118,macaddr=00:aa:00:60:00:01

(qemu) info qtree                                                               
bus: main-system-bus                                                            
  type System                                                                   
  dev: lan9118, id ""                                                           
    mac = 00:aa:00:60:00:01                                                     
    vlan = 1                                                                    
    netdev = hub1port0                                                          
    bootindex = -1                                                              
    mode_16bit = 0                                                              
    irq 1                                                                       
    mmio ffffffffffffffff/0000000000000100 

I see that the device is been emulated and the vlan attached to the tap device. So far everything looks good.

Inside the virtual machine I get this:

[root@overo ~]# ifconfig -a                                                    
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)                                

usb0      Link encap:Ethernet  HWaddr F2:9D:C9:7F:69:F7                         
          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) 

No eth0 interface was given to the lan9118 device. Insted I get a usb0 for which device is no where in the info qtree listing at the QEMU's monitor.

I guessed that it could be the drivers for the lan9118 weren't installed. So I checked the linux-3.2.8.config file and this is what the ethernet part does look like:

#
# CAIF transport drivers
#
CONFIG_ETHERNET=y
CONFIG_NET_VENDOR_BROADCOM=y
# CONFIG_B44 is not set
CONFIG_NET_VENDOR_CHELSIO=y
# CONFIG_DM9000 is not set
# CONFIG_DNET is not set
CONFIG_NET_VENDOR_FARADAY=y
# CONFIG_FTMAC100 is not set
# CONFIG_FTGMAC100 is not set
CONFIG_NET_VENDOR_INTEL=y
CONFIG_NET_VENDOR_I825XX=y
CONFIG_NET_VENDOR_MARVELL=y
CONFIG_NET_VENDOR_MICREL=y
CONFIG_KS8851=y
CONFIG_KS8851_MLL=y
CONFIG_NET_VENDOR_MICROCHIP=y
# CONFIG_ENC28J60 is not set
CONFIG_NET_VENDOR_NATSEMI=y
CONFIG_NET_VENDOR_8390=y
# CONFIG_AX88796 is not set
# CONFIG_ETHOC is not set
CONFIG_NET_VENDOR_SEEQ=y
# CONFIG_SEEQ8005 is not set
CONFIG_NET_VENDOR_SMSC=y
CONFIG_SMC91X=y
#CONFIG_SMC911X is not set
CONFIG_SMSC911X=y
# CONFIG_SMSC911X_ARCH_HOOKS is not set
CONFIG_NET_VENDOR_STMICRO=y
# CONFIG_STMMAC_ETH is not set
CONFIG_NET_VENDOR_TI=y
# CONFIG_TI_DAVINCI_EMAC is not set
# CONFIG_TI_DAVINCI_MDIO is not set
# CONFIG_TI_DAVINCI_CPDMA is not set
CONFIG_PHYLIB=y

I see CONFIG_SMSC911X=y which in this case should be good. I also tried CONFIG_SMC911X=y but nothing changed.

If anyone has ever managed to bring an overo VM under the host network I will also be glad to hear from you.

Also, I tried getting a x86-64 VM to the host network using the same methode and it worked fine. The x86-64 VM use a e1000 device.

Looking at hw/overo.c on QEMU's code I see this:

88     /* Strictly this should be a LAN9221 */ 
89     if (nd_table[0].vlan) { 
90         /* The ethernet chip hangs off the GPMC */ 
91         NICInfo *nd = &nd_table[0]; 
92         qemu_check_nic_model(nd, "lan9118"); 
93         s->eth = qdev_create(NULL, "lan9118"); 
94         qdev_set_nic_properties(s->eth, nd); 
95         qdev_init_nofail(s->eth); 
96         omap_gpmc_attach(s->cpu->gpmc, OVERO_NET_CS, s->eth, 0, 0); 
97         sysbus_connect_irq(sysbus_from_qdev(s->eth), 0, 
98                            qdev_get_gpio_in(s->cpu->gpio, 176)); 

the comment at line 88 says it should be strictly a LAN9221 device, but the qemu_check_nic_model(nd, "lan9118") is a LAN9118.

What device driver should be installed then?

Looking at hw/overo.c on QEMU's code I see this:

88     /* Strictly this should be a LAN9221 */ 
89     if (nd_table[0].vlan) { 
90         /* The ethernet chip hangs off the GPMC */ 
91         NICInfo *nd = &nd_table[0]; 
92         qemu_check_nic_model(nd, "lan9118"); 
93         s->eth = qdev_create(NULL, "lan9118"); 
94         qdev_set_nic_properties(s->eth, nd); 
95         qdev_init_nofail(s->eth); 
96         omap_gpmc_attach(s->cpu->gpmc, OVERO_NET_CS, s->eth, 0, 0); 
97         sysbus_connect_irq(sysbus_from_qdev(s->eth), 0, 
98                            qdev_get_gpio_in(s->cpu->gpio, 176)); 

the comment at line 88 says it should be strictly a LAN9221 device, but the qemu_check_nic_model(nd, "lan9118") is a LAN9118.

I searched on internet and SMSC911X should be de same driver for both device. CONFIG_SMSC911X=y I wondering if CONFIG_SMSC911X_ARCH_HOOKS should also be set. But the info about this config is not well detailed.

On smsc.com I found this; SRC-118-UBOOT-ARM LAN91xx/LAN92xx UBOOT driver for ARM processor

But have no idead If my uboot has does driver or even how to add them.

share|improve this question
add comment

migrated from serverfault.com Jul 5 '13 at 12:36

This question came from our site for professional system and network administrators.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.