lima-vm / lima-vm/lima

Lima instance does not recover from socket_vmnet restart

Open
#3,020 0 comments 0 reactions 0 assignees View on GitHub
bug component/network/vmnet
Dominant language
Go
Stars
21.9k
Forks
957
Avg merge
2d 6h
Merged PRs (30d)
53

Description

### Description

If we restart socket_vment limactl will fail to forward packets with this log:

```
{"level":"error","msg":"Failed to forward packets from VZ to VMNET: write unix -\u003e/var/run/socket_vmnet: write: broken pipe","time":"2024-12-13T21:29:30+02:00"}
```

From this point the lima0 interface will not receive or send anything since we stopped reading from the the VZ datagram socket and the unix socket connected to socket_vmnet. The only way to recover is to restart the vm.

We can recover from this by changing the forwarding code to reconnect to socket_vment after errors, and start forwarding again. Some packets will be lost, but networking code must be able to recover from lost packets.

This is not easy since we after we get an error on the socket_vmnet socket, we need to stop both io.Copy() goroutines without closing the VZ datagram socketpair. To do this we may need to implement interruptible Copy() instead of using io.Copy().

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.