-
Notifications
You must be signed in to change notification settings - Fork 711
-
Relatively new to lima here. I use lima to run some Debian Linux dev VMs on MacOS, and few observations appear a bit confusing to my newbie eyes. Would be nice if someone could share some explanation. Let's say that my username on MacOS is "alan".
On the MacOS host, I have this folder: "/Users/alan/Work", which contains a few dev project I've worked on natively in MacOS. I've added a "vz" type Debian Linux VM on lima and when I login to this VM using limactl shell <vmname>
, by default I am placed in "/Users/alan" folder inside the VM. If I do cd $HOME
, it takes me to "/home/alan.linux" folder, which has the "Work" folder (same as "/Users/alan/Work" from the host). This is what is totally confusing me. I have some scripts that use $HOME, so the behaviour is throwing them off. And what is that folder where I landed when I logged in with limactl shell <vmname>
.
The "lima.yaml" relevant section is:
mounts:
- location: ~/work # Example: Mount your host's work directory
writable: true
- location: /tmp/lima
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 2 replies
-
Lima attempts to be transparent to the user, which is why by default it mounts your host directory under the same path inside the VM. The result is that when you execute lima
on the host, it shells into the corresponding path inside the guest.
In your case this means that /Users/alan/Work
is mounted under /Users/alan/Work
inside the VM.
If you want to override this, you can use the mountPoint
attribute to specify the mount location:
mounts:
- location: "~/work"
mountPoint: "{{.Home}}/work"
writable: true
P.S. You can find a lot of the missing docs in the default.yaml
template.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you, that does clarify a lot. Also thanks for the links.
Beta Was this translation helpful? Give feedback.
All reactions
-
This should be covered in the documentation, "starting a couple of VMs" is not the most typical use case - but should be covered
It seems to mostly be about host home versus guest home?
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you. This is a lot clearer now. Would be good to be able to find this answer in docs or at least the FAQ.
Beta Was this translation helpful? Give feedback.