Replies: 3 comments
-
|
I noticed I can use an override such as this in mounts:
- location: "~/VM-Shared/Home"
mountPoint: "/Users/{{.User}}"
writable: trueIt works on initial start, but not anymore on restarts, and it's still mounting both (just the override one after the default one). I would like to actually disable the default mount: Initial start: $ mount | grep /Users
mount2 on /Users/metachris type virtiofs (ro,relatime)
mount4 on /Users/metachris type virtiofs (rw,relatime)After restart: |
Beta Was this translation helpful? Give feedback.
-
|
The best way I found so far is to start an instance based on a raw yaml from the Using a mounts:
- location: "~/VM-Shared"
mountPoint: "/Users/{{.User}}"
writable: true |
Beta Was this translation helpful? Give feedback.
-
|
I also ran into this and the culprit was using base templates (e.g. base:
- template:_images/alpineInstead of Then I added the mounts I actually wanted: mounts:
- location: "/path/to/something"
mountPoint: "/data/something"
writable: trueExample without fix: zp@Zoltans-Mac-mini % pwd
/Users/zp/Repos/GitHub/reponame/
zp@Zoltans-Mac-mini % limactl shell vmname
lima-vmname:/Users/zp/Repos/GitHub/reponame$ cat fileonhost.txt
sensitiveinfoExample with fix: zp@Zoltans-Mac-mini % pwd
/Users/zp/Repos/GitHub/reponame/
zp@Zoltans-Mac-mini % limactl shell vmname
/bin/ash: cd: line 0: can't cd to /Users/zp/Repos/GitHub/reponame/: No such file or directory
/bin/ash: cd: line 0: can't cd to /Users/zp: No such file or directory
lima-vmname:~$ pwd
/home/vmusername.guest
lima-vmname:~$ exit
zp@Zoltans-Mac-mini % limactl stop vmname
INFO[0000] Sending SIGINT to hostagent process 66846
...
INFO[0003] The instance vmname has shut down
zp@Zoltans-Mac-mini % limactl start vmname
INFO[0000] Using the existing instance "vmname"
...
INFO[0031] READY. Run `limactl shell vmname` to open the shell.
zp@Zoltans-Mac-mini % limactl shell vmname
/bin/ash: cd: line 0: can't cd to /Users/zp/Repos/GitHub/reponame/: No such file or directory
/bin/ash: cd: line 0: can't cd to /Users/zp: No such file or directory
lima-vmname:~$ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to disable the default home directory sharing, as it's a security risk for many use-cases. What would also work is reliably sharing a custom directory to always be bound to
/Users/{{.User}}inside the VM, and it should work across restarts.I couldn't find a way to do this. I tried using
.lima/_config/default.yamlas well asoverride.yamlbut they still seem to get overwritten with the default home mount anyway, at least after restart.Is there a way to remove or customize the default home directory sharing?
Beta Was this translation helpful? Give feedback.
All reactions