colima icon indicating copy to clipboard operation
colima copied to clipboard

Disabling $HOME mounts by setting `mounts:` causes startup failure

Open minaguib opened this issue 10 months ago • 0 comments

Description

I'm not interested in sharing my $HOME inside colima. There's no dedicated setting to do this (here), so I created a single dummy directory and specified it in mounts:

mounts:
  - location: /tmp/dummy
    writable: false

With that done, colime start errors out:

Minas-MacBook-Pro:~ mina$ colima start
INFO[0000] starting colima
INFO[0000] runtime: containerd+k3s
INFO[0001] starting ...                                  context=vm
INFO[0012] provisioning ...                              context=containerd
INFO[0012] starting ...                                  context=containerd
INFO[0013] provisioning ...                              context=kubernetes
FATA[0013] error provisioning kubernetes: error running [lima cp /Users/mina/Library/Caches/colima/caches/d1fde740381c6327fa2e71adbd627d1f4aeb3ad7931a6ddb02fd55cfbd489ad9 /tmp/k3s-install.sh], output: "cp: cannot stat '/Users/mina/Library/Caches/colima/caches/d1fde740381c6327fa2e71adbd627d1f4aeb3ad7931a6ddb02fd55cfbd489ad9': No such file or directory", err: "exit status 1"

It appears that colima might have a hard requirement on $HOME being mounted inside the container to pass some files

As a compromise I settled on this which works okay:

mounts:
  - location: /Users/mina/Library/Caches/
    writable: false

Version

No response

Operating System

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

Output of colima status

$ colima status
INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: containerd
INFO[0000] mountType: virtiofs
INFO[0000] address: 192.168.107.2
INFO[0000] kubernetes: enabled

Reproduction Steps

  1. Override "mounts" to a setting that does not mount $HOME
  2. Start colima

Expected behaviour

Colima should start without errors

Additional context

No response

minaguib avatar Apr 01 '24 20:04 minaguib