Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add {{.Temp}} variable to host templates #3318

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jandubois
Copy link
Member

@jandubois jandubois commented Mar 8, 2025

Note

For discussion purposes; would need to apply changes to all templates if accepted.

See #2339 (comment) and #3316.

Allows writing the /tmp/lima mount as

mounts:
- location: "{{.Temp}}/lima"
  mountPoint: /tmp/lima

Note that on macOS this would use $TMPDIR and not /tmp, so would be a change in behaviour. It would not affect existing instances though.

Allows writing the temp mount as

mounts:
- location: "{{.Temp}}/lima"
  mountPoint: /tmp/lima

Note that on macOS this would use $TMPDIR and not /tmp, so would be a change
in behaviour. It would not affect existing instances though.

Signed-off-by: Jan Dubois <[email protected]>
@jandubois jandubois force-pushed the location-template branch from 89857c8 to 1f6fd20 Compare March 8, 2025 02:31
@afbjorklund
Copy link
Member

afbjorklund commented Mar 8, 2025

Do you need to model "the real" $TMPDIR, or should it be something like $LIMA_TEMP instead?

One concern was that there are many users sharing the /tmp/lima location, on a shared server.

@arixmkii
Copy link
Contributor

arixmkii commented Mar 8, 2025

This made default.yaml compatible with Windows. I managed to create and start VM w/o changes to template.

Output of the mount command:

C:\msys64\home\Arthu\gitrepos\lima\_output\bin>limactl shell default mount | find "sshfs"
time="2025-03-08T20:21:48+02:00" level=warning msg="treating lima version \"e0487475.m\" from \"C:\\\\Users\\\\Arthu\\\\.lima\\\\default\\\\lima-version\" as very latest release"
bash: line 1: cd: /mnt/c/msys64/home/Arthu/gitrepos/lima/_output/bin: No such file or directory
:/mnt/c/Users/Arthu on /mnt/c/Users/Arthu type fuse.sshfs (ro,nosuid,nodev,relatime,user_id=1000,group_id=1000,allow_other)
:/mnt/c/Users/Arthu/AppData/Local/Temp/lima on /tmp/lima type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000,allow_other)

The /mnt/ prefixes come from WSL2 Alpine tools container (wslpath instead of cygpath), which I use for running QEMU. I'm yet to figure out required fixes to run it with Git bash msys2 stack (mux modes are not supported in msys2 OpenSSH).

@arixmkii
Copy link
Contributor

arixmkii commented Mar 8, 2025

9p mounts

C:\msys64\home\Arthu\gitrepos\lima\_output\bin>limactl shell default mount | find "9p"
time="2025-03-08T20:36:53+02:00" level=warning msg="treating lima version \"e0487475.m\" from \"C:\\\\Users\\\\Arthu\\\\.lima\\\\default\\\\lima-version\" as very latest release"
bash: line 1: cd: /mnt/c/msys64/home/Arthu/gitrepos/lima/_output/bin: No such file or directory
mount0 on /mnt/c/Users/Arthu type 9p (ro,relatime,cache=8f,access=client,msize=131072,trans=virtio)
mount1 on /tmp/lima type 9p (rw,relatime,cache=5,access=client,msize=131072,trans=virtio)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants