lima-vm / lima

Linux virtual machines, with a focus on running containers
https://lima-vm.io/
Apache License 2.0
15.13k stars 591 forks source link

Unable to ping VM host (lima/colima) #686

Open spkane opened 2 years ago

spkane commented 2 years ago

Description

I setup networking for lima/colima a few weeks ago and it had been working fine, but today, even after some troubleshooting, I can not ping the colima VM from my host. I have updated lima, colima, and macOS with patch releases lately, so that might be related, but I am not really sure what to check at this point.

On the mac I can see this:

bridge100: flags=8a63<UP,BROADCAST,SMART,RUNNING,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
    options=3<RXCSUM,TXCSUM>
    ether 16:7d:da:6a:3e:64
    inet 192.168.105.1 netmask 0xffffff00 broadcast 192.168.105.255
    inet6 fe80::147d:daff:fe6a:3e64%bridge100 prefixlen 64 scopeid 0x14
    inet6 fdce:1812:ad25:915f:834:c0bf:f47f:b16e prefixlen 64 autoconf secured
    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 0x0
    member: vmenet0 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 19 priority 0 path cost 0
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: **active**

but I can not ping 192.168.105.1

One the colima VM, I can see this:

lima0     Link encap:Ethernet  HWaddr 52:55:55:74:18:4D
          inet addr:192.168.105.2  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fdce:1812:ad25:915f:5055:55ff:fe74:184d/64 Scope:Global
          inet6 addr: fe80::5055:55ff:fe74:184d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:158 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:42873 (41.8 KiB)  TX bytes:1720 (1.6 KiB)

and I can ping both 192.168.105.2 and 192.168.105.1

I'm not sure exactly what the next step would be in figuring out what bit is likely broken.

Pointers would be much appreciated.

spkane commented 2 years ago

I also posted this in lima-vm/vde_vmnet as I am not really sure where the issue lies. https://github.com/lima-vm/vde_vmnet/issues/37

spkane commented 2 years ago

This is what I see in the logs:

$ cat shared_switch.stderr.log
/opt/vde/bin/vde_switch: EOF data port: Interrupted system call
/opt/vde/bin/vde_switch: Reading  data: Connection reset by peer
abiosoft commented 2 years ago
$ cat shared_switch.stderr.log
/opt/vde/bin/vde_switch: EOF data port: Interrupted system call
/opt/vde/bin/vde_switch: Reading  data: Connection reset by peer

I am noticing same behaviour, I get same error output when attempting to start vde_vmnet manually. And the vde_vmnet output looks like a fatal error

Initializing vmnet.framework (mode 1001)
start(): vmnet_return_t VMNET_FAILURE
start: Undefined error: 0
abiosoft commented 2 years ago

I am noticing same behaviour, I get same error output when attempting to start vde_vmnet manually. And the vde_vmnet output looks like a fatal error

Initializing vmnet.framework (mode 1001)
start(): vmnet_return_t VMNET_FAILURE
start: Undefined error: 0

It is working fine for me again. I am still not sure how to reproduce this but I suspect it is related to network connections.

spkane commented 2 years ago

host and bridged networking seems to work fine, but shared is still exhibiting this issue consistently for me.

alazycoder101 commented 1 year ago

It's still happening to me as well with M1 shared won't work. But it's working with bridged.

❯ sudo /opt/homebrew/Cellar/socket_vmnet/1.1.1/bin/socket_vmnet --pidfile=/private/var/run/lima/shared_socket_vmnet.pid --socket-group=everyone --vmnet-mode=shared --vmnet-gateway=192.168.105.1 --vmnet-dhcp-end=192.168.105.254 --vmnet-mask=255.255.255.0 /private/var/run/lima/socket_vmnet.shared
Initializing vmnet.framework (mode 1001)
start(): vmnet_return_t VMNET_FAILURE
start: No such process