machyve / xhyve

xhyve, a lightweight OS X virtualization solution
Other
6.44k stars 353 forks source link

Networking doesn't work when VMware Fusion is installed #16

Open hydrajump opened 9 years ago

hydrajump commented 9 years ago

First off this is an awesome project!

I've tested xhyve on a system that has VMware Fusion 7.1.1 installed and I've noticed that networking doesn't work.

Steps to reproduce

MacBook 8,1 OS X 10.10.3 (14D136) VMware Fusion 7.1.1

❯ cat xhyverun.sh 
#!/bin/sh

KERNEL="test/vmlinuz"
INITRD="test/initrd.gz"
CMDLINE="earlyprintk=serial console=ttyS0 acpi=off"

MEM="-m 1G"
#SMP="-c 2"
NET="-s 2:0,virtio-net"
#IMG_CD="-s 3,ahci-cd,/somepath/somefile.iso"
#IMG_HDD="-s 4,virtio-blk,/somepath/somefile.img"
PCI_DEV="-s 0:0,hostbridge -s 31,lpc"
LPC_DEV="-l com1,stdio"

build/xhyve $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_CD $IMG_HDD -f kexec,$KERNEL,$INITRD,"$CMDLINE"

Fusion was not running when I tested xhyve and I can see that two interfaces are created on the host: en3 and bridge100.

# ifconfig on host
en3: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
    ether 26:fe:d2:db:4a:dc 
    media: autoselect
    status: active
bridge100: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=3<RXCSUM,TXCSUM>
    ether aa:66:7f:50:31:64 
    inet 192.168.64.1 netmask 0xffffff00 broadcast 192.168.64.255
    Configuration:
        id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
        maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
        root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
        ipfilter disabled flags 0x2
    member: en3 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 7 priority 0 path cost 0
    nd6 options=1<PERFORMNUD>
    media: autoselect
    status: active

Inside the VM, e.g. Tiny Core Linux, eth0 is also created, but no IP address is leased from the 192.168.64.1 gateway.

# ifconfig in tiny core vm
eth0      Link encap:Ethernet  HWaddr A2:7C:A2:77:CF:32  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3466 (3.3 KiB)  TX bytes:2736 (2.6 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  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)

UPDATE 1

I tried setting the IP address manually, but no go.

tc@box:/opt$ sudo ifconfig eth0 192.168.64.2 netmask 255.255.255.0
tc@box:/opt$ ifconfig
eth0      Link encap:Ethernet  HWaddr 86:3B:1D:75:CF:32  
          inet addr:192.168.64.2  Bcast:192.168.64.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:68 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3452 (3.3 KiB)  TX bytes:15156 (14.8 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:41 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3920 (3.8 KiB)  TX bytes:3920 (3.8 KiB)

tc@box:/opt$ ping 192.168.64.1
PING 192.168.64.1 (192.168.64.1): 56 data bytes

UPDATE 2

I created an OS X 10.11 beta VM as a VMware Fusion guest and successfully ran xhyve with a tiny core vm and networking worked!

As a result I assumed that VMware Fusion was to blame. However, after I removed VMware Fusion from my MacBook (app plus files listed here and tested xhyve after rebooting, networking still doesn't work :disappointed:

UPDATE 3

I have messed with this line NET="-s 2:0,virtio-net" appending each host interface separately without success.

NET="-s 2:0,virtio-net,en0"
NET="-s 2:0,virtio-net,en3"

I have no idea what's going on.

rickard-von-essen commented 8 years ago

FYI: I run xhyve with network and VMware Fusion 7.1.3 with no problem.