Type: unix-hotplug
Description: Unix hotplug devices make the requested Unix device appear as a device in the instance (under/dev). If the device exists on the host system, you can read from it and write to it. The implementation...

Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# Type: `unix-hotplug`

▶ Watch on YouTube

Note

The `unix-hotplug` device type is supported for containers. It supports hotplugging.

Unix hotplug devices make the requested Unix device appear as a device in the instance (under `/dev`). If the device exists on the host system, you can read from it and write to it.

The implementation depends on `systemd-udev` to be run on the host.

## Device options

`unix-hotplug` devices have the following device options:

`gid`

GID of the device owner in the instance

Key: | `gid`
Type: | integer
Default: | `0`

`mode`

Mode of the device in the instance

Key: | `mode`
Type: | integer
Default: | `0660`

`productid`

Product ID of the Unix device

Key: | `productid`
Type: | string

`required`

Whether this device is required to start the instance

Key: | `required`
Type: | bool
Default: | `false`

The default is `false`, which means that all devices can be hotplugged.

`uid`

UID of the device owner in the instance

Key: | `uid`
Type: | integer
Default: | `0`

`vendorid`

Vendor ID of the Unix device

Key: | `vendorid`
Type: | string

## Configuration examples

Add a `unix-hotplug` device to an instance by specifying its vendor ID and product ID:

    lxc config device add <instance_name> <device_name> unix-hotplug vendorid=<vendor_ID> productid=<product_ID>

See Configure devices for more information.