Skip to content

describe major modes of lima operation #3831

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

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

Conversation

olamilekan000
Copy link
Contributor

change explains how the Lima operation mode works.

fixes issue

@olamilekan000 olamilekan000 force-pushed the describe-major-modes-of-lima-operation branch 3 times, most recently from 9a07017 to 6c8bbd3 Compare August 14, 2025 00:51
@jandubois
Copy link
Member

No time for a review right now, but I dislike the term "machine mode". I know it comes from the issue that this PR addresses, but most people will not make the connection to "docker-machine" and "podman-machine", and even then might not recognize the implications.

I would suggest that we talk about "integrated mode" (default) vs. "plain mode".

"Integrated" is kind of a long word, so I was looking for alternatives, like "blended mode", "fusion mode", "hybrid mode", "seamless mode", but in the end I think "integrated mode" is the most descriptive one.

What do you think @afbjorklund?

@afbjorklund
Copy link
Member

afbjorklund commented Aug 14, 2025

The machine reference was mostly internal, we can call it something else in the user documentation...

The individual machines created are usually just referred to as "the instances", in Lima. Perhaps even "THE instance", since having more than one is an advanced topic (like the plain mode)

@olamilekan000
Copy link
Contributor Author

The machine reference was mostly internal, we can call it something else in the user documentation...

The individual machines created are usually just referred to as "the instances", in Lima. Perhaps even "THE instance", since having more than one is an advanced topic (like the plain mode)

does integrated or instance mode work?

@jandubois
Copy link
Member

does integrated or instance mode work?

Doesn't work for me because "instance" is just a synonym for "machine", you can have "integrated" or "plain" instances.

Lima already means "Linux Machine", so "Lima machine" doesn't make much sense (like "ATM machine").

We use the terms "template" for just the spec of a machine, and "instance" for an actual implementation that can be run.

So I still think "integrated" (default) and "plain" are the best choices so far.

And no, we are not going to make "plain" the default. As "The Highlander" says: "There can be only one!", and "integrated" was here first. 😛

@olamilekan000 olamilekan000 force-pushed the describe-major-modes-of-lima-operation branch from 6c8bbd3 to ba49971 Compare August 14, 2025 17:22
@afbjorklund
Copy link
Member

We could just call it "default mode", if it is hard to come up with a name.

@jandubois
Copy link
Member

We could just call it "default mode", if it is hard to come up with a name.

"default mode" is not descriptive (how is it different from "plain mode").

I think we should just go with "integrated mode" even though it is a mouthful.

@olamilekan000 olamilekan000 force-pushed the describe-major-modes-of-lima-operation branch from ba49971 to 39c889a Compare August 16, 2025 04:55
@jandubois jandubois added this to the v2.0.0 milestone Aug 16, 2025
Copy link
Member

@afbjorklund afbjorklund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks very good, and I like that tries into explain differences and why/when

https://deploy-preview-3831--lima-vm.netlify.app/docs/usage/operation-modes/

- Reduced background processes in the guest

#### 5. Minimal Host Integration
- User information may still be mirrored for SSH access
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true for now, in the future we might want to add a feature to only use a local user (like "ubuntu", or "lima")

It is a separate feature though, and if it is implemented later on we can just modify this sentence accordingly...

| **Port Forwarding** | ✅ Automatic | ❌ None |
| **Container Engine** | ✅ containerd by default | ❌ None |
| **Guest Agent** | ✅ Running | ❌ Disabled |
| **User Mirroring** | ✅ Full mirroring | ✅ Basic (for SSH) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does look a bit "odd" in the column, we don't actually need the user account in plain mode do we?

- **Configuration Management**: Version control your Lima YAML configurations
- **Testing**: Test your setup in both development and production-like scenarios

## Troubleshooting Common Issues
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAQs should be consolidated into https://lima-vm.io/docs/faq/ ?

- **Integrated Mode (Default)**: Best for development workflows with seamless host-guest integration
- **Plain Mode**: Best for traditional VM usage with explicit control and better isolation

Choose the mode that best fits your security requirements, workflow preferences, and integration needs. You can always switch between modes by modifying your Lima configuration file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can always switch between modes by modifying your Lima configuration file.

I don't think you can switch an integrated mode into a plain mode in this way

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did ChatGPT or something write this section?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My money is on Claude Sonnet. 😄 (I recognize the style because I just used it last week to write a larger set of reference docs, and both the formatting and document structure closely resembles what it generated for me).

- **Resource Monitoring**: Monitor CPU, memory, and disk usage
- **Regular Maintenance**: Keep the guest OS and packages updated
- **Configuration Management**: Version control your Lima YAML configurations
- **Testing**: Test your setup in both development and production-like scenarios
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too verbose and sounds like out of the topic of the "operation modes".

- **Review Mounted Directories**: Be aware of what host directories are accessible
- **Use Read-Only Mounts**: Keep the home directory read-only unless you need to write
- **Monitor Port Forwarding**: Be aware of which ports are being forwarded
- **Regular Updates**: Keep the guest agent and container engines updated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guest agent and nerdctl are automatically kept updated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, this goes for Docker and Podman as well


### For Plain Mode
- **Explicit Configuration**: Document all manual configurations you make
- **Security Review**: Regularly audit what access the VM has to host resources
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rather sounds like a practice for integrated mode


### Key Features of Integrated Mode

#### 1. User Mirroring
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not specific to integrated mode

- Network services running in the guest become accessible from the host

#### 4. Container Engine Integration
Lima can automatically install and configure container engines:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#### 4. Container Engine Integration
Lima can automatically install and configure container engines:

- **containerd**: Installed by default in user mode (rootless)
Copy link
Member

@AkihiroSuda AkihiroSuda Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"user mode" sounds like the antonym of the "kernel mode"

A guest agent runs inside the VM to:
- Manage port forwarding
- Handle file system mounts
- Coordinate host-guest integration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What integration?

- Manage port forwarding
- Handle file system mounts
- Coordinate host-guest integration
- Provide status information
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What status?

- **Container Development**: When you need Docker/Podman/containerd with host integration
- **Development Workflows**: When you want to edit files on the host but run them in Linux
- **Cross-platform Development**: When developing Linux applications on macOS/Windows
- **CI/CD Testing**: When you need a Linux environment that integrates with host tools
Copy link
Member

@AkihiroSuda AkihiroSuda Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather use the plain mode for CI to run "normal" Ubuntu that is usually seen on non-Lima environments.

See also https://lima-vm.io/docs/examples/gha/#plain-mode

Integrated mode is ideal for:
- **Container Development**: When you need Docker/Podman/containerd with host integration
- **Development Workflows**: When you want to edit files on the host but run them in Linux
- **Cross-platform Development**: When developing Linux applications on macOS/Windows
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not specific to integrated mode

| **Port Forwarding** | ✅ Automatic | ❌ None |
| **Container Engine** | ✅ containerd by default | ❌ None |
| **Guest Agent** | ✅ Running | ❌ Disabled |
| **User Mirroring** | ✅ Full mirroring | ✅ Basic (for SSH) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "Full mirroring" ?

| **Container Engine** | ✅ containerd by default | ❌ None |
| **Guest Agent** | ✅ Running | ❌ Disabled |
| **User Mirroring** | ✅ Full mirroring | ✅ Basic (for SSH) |
| **Host Integration** | ✅ Seamless | ❌ Minimal |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "Host Integration"?

Lima's default behavior of mounting the home directory is designed to provide seamless integration similar to Docker Machine or Podman Machine. This design choice:

1. **Enables Seamless Development**: You can edit files on your host with your preferred tools and run them in the Linux environment
2. **Maintains File Ownership**: The UID mirroring ensures files have correct permissions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UID mirroring is kinda broken at least on Apple virtiofs


1. **Enables Seamless Development**: You can edit files on your host with your preferred tools and run them in the Linux environment
2. **Maintains File Ownership**: The UID mirroring ensures files have correct permissions
3. **Reduces Context Switching**: No need to copy files back and forth between host and guest
Copy link
Member

@AkihiroSuda AkihiroSuda Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Context Switching" may sound like talking about kernel/user context switches

1. **Enables Seamless Development**: You can edit files on your host with your preferred tools and run them in the Linux environment
2. **Maintains File Ownership**: The UID mirroring ensures files have correct permissions
3. **Reduces Context Switching**: No need to copy files back and forth between host and guest
4. **Supports Container Workflows**: Container images can access host files for development
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly related to mounting, but could need some clarification

### "Ports aren't being forwarded"
In plain mode, port forwarding is disabled. You need to:
- Add explicit `portForwards` configuration
- Or use plain networking and access the VM's IP directly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "plain networking"?

@AkihiroSuda AkihiroSuda removed this from the v2.0.0 milestone Aug 18, 2025
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably this should be rather under https://lima-vm.io/docs/config/ ?

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this PR is too verbose, contains many misinformation and unclear sentences.

I suggest beginning with a smaller size of PR.

You can use LLM for "brainstorming" and reviewing your draft, but I suggest writing the final submission by your own hands

@AkihiroSuda AkihiroSuda added the documentation Improvements or additions to documentation label Aug 18, 2025

#### 2. No Port Forwarding
- Ports are not automatically forwarded from guest to host
- You must manually configure any port forwarding rules
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#### 2. No Port Forwarding
- Ports are not automatically forwarded from guest to host
- You must manually configure any port forwarding rules
- Network access requires explicit configuration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What network access ?

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

Successfully merging this pull request may close these issues.

Describe the different major modes of Lima operation
4 participants