.nh .TH podman-machine-init 1 .SH NAME .PP podman-machine-init - Initialize a new virtual machine .SH SYNOPSIS .PP \fBpodman machine init\fP [\fIoptions\fP] [\fIname\fP] .SH DESCRIPTION .PP Initialize a new virtual machine for Podman. .PP The default machine name is \fBpodman-machine-default\fR\&. If a machine name is not specified as an argument, then the new machine will be named \fBpodman-machine-default\fR\&. .PP Rootless only. .PP Podman on MacOS and Windows requires a virtual machine. This is because containers are Linux - containers do not run on any other OS because containers' core functionality are tied to the Linux kernel. Podman machine must be used to manage MacOS and Windows machines, but can be optionally used on Linux. .PP \fBpodman machine init\fP initializes a new Linux virtual machine where containers are run. SSH keys are automatically generated to access the VM, and system connections to the root account and a user account inside the VM are added. .PP By default, the VM distribution is Fedora CoreOS except for WSL which is based on a custom Fedora image. While Fedora CoreOS upgrades come out every 14 days, the automatic update mechanism Zincata is disabled by Podman machine. .PP To check if there is an upgrade available for your machine os, you can run the following command: .EX $ podman machine ssh 'sudo rpm-ostree upgrade --check' .EE .PP If an update is available, you can rerun the above command and remove the \fB--check\fR and your operating system will be updated. After updating, you must stop and start your machine with \fBpodman machine stop && podman machine start\fR for it to take effect. .PP Note: Updating as described above can result in version mismatches between Podman on the host and Podman in the machine. Executing \fBpodman info\fR should reveal versions of both. A configuration where the Podman host and machine mismatch are unsupported. .PP For more information on updates and advanced configuration, see the Fedora CoreOS documentation about auto-updates and update strategies. .PP Fedora CoreOS upgrades come out every 14 days and are detected and installed automatically. The VM is rebooted during the upgrade. For more information on updates and advanced configuration, see the Fedora CoreOS documentation about auto-updates and update strategies. .SH OPTIONS .SS \fB--cpus\fP=\fInumber\fP .PP Number of CPUs. .SS \fB--disk-size\fP=\fInumber\fP .PP Size of the disk for the guest VM in GiB. .SS \fB--help\fP .PP Print usage statement. .SS \fB--ignition-path\fP .PP Fully qualified path of the ignition file. .PP If an ignition file is provided, the file is copied into the user's CONF_DIR and renamed. Additionally, no SSH keys are generated, nor are any system connections made. It is assumed that the user does these things manually or handled otherwise. .SS \fB--image-path\fP .PP Fully qualified path or URL to the VM image. Can also be set to \fBtesting\fR, \fBnext\fR, or \fBstable\fR to pull down default image. Defaults to \fBtesting\fR\&. .SS \fB--memory\fP, \fB-m\fP=\fInumber\fP .PP Memory (in MiB). Note: 1024MiB = 1GiB. .SS \fB--now\fP .PP Start the virtual machine immediately after it has been initialized. .SS \fB--rootful\fP .PP Whether this machine prefers rootful (\fBtrue\fR) or rootless (\fBfalse\fR) container execution. This option determines the remote connection default if there is no existing remote connection configurations. .PP API forwarding, if available, follows this setting. .SS \fB--timezone\fP .PP Set the timezone for the machine and containers. Valid values are \fBlocal\fR or a \fBtimezone\fR such as \fBAmerica/Chicago\fR\&. A value of \fBlocal\fR, which is the default, means to use the timezone of the machine host. .PP The timezone setting is not used with WSL. WSL automatically sets the timezone to the same as the host Windows operating system. .SS \fB--usb\fP=\fIbus=number,devnum=number\fP or \fIvendor=hexadecimal,product=hexadecimal\fP .PP Assign a USB device from the host to the VM via USB passthrough. Only supported for QEMU Machines. .PP The device needs to have proper permissions in order to be passed to the machine. This means the device needs to be under your user group. .PP Note that using bus and device number are simpler but the values can change every boot or when the device is unplugged. .PP When specifying a USB using vendor and product ID's, if more than one device has the same vendor and product ID, the first available device is assigned. .SS \fB--user-mode-networking\fP .PP Indicates that this machine relays traffic from the guest through a user-space process running on the host. In some VPN configurations the VPN may drop traffic from alternate network interfaces, including VM network devices. By enabling user-mode networking (a setting of \fBtrue\fR), VPNs observe all podman machine traffic as coming from the host, bypassing the problem. .PP When the qemu backend is used (Linux, Mac), user-mode networking is mandatory and the only allowed value is \fBtrue\fR\&. In contrast, The Windows/WSL backend defaults to \fBfalse\fR, and follows the standard WSL network setup. Changing this setting to \fBtrue\fR on Windows/WSL informs Podman to replace the WSL networking setup on start of this machine instance with a user-mode networking distribution. Since WSL shares the same kernel across distributions, all other running distributions reuses this network. Likewise, when the last machine instance with a \fBtrue\fR setting stops, the original networking setup is restored. .SS \fB--username\fP .PP Username to use for executing commands in remote VM. Default value is \fBcore\fR for FCOS and \fBuser\fR for Fedora (default on Windows hosts). Should match the one used inside the resulting VM image. .SS \fB--volume\fP, \fB-v\fP=\fIsource:target[:options]\fP .PP Mounts a volume from source to target. .PP Create a mount. If /host-dir:/machine-dir is specified as the \fB*source:target*\fR, Podman mounts \fIhost-dir\fP in the host to \fImachine-dir\fP in the Podman machine. .PP Additional options may be specified as a comma-separated string. Recognized options are: * \fBro\fP: mount volume read-only * \fBrw\fP: mount volume read/write (default) * \fBsecurity_model=[model]\fP: specify 9p security model (see below) .PP The 9p security model [determines] https://wiki.qemu.org/Documentation/9psetup#Starting_the_Guest_directly if and how the 9p filesystem translates some filesystem operations before actual storage on the host. .PP In order to allow symlinks to work, on MacOS the default security model is \fInone\fP\&. .PP The value of \fImapped-xattr\fP specifies that 9p store symlinks and some file attributes as extended attributes on the host. This is suitable when the host and the guest do not need to interoperate on the shared filesystem, but has caveats for actual shared access; notably, symlinks on the host are not usable on the guest and vice versa. If interoperability is required, then choose \fInone\fP instead, but keep in mind that the guest is not able to do things that the user running the virtual machine cannot do, e.g. create files owned by another user. Using \fInone\fP is almost certainly the best choice for read-only volumes. .PP Example: \fB-v "$HOME/git:$HOME/git:ro,security_model=none"\fR .PP Default volume mounts are defined in \fIcontainers.conf\fP\&. Unless changed, the default values is \fB$HOME:$HOME\fR\&. .SS \fB--volume-driver\fP .PP Driver to use for mounting volumes from the host, such as \fBvirtfs\fR\&. .SH EXAMPLES .EX $ podman machine init $ podman machine init myvm $ podman machine init --rootful $ podman machine init --disk-size 50 $ podman machine init --memory=1024 myvm $ podman machine init -v /Users:/mnt/Users $ podman machine init --usb vendor=13d3,product=5406 $ podman machine init --usb bus=1,devnum=3 .EE .SH SEE ALSO .PP \fBpodman(1)\fP, \fBpodman-machine(1)\fP .SH HISTORY .PP March 2021, Originally compiled by Ashley Cui acui@redhat.com \[la]mailto:acui@redhat.com\[ra]