LinuxCommandLibrary

podman-machine

Manage virtual machines for Podman

TLDR

List existing machines

$ podman machine ls
copy

Create a new default machine
$ podman machine init
copy

Create a new machine with a specific name
$ podman machine init [name]
copy

Create a new machine with different resources
$ podman machine init --cpus=[4] --memory=[4096] --disk-size=[50]
copy

Start or stop a machine
$ podman machine [start|stop] [name]
copy

Connect to a running machine via SSH
$ podman machine ssh [name]
copy

Inspect information about a machine
$ podman machine inspect [name]
copy

SYNOPSIS

podman machine subcommand [options]
Example: podman machine init
Example: podman machine start my-machine

PARAMETERS

init
    Initializes and creates a new Podman virtual machine.

start
    Starts an existing Podman virtual machine.

stop
    Stops a running Podman virtual machine gracefully.

rm
    Removes one or more Podman virtual machines.

ls
    Lists all configured Podman virtual machines.

ssh
    Connects to a running Podman virtual machine via SSH.

inspect
    Displays detailed configuration and status information about a virtual machine.

set
    Modifies configuration settings of an existing virtual machine.

os
    Manages operating system images used by Podman machines.

--help, -h
    Displays help information for the 'podman machine' command or a specific subcommand.

DESCRIPTION

The podman-machine command is a crucial component of the Podman ecosystem, specifically designed to manage Podman virtual machines (VMs). It provides a lightweight Linux environment for running Podman containers natively on operating systems like macOS and Windows, where Podman cannot run directly on the host. This command handles the entire lifecycle of these VMs, including creation, starting, stopping, removing, and listing them. By abstracting away the underlying virtualization technology (often QEMU), podman-machine offers a streamlined user experience, allowing users to interact with Podman as if it were running natively on their system. It ensures that Podman commands execute within a dedicated, isolated Linux guest, providing compatibility and performance benefits for containerized applications.

CAVEATS

While podman-machine simplifies VM management, it consumes host system resources (CPU, memory, disk). Network configuration within the VM may require understanding of port forwarding or VPNs for external access. On Linux hosts, podman machine can still be used but is often less necessary as Podman runs natively; however, it can provide an isolated environment if desired. The underlying virtualization technology and default operating system (typically Fedora CoreOS or RHEL CoreOS) are generally abstracted but can be configured if advanced customization is needed.

SUBCOMMAND-SPECIFIC OPTIONS

Many podman machine subcommands have their own unique options to customize their behavior. For instance, podman machine init accepts options like --cpus, --disk-size, --memory, and --image to configure the new VM's resources and base operating system. Users should consult the help output for each specific subcommand (e.g., podman machine init --help) to explore all available configuration options.

UNDERLYING TECHNOLOGY

On macOS and Windows, podman-machine typically uses QEMU as the virtualization backend. On Linux, it can optionally use QEMU or a libvirt-based backend. The default guest operating system for the virtual machine is usually Fedora CoreOS or RHEL CoreOS, optimized for container workloads and minimal footprint.

HISTORY

The podman-machine command emerged as Podman's popularity grew beyond Linux, particularly on macOS and Windows. Initially, Podman offered podman remote for connecting to a Podman service running on a separate Linux host. To provide a more integrated and user-friendly experience, podman machine was introduced to automatically manage a local, lightweight Linux virtual machine. This feature gained prominence around Podman 3.0, leveraging lightweight Linux distributions like Fedora CoreOS to provide an efficient environment for running containers with native Podman capabilities, bridging the gap for non-Linux users.

SEE ALSO

podman(1), podman-remote(1), qemu(1), libvirt(3), multipass(1)

Copied to clipboard