abiosoft / abiosoft/colima

Host resolution issue with Vpn

Ouverte
#917 7 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Go
Étoiles
30.8k
Forks
613
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### 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_

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
docker, go
Domaine
cli, networking
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
55/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.