Comments (6)
One possible solution is that "/tmp/lima" is the placeholder, and replace it with $TMPDIR/lima.
i.e. something like filepath.Join(os.TempDir(), "lima")
, so that it works also on Windows
systemd would try to use some complex scheme:
https://systemd.io/TEMPORARY_DIRECTORIES/
But it should be optional (opt-in), since it breaks things.
https://0pointer.de/blog/projects/tmp.html re: /tmp
from lima.
I'm not a fan of making /tmp/lima
"magical" and replacing it with a different location at VM start. I would rather add support for templating, so you could write something like this:
- location: "{{.Temp}}/lima"
mountPoint: /tmp/lima
create: true
writable: true
Where {{.Temp}}
would be os.TempDir()
evaluated at the start of the instance.
The create
property would tell Lima to create the location
if it doesn't exist. Maybe we don't need it, and we should always create non-existing locations, but having a separate setting feels safer. That way we can just drop mounts whose locations don't exist on the host. We should already be doing that, but I haven't checked.
I don't know what other template variables would make sense; we can add {{.Home}}
, but it would be redundant with the special handling of ~
that already exists. Maybe {{.Cache}}
and {{.Config}}
for os.UserCacheDir()
and os.UserConfigDir()
?
We could add access to the host environment with something like {{.Env.LIMA_TEMP}}
, but I would wait until we have an actual use-case.
I don't see a need for LIMA_TEMP
; you can just set TMPDIR
or TEMP
before calling limactl
and get the same effect.
from lima.
Using TMPDIR will break under macOS, with the default setup and the default mounts.
Since it is generated under
/var/folders
by default, but that location is not mounted...
I'm not sure what point you are trying to make. If you use it as the location
for the /tmp/lima
mount point, then it will be mounted for you...
Or are you saying that you can't mount paths under $TMPDIR
into containers running inside an instance because the directory isn't mounted. That is true; the user would need to add that mount point themselves.
FWIW, Rancher Desktop mounts /private/var/folders
into the instance for this reason.
Side note:
/tmp
is a symlink to /private/tmp
/var
is also a symlink to /private/var
...
from lima.
Using TMPDIR will break under macOS, with the default setup and the default mounts.
Since it is generated under /var/folders
by default, but that location is not mounted...
Side note: /tmp
is a symlink to /private/tmp
But /tmp/lima still works, because of symlink.
from lima.
It would to use something like $LIMA_TEMP
.
https://lima-vm.io/docs/dev/internals/
Then you could set LIMA_TEMP=$TMPDIR/lima
i.e. similar to overriding LIMA_HOME=$HOME/.lima
from lima.
The mounts should be OK, it was a reflection on the TMPDIR (like that issue about it being not absolute in Windows)
Will leave /tmp/lima, and see if something can be templates instead.
from lima.
Related Issues (20)
- chmod failed when `mountInotify` is enabled HOT 1
- chmod failed when `mountInotify` is enabled HOT 5
- lima examples missing image HOT 1
- [hostagent] Driver stopped due to error: \"usernet unable to resolve IP for SSH forwarding\"
- Provide standard values "default" and "none" for most options HOT 1
- Cross-compiler for building "darwin" target HOT 5
- Failed to start VM when I want to modify PATH env var from env section in yaml template HOT 1
- Error: msg="did not receive an event with the \"running\" status" HOT 2
- Lima VM will randomly lose network connectivity HOT 5
- Call `limadriver.Validate` as part of `limayaml.Validate` HOT 2
- v0.23.0 planning HOT 4
- Inconsistent {{.Home}} and {{.User}} values between guest and host templates HOT 2
- Bound ports are not released immediately when container is stopped/deleted HOT 10
- Figure out why archlinux CI is broken HOT 2
- nerdctl start fails 2 of 3 times with bridge errors HOT 2
- Dependabot wasn't able to update downloading
- cross-vm network connectivity issue when using socket_vmnet
- Lima fails to install on fedora 40 using homebrew HOT 1
- docker build using colima with lima v0.23.1 hangs HOT 2
- guest agent events closed unexpectedly error="rpc error: code = Unavailable desc = error reading from server: EOF" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lima.