abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
17.73k stars 364 forks source link

Setting LIMA_WORKDIR breaks `colima start` #1048

Open bparker98 opened 1 week ago

bparker98 commented 1 week ago

Description

When you have LIMA_WORKDIR set to a path that is not in the colima VM, it breaks running colima start

For example:

INFO[0000] starting colima                              
INFO[0000] runtime: docker                              
INFO[0000] creating and starting ...                     context=vm
WARN[0025] error caching dependencies for mantic-debs: error retrieving OS version from vm: error running [lima sh -c grep "^UBUNTU_CODENAME" /etc/os-release | cut -d= -f2], output: "bash: line 1: cd: /home/eabrpar.linux/git: No such file or directory", err: "exit status 1"  context=vm
WARN[0025] falling back to normal package install        context=vm
> bash: line 1: cd: /home/eabrpar.linux/git: No such file or directory
FATA[0026] error starting vm: error at 'creating and starting': error installing packages using mantic-debs: exit status 1 

Unsetting LIMA_WORKDIR fixes the issue.

Colima should probably unset LIMA_WORKDIR to prevent this from causing issues.

Version

colima version 0.6.9 git commit: c3a31ed05f5fab8b2cdbae835198e8fb1717fd0f limactl version 0.22.0 qemu-img version 9.0.1 Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers

Operating System

Output of colima status

❯ colima status FATA[0000] error retrieving current runtime: empty value

Reproduction Steps

LIMA_WORKDIR=/home/username.linux/git colima start --cpu 6 --memory 8 --mount-type virtiofs --vm-type=vz --vz-rosetta

Expected behaviour

I expect the colima vm to start

Additional context

No response