runfinch / finch

The Finch CLI is an open source client for container development
https://www.runfinch.com
Apache License 2.0
3.48k stars 88 forks source link

[Windows] Support Finch on Windows with WSL2 in "mirrored" networkMode #792

Open ollypom opened 5 months ago

ollypom commented 5 months ago

What is the problem you're trying to solve?. With Finch on Windows if the user has WSL configured in networkingMode=mirrored then a finch vm init will fail. It appears finch / limactl is unable to create a SSH connection to the VM.

The C:\Program Files\Finch\lima\data\finch\ha.stderr.log shows repeated SSH timeouts:

{
    "level": "info",
    "msg": "Waiting for the essential requirement 1 of 2: \"ssh\"",
    "time": "2024-02-02T09:52:49Z"
}
{
    "level": "debug",
    "msg": "executing script \"ssh\"",
    "time": "2024-02-02T09:52:49Z"
}
{
    "level": "debug",
    "msg": "executing ssh for script \"ssh\": C:\\Program Files\\Finch\\lima\\bin\\ssh.exe [ssh -F /dev/null -o IdentityFile='C:/Program Files/Finch/lima/data/_config/user' -o IdentityFile='C:\\Users\\myuser\\.ssh\\id_ecdsa' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=^aes128-gcm@openssh.com,aes256-gcm@openssh.com -o User=lima -o ControlMaster=auto -o ControlPath='C:/Program Files/Finch/lima/data/finch/ssh.sock' -o ControlPersist=yes -p 22 192.168.2.19 -- /bin/bash]",
    "time": "2024-02-02T09:52:49Z"
}
{
    "level": "debug",
    "msg": "stdout=\"\", stderr=\"ssh: connect to host 192.168.2.19 port 22: Connection timed out\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"ssh: connect to host 192.168.2.19 port 22: Connection timed out\\r\\n\": exit status 255",
    "time": "2024-02-02T09:53:10Z"
}

Describe the feature you'd like Support Finch on Windows with WSL2 in "mirrored" networkMode

Additional context Finch on Windows