lima-vm / lima-vm/lima

Failed to start VM when I want to modify PATH env var from env section in yaml template

Open
#2,470 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Go
Stars
21.9k
Forks
957
Avg merge
2d 6h
Merged PRs (30d)
53

Description

### Description

Hello!

I try to use this in my yaml template:
```
env:
PATH: /custom/bin:"${PATH}"
```

But it is not working and the `limactl start` fails with this error:
```
INFO[0552] [hostagent] Waiting for the essential requirement 2 of 2: "user session is ready for ssh"
INFO[0592] [hostagent] Waiting for the essential requirement 2 of 2: "user session is ready for ssh"
FATA[0620] did not receive an event with the "running" status
```

After a little investigation I found this entry in `/var/log/cloud-init-output.log`:
```
+ exec /mnt/lima-cidata/boot.sh
/mnt/lima-cidata/boot.sh: 24: sed: not found
2024-07-05 18:45:11,410 - cc_scripts_per_boot.py[WARNING]: Failed to run module scripts_per_boot (per-boot in /var/lib/cloud/scripts/per-boot)
2024-07-05 18:45:11,410 - util.py[WARNING]: Running module scripts_per_boot () failed
Cloud-init v. 24.1.3-0ubuntu3.3 finished at Fri, 05 Jul 2024 18:45:11 +0000. Datasource DataSourceNoCloud [seed=/dev/vdb][dsmode=net]. Up 7.02 seconds
```

I checked a little the `boot.sh` probably this part can fail I think: https://github.com/lima-vm/lima/blob/44f4e5d8c4a46767e4ebc14025a9fc6670674d4c/pkg/cidata/cidata.TEMPLATE.d/boot.sh#L16-L26

I'm new so I'm open for better solutions to modify the `PATH` var instead of using `env` section.
Thanks in advance!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.