pmj / virtio-net-osx

Mac OS X driver for a (virtualised) "virtio" network device. Virtio network devices are supported by KVM and VirtualBox. Fastest virtual network device for VirtualBox OSX Guests, allows kernel debugging of guests via gdb.
231 stars 24 forks source link

Yosemite: Cable Unplugged #6

Open Hello71 opened 9 years ago

Hello71 commented 9 years ago

OS X Yosemite 10.10.4:

qemu -netdev bridge,id=br0,br=br0 \
      -device virtio-net-pci,netdev=br0,id=mac_vnet0 \
      -netdev user,smb=/,id=user0 \
      -device virtio-net-pci,netdev=user0,id=mac_vnet1 \
      [ ... ]

both interfaces show in "Network" as "Not Connected", "Cable Unplugged" and in ifconfig as UP,RUNNING but inactive. Safari of course reports "You Are Not Connected to the Internet".

obviously the driver is running since the interfaces are present, but I checked by kextstat | grep virtio.

the same setup works correctly (i.e. Internet access, SMB) with e1000-82545em. specifying a single bridge device also does not work. nor does the -net nic,model=virtio syntax.

malarinv commented 8 years ago

same here OSX El Capitan 10.11.0

pmj commented 8 years ago

Hey, as we're now working on the virtio drivers again - if you're still seeing this issue, can you let me know if the detected MAC address from OSX's point of view looks correct? If not, this is likely to be caused by the MSI-X issue we just discovered, and which I've explained in more detail in issue #3.

If the MAC address is fine, this is presumably a different problem. Hopefully our increased testing will shake it out, but if you have any more repro info, then that's always appreciated.

Thanks!

steverice commented 8 years ago

Been afflicted by this issue as well, really glad to hear you're working on it (and other virtio drivers)!

I'm running OS X El Capitan 10.11.3 on the guest. With -netdev tap and -device e1000-82545em, the OS X guest sees the MAC address as 52:54:00:12:34:56, and the connection works properly.

Using -device virtio-net with both -netdev tap and -netdev user, the OS X guest sees the same MAC address but I get the "cable unplugged" issue as described here.

The kext is loaded, confirmed as above. Not sure if that means the MAC address is "fine", since it appears to be the same dummy MAC address set by qemu in all cases.

If I set the MAC address of the virtio device manually using -device virtio-net,netdev=net0,mac=00:00:00:00:00:00, then the OS X guest sees the MAC address I provide on the virtio device.

pmj commented 8 years ago

OK, if the MAC address is fine, then the problem likely isn't MSI-X, but it could still be interrupt related. I'll do my best to repro & fix over the next weeks.

kaynz commented 8 years ago

Hey, any news on this?

swordqiu commented 8 years ago

We tried this driver on 10.11 EL Capitan with success. As suggested in #3 , you need to add vectors=0 to the -device virtio-net-pci. Nice work!

saytik commented 7 years ago

i have the same problem. OSX is a guest of KVM host. there is inactive network Ethernet interface after driver installation. MAC address is the same. my xml

 <interface type='network'>
       <mac address='3a:a8:16:a1:39:c5'/>
       <source network='default'/>
       <model type='virtio'/>
       <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
     </interface>

where to add vector ? how to get network device active and work ?

(sorry for my english)

peterdk commented 7 years ago

It would be great if someone could explain where to put the vectors='0'. I tried adding them in <model type='virtio'/> but this did not solve the issue.

There is a reference to #3 in this thread, but there is not content there anymore. Update Sorry, reloading #3 page does suddenly show all comments. That gave me directions to solve this issue.