`multipass launch` command

The multipass launch command without any argument will create and start a new instance based on the default image, using a random generated name; for example:

…
Launched: relishing-lionfish

You can then shell into an instance by its name:

multipass shell relishing-lionfish

The only, optional, positional argument is the image to launch an instance from. See find for how to find information on the available images.

It’s also possible to provide a full URL to the image (use file:// for an image available on the host running multipassd).

You can change the resources made available to the instance by passing the --cpus, --disk or --memory options, changing the allocated CPU cores, disk space or RAM, respectively.

If you want your instance to have a name of your choice, use the --name option. The instance name has to be unique and conform to a specific instance name format.

By passing a filename or an URL to --cloud-init, you can provide user data to cloud-init to customize the instance on first boot. See cloud-init documentation for examples.

Use the --network option to create an instance with additional network interfaces.

Passing --bridged and --network bridged are shortcuts to --network <name>, where <name> is configured via multipass set local.bridged-interface.

You can also mount folders in the instance after it is launched using the --mount option. It can be specified multiple times, with different mount paths.

Use the --timeout option to change how long Multipass waits for the machine to boot and initialize.


The full multipass help launch output explains the available options:

Usage: multipass launch [options] [[<remote:>]<image> | <url>]
Create and start a new instance.

Options:
  -h, --help                            Displays help on commandline options
  -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.
  -c, --cpus <cpus>                     Number of CPUs to allocate.
                                        Minimum: 1, default: 1.
  -d, --disk <disk>                     Disk space to allocate. Positive
                                        integers, in bytes, or decimals, with K,
                                        M, G suffix.
                                        Minimum: 512M, default: 5G.
  -m, --memory <memory>                 Amount of memory to allocate. Positive
                                        integers, in bytes, or decimals, with K,
                                        M, G suffix.
                                        Minimum: 128M, default: 1G.
  -n, --name <name>                     Name for the instance. If it is
                                        'primary' (the configured primary
                                        instance name), the user's home
                                        directory is mounted inside the newly
                                        launched instance, in 'Home'.
                                        Valid names must consist of letters,
                                        numbers, or hyphens, must start with a
                                        letter, and must end with an
                                        alphanumeric character.
  --cloud-init <file> | <url>           Path or URL to a user-data cloud-init
                                        configuration, or '-' for stdin
  --network <spec>                      Add a network interface to the
                                        instance, where <spec> is in the
                                        "key=value,key=value" format, with the
                                        following keys available:
                                         name: the network to connect to
                                        (required), use the networks command for
                                        a list of possible values, or use
                                        'bridged' to use the interface
                                        configured via `multipass set
                                        local.bridged-network`.
                                         mode: auto|manual (default: auto)
                                         mac: hardware address (default:
                                        random).
                                        You can also use a shortcut of "<name>"
                                        to mean "name=<name>".
  --bridged                             Adds one `--network bridged` network.
  --mount <local-path>:<instance-path>  Mount a local directory inside the
                                        instance. If <target> is omitted, 
                                        the mount point will be under 
                                        /home/ubuntu/<source-dir>, where 
                                        <source-dir> is the name of the 
                                        <source> directory.
  --timeout <timeout>                   Maximum time, in seconds, to wait for
                                        the command to complete. Note that some
                                        background operations may continue
                                        beyond that. By default, instance
                                        startup and initialization is limited to
                                        5 minutes each.

Arguments:
  image                                 Optional image to launch. If omitted,
                                        then the default Ubuntu LTS will be
                                        used.
                                        <remote> can be either ‘release’ or
                                        ‘daily‘. If <remote> is omitted,
                                        ‘release’ will be used.
                                        <image> can be a partial image hash or
                                        an Ubuntu release version, codename or
                                        alias.
                                        <url> is a custom image URL that is in
                                        http://, https://, or file:// format.

Errors or typos? Topics missing? Hard to read? Let us know or open an issue on GitHub.

8 posts were split to a new topic: Launch and --cloud-init on Windows

multipass launch执行报错了
错误信息不能连接multipass socket,请问是什么原因导致的?

On MacOS I get “launch failed: http and file based images are not supported” when trying to use a custom image I built with Packer using your documentation here: Building Multipass images with Packer. This works great on Ubuntu and CircleCI and I’m surprised doesn’t work on MacOS as your documentation doesn’t state there is a limitation in using file:// based images on MacOS.

Hi,

is it possible to change the VM resources once it’s created? I have microk8s VM instance and need to add additional core to the VM. It’s possible to add this resource without re-creating whole VM?

Lumir

Hi @jas02, that’s something we are working on right now and we intend to offer a proper way to do that soon. In the mean time, there are hacky ways that reach behind the scenes to achieve it. Have a look at this issue.

In the online documentation it is mentioned that the --mount option exists. However, for OSX multipass does not have that option. This also agrees with the built-in help which does not show a --mount option.

Version:
multipass 1.9.1+mac
multipassd 1.9.1+mac

Hi @johan162,

That option was recently added to the development version of Multipass and will be included in the upcoming 1.10 release. I’ll update the documentation to reflect the version this is being introduced in. Sorry for the confusion!

In the following paragraph:

You can change the resources made available to the instance by passing any of --cpu , --disk , --memory options, allowing for more CPU cores, disk space or RAM, respectively.

--cpu should be --cpus

Good catch, @itecompro! It’s fixed now. Thanks!

1 Like

Hi Team :slight_smile:

I’m using multipass in a tutorial and want to provide the minimum specs for launching a Noble image. When I use the minimum disk and memory sizes quoted above (512M and 128M respectively) it fails to launch with the following error:

launch failed: Requested disk (536870912 bytes) below minimum for this image (3758096384 bytes)

I didn’t realise the minimum specs are image-specific - it might be helpful to have those listed (or linked from this page).

Hi @sally-makin ! It’s a great suggestion, in fact we’re working to include information on the minimum system requirements for Multipass VMs in our docs. We’ll make sure to include them in this page as well.

1 Like

That sounds great, thanks!