Files
podman/docs/source/markdown/podman-machine-set.1.md.in
Victor Toso c23963d7a8 machine: qemu: add usb host passthrough
QEMU usb-host driver which is the one for passthrough, supports two
options for selecting an USB devices in the host to provide it to the
VM:
 - Bus and Device number the device is plugged
 - Vendor and Product information of the USB devices

    https://qemu-project.gitlab.io/qemu/system/devices/usb.html

This commit allows a user to configure podman machine with either of
options, with new --usb command line option for podman machine init.

Examples
  podman machine init tosovm4 --usb vendor=13d3,product=5406
  podman machine init tosovm3 --usb bus=1,devnum=4 --usb bus=1,devnum=3

This commit also allows a user to change the USBs configured with
--usb command line option for podman machine set.

Note that this commit does not handle host device permissions nor
verify that the USB devices exists.

Signed-off-by: Victor Toso <victortoso@redhat.com>
2023-11-08 23:38:53 +01:00

100 lines
2.8 KiB
Markdown

% podman-machine-set 1
## NAME
podman\-machine\-set - Set a virtual machine setting
## SYNOPSIS
**podman machine set** [*options*] [*name*]
## DESCRIPTION
Change a machine setting.
The default machine name is `podman-machine-default`. If a machine name is not specified as an argument,
then the settings will be applied to `podman-machine-default`.
Rootless only.
## OPTIONS
#### **--cpus**=*number*
Number of CPUs.
Only supported for QEMU machines.
#### **--disk-size**=*number*
Size of the disk for the guest VM in GB.
Can only be increased. Only supported for QEMU machines.
#### **--help**
Print usage statement.
#### **--memory**, **-m**=*number*
Memory (in MB).
Only supported for QEMU machines.
#### **--rootful**
Whether this machine prefers rootful (`true`) or rootless (`false`)
container execution. This option updates the current podman
remote connection default if it is currently pointing at the specified
machine name (or `podman-machine-default` if no name is specified).
Unlike [**podman system connection default**](podman-system-connection-default.1.md)
this option makes the API socket, if available, forward to the rootful/rootless
socket in the VM.
Note that changing this option means that all the existing containers/images/volumes, etc...
are no longer visible with the default connection/socket. This is because the root and rootless
users in the VM are completely separated and do not share any storage. The data however is not
lost and you can always change this option back or use the other connection to access it.
#### **--usb**=*bus=number,devnum=number* or *vendor=hexadecimal,product=hexadecimal* or *""*
Assign a USB device from the host to the VM.
Only supported for QEMU Machines.
The device needs to be present when the VM starts.
The device needs to have proper permissions in order to be assign to podman machine.
Use an empty string to remove all previously set USB devices.
Note that using bus and device number are simpler but the values can change every boot or when the
device is unplugged. Using vendor and product might lead to collision in the case of multiple
devices with the same vendor product value, the first available device is assigned.
@@option user-mode-networking
## EXAMPLES
To switch the default VM `podman-machine-default` from rootless to rootful:
```
$ podman machine set --rootful
```
or more explicitly:
```
$ podman machine set --rootful=true
```
To switch the default VM `podman-machine-default` from rootful to rootless:
```
$ podman machine set --rootful=false
```
To switch the VM `myvm` from rootless to rootful:
```
$ podman machine set --rootful myvm
```
## SEE ALSO
**[podman(1)](podman.1.md)**, **[podman-machine(1)](podman-machine.1.md)**
## HISTORY
February 2022, Originally compiled by Jason Greene <jason.greene@redhat.com>