abiosoft / abiosoft/colima

Host resolution issue with Vpn

Offen
#917 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Go
Sterne
30.8k
Forks
613
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Description

I was facing issues fetching images from organisation registry on VPN, I did a little dig up and figured out somewhat what may be the cause of the issue.

https://github.com/lima-vm/lima/pull/1626

As per this MR, the hostResolver should be false for user-v2 network driver.

However from this line:
https://github.com/abiosoft/colima/blob/af03f48882bfb2ae09eb84dc7167db339d88393b/environment/vm/lima/yaml.go#L77

this will only be false if `network.dnsHost` will have at least one entry.

By default there is no entry and hence this was not working, while I was able to do nslookup, I was not able to make connections with the server.

So I tried to add a dummy entry like:
```
network:
dnsHosts:
host.docker.internal: host.lima.internal
```

and the resolution started working fine. Sorry I am able to not provide much details of what I did here, since I just hacked my way out 😄 but I think this should be fixed and made default behaviors and would close most of the VPN related issues.

### Version

colima version 0.6.6
git commit: 9ed7f4337861931b4d0192ca5409683a4b7d1cdc

runtime: docker
arch: aarch64
client: v24.0.7
server: v24.0.7

### Operating System

- [ ] macOS Intel <= 13 (Ventura)
- [ ] macOS Intel >= 14 (Sonoma)
- [ ] Apple Silicon <= 13 (Ventura)
- [X] Apple Silicon >= 14 (Sonoma)
- [ ] Linux

### Output of `colima status`

INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0000] address: 192.168.107.2
INFO[0000] socket: unix:///Users/anurag.ag/.colima/default/docker.sock

### Reproduction Steps

1. Use openvpn to connect to your organisation vpn on your host machine
2. Try to do curl on any of the internal company url inside the machine and it should not work
3. Add dummy host mapping in the colima.yaml, restart the machine and try again and this time it should work

### Expected behaviour

VM should have VPN accessible even without needing the dummy host entry

### Additional context

_No response_

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

The issue points to environment/vm/lima/yaml.go line 77 where hostResolver is set based on network.dnsHost entries. Examine the Lima integration and network configuration to understand how host resolution works with VPN. Test by modifying the default configuration to set hostResolver appropriately without requiring dummy entries, and verify connectivity inside the VM.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
docker, go
Bereich
cli, networking
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.