abiosoft / abiosoft/colima

macOS 14 VM Type VZ / Virtiofs - SSH agent forward fails after colima stop / start (if container with agent was still running)

Aperta
#942 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
30.8k
Fork
613
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Description

If I run a docker compose project where one service forwards the ssh agent into the container using `/run/host-services/ssh-auth.sock`, and before doing a colima stop, the project / service is not stopped, after a colima start the agent is not forwarded to the container correctly and it will fail with a connection refused.

This can be fixed by stopping all containers that use a SSH agent, stopping colima and restarting it.

Using `colima ssh` I did some checks and it seems that in the case where the issue occurs, `/run/host-services/ssh-auth.sock` is not a symlink to the agent file but a folder that contains a symlink to the agent.

manually removing that folder and creating a symlinks to the real agent file also fixes the issue.

### Version

colima version 0.6.7
git commit: ba1be00e9aec47f2c1ffdacfb7e428e465f0b58a

runtime: docker
arch: x86_64
client: v24.0.7
server: v24.0.7
limactl version 0.19.1
qemu-img version 8.2.0
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers

### Operating System

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

### Output of `colima status`

INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: x86_64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs

### Reproduction Steps

see description

### Expected behaviour

it should always correctly forward the agent.

### Additional context

Created the base image using 0.6.6 as with 0.6.7 I have this issue: https://github.com/abiosoft/colima/issues/930

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Il problema riguarda l'inoltro dell'agent SSH nella virtualizzazione macOS di Colima (Virtiofs). Inizia esaminando il codice che configura il symlink /run/host-services/ssh-auth.sock nella VM, probabilmente nella gestione dei mount Virtiofs. Controlla la gestione del ciclo di vita durante colima stop/start per capire perché viene creata una directory invece di un symlink quando ci sono ancora container in esecuzione. Riproduci il bug seguendo i passaggi nella descrizione, quindi esamina i file rilevanti nella codebase di colima per comprendere la logica di configurazione del socket.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, docker-compose, go, macos, shell
Ambito
cli, developer-experience, devops
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
50/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.