`multipass get` command (preview)

See also: get & set keys

[not available yet]

The multipass get command provides a way to obtain Multipass’s settings. For example:

$ multipass get local.driver

Available settings are documented in the reference.

When used without arguments, it displays all available settings as a list of <key>=<value> pairs:

$ multipass get

With the --keys option, it lists only settings keys:

$ multipass get --keys

In all cases, get returns only settings that are available at the moment when it is executed.

This command can also be given positional arguments, restricting what settings are to be retrieved. Such arguments can take the form of either plain keys (e.g. client.primary-name) or key wildcards (e.g. local.*).

multipass get filters the settings according to the positional arguments it is given, returning only the subset of available settings that satisfy them:

$ multipass get client.gui.*
$ multipass get client.gui.* local.driver

When only one setting satisfies the input arguments, its key is omitted and only its value is printed, unless --keys is also provided (in which case only the key is printed, still):

$ multipass get client.gui.autostart

If no setting matches the arguments, multipass will complain that it cannot recognize the settings key(s).

With the --raw option, values are printed in raw format. For now this affects only the representation of empty values:

$ multipass get --raw client.primary-name

$ multipass get client.primary-name

Use multipass help get for a quick reference:

$ multipass help get
Usage: multipass get [options] [<arg> ...]
Get the configuration setting(s) corresponding to the given key(s), or all settings if no key is specified.

Some common settings keys are:
  - client.gui.autostart
  - local.driver
  - local.privileged-mounts

Use `multipass get --keys` to obtain the full list of available settings at any given time.

  -h, --help     Display this help
  -v, --verbose  Increase logging verbosity. Repeat the 'v' in the short option
                 for more detail. Maximum verbosity is obtained with 4 (or more)
                 v's, i.e. -vvvv.
  --raw          Output in raw format. For now, this affects only the
                 representation of empty values (i.e. "" instead of "<empty>").
  --keys         List available settings keys. This outputs the whole list of
                 currently available settings keys, or a matching subset when
                 <arg>... is(are) provided

  arg            Setting(s) key(s), i.e. path(s) to the setting(s) whose
                 configured value(s) should be obtained.

% multipass get local.driver


Unable to read settings: access error (consider running with an administrative role)

Why do I need to sudo this command?

This is a caveat of our current implementation of settings. Daemon settings are kept in a root-owned file, which the multipass client accesses directly.

We now have a new implementation where no sudo is needed anymore, because the settings are routed to and from the daemon. But it hasn’t been released yet.

1 Like

Ah. Thank you Ricardo. I’ll be waiting for the new release to drop.