Skip to content

Add feature to keep mounts with plain mode #3748

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

afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented Jul 18, 2025

Allows using e.g. virtiofs in plain mode, without needing the guestagent etc.

But only for default mount type, since "reverse-sshfs" still needs non-plain.

Closes #3747

Discussion #3734

@afbjorklund afbjorklund requested a review from AkihiroSuda July 18, 2025 07:59
@@ -555,6 +555,10 @@ guestInstallPrefix: null
# 🟢 Builtin default: false
plain: null

# Keep the mounts, in "plain" mode.
# 🟢 Builtin default: false
plainMounts: null
Copy link
Member

Choose a reason for hiding this comment

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

I fear the explosion of plainFoo, plainBar, plainFooBar properties.

Can we rather introduce guestAgent.enabled: false that will just disable the guest agent without affecting mounts

Copy link
Member Author

Choose a reason for hiding this comment

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

The ask was only to be able to do virtiofs mounts with vz, without the guestagent (which is doable with this)

Copy link
Member Author

Choose a reason for hiding this comment

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

But currently this is not related to the guestagent at all, just that enabling Plain will wipe out the Mounts

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.

Allows using e.g. virtiofs, without needing the guestagent.

But only for default mounts, reverse-sshfs still needs it.

Signed-off-by: Anders F Björklund <[email protected]>
@afbjorklund
Copy link
Member Author

The flag could also be different. Perhaps related to mount?

      --mount-none          [limactl create] Remove all mounts
      --mount-keep          [limactl create] Keep mounts in plain mode

Or keep them by default, and require --plain --mount-none

Some templates (like k8s) do an explicit mounts: [] up front...

@msimkunas
Copy link

How about --plain --with-mounts?

One other alternative is to replace --plain and allow the user to disable specific features, e.g. --disable-mounts, --disable-port-forwarding, etc. but that would probably be too disruptive.

Or, you could support multiple --disable-* flags and keep --plain as a metaflag that applies all --disable-* flags but this is getting pretty complicated.

@msimkunas
Copy link

In any case, users may want to use --plain but enable port forwarding or just mounting. If you anticipate that in the future more exemption flags may be needed (not just --with-mounts) perhaps it is better to think about dedicated flags and treat --plain as an alias/metaflag that applies multiple flags at once

@afbjorklund
Copy link
Member Author

Having both --mounts (string) and --with-mounts (bool) is a little vague, and would --with-mounts=false be the same as --mount-none? Hmm

@afbjorklund
Copy link
Member Author

afbjorklund commented Jul 18, 2025

treat --plain as an alias/metaflag that applies multiple flags at once

We could convert plain from a boolean to a struct, like we did with disk, but I hoped that it wouldn't be needed (complicates the yaml parsing and schema)

@msimkunas
Copy link

@afbjorklund hence my other suggestion to introduce --disable-* flags for disabling specific features. --plain could then just be an alias for multiple such commands, e.g. --disable-mounts --disable-port-forwarding ...

@afbjorklund
Copy link
Member Author

afbjorklund commented Jul 18, 2025

All the other options do require the guestagent, though. Maybe not the timezone, but.

There is also another setting, "copy the user account", that is currently always enabled.

But this got a bit complicated, it was only about the Mounts specifically


func fixUpForPlainMode(y *LimaYAML) {
        if !*y.Plain {
                return
        }
        y.Mounts = nil
        y.PortForwards = nil
        y.Containerd.System = ptr.Of(false)
        y.Containerd.User = ptr.Of(false)
        y.Rosetta.BinFmt = ptr.Of(false)
        y.Rosetta.Enabled = ptr.Of(false)
        y.TimeZone = ptr.Of("")
}

@AkihiroSuda
Copy link
Member

--disable-<FEAT> is inconsistent with the existing --FEAT=(true|false) flags.

So my suggestion is to introduce --guestagent=(true|false) (default: false) if we want a CLI flag.
Maybe it should rather be set via the YQ syntax (--set '.guestagent.enabled=false').

@afbjorklund
Copy link
Member Author

afbjorklund commented Jul 18, 2025

I think we changed a bit away from "plain", and over to specific flags for the guestagent?

And we didn't quite explain what the guestagent is in the first place, or when you need it

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.

Plain mode, with mounts
3 participants