Add semantic newlines for device-handling.md

This commit is contained in:
pierwill 2019-08-18 12:37:33 -05:00
parent 2b1145fece
commit 6a981959d4

View File

@ -11,14 +11,18 @@ redirect_from:
# Device Handling # # Device Handling #
This is an overview of device handling in Qubes OS. For specific devices ([block], [USB] and [PCI] devices), please visit their respective pages. This is an overview of device handling in Qubes OS.
For specific devices ([block], [USB] and [PCI] devices), please visit their respective pages.
**Important security warning:** Device handling comes with many security implications. Please make sure you carefully read and understand the **[security considerations]**. **Important security warning:** Device handling comes with many security implications.
Please make sure you carefully read and understand the **[security considerations]**.
## Introduction ## ## Introduction ##
The interface to deal with devices of all sorts was unified in Qubes 4.0 with the `qvm-device` command and the Qubes Devices Widget. In Qubes 3.X, the Qubes VM Manager dealt with attachment as well. This functionality was moved to the Qubes Device Widget, the tool tray icon with a yellow square located in the top right of your screen by default. The interface to deal with devices of all sorts was unified in Qubes 4.0 with the `qvm-device` command and the Qubes Devices Widget.
In Qubes 3.X, the Qubes VM Manager dealt with attachment as well.
This functionality was moved to the Qubes Device Widget, the tool tray icon with a yellow square located in the top right of your screen by default.
There are currently four categories of devices Qubes understands: There are currently four categories of devices Qubes understands:
- Microphones - Microphones
@ -26,31 +30,41 @@ There are currently four categories of devices Qubes understands:
- USB devices - USB devices
- PCI devices - PCI devices
Microphones, block devices and USB devices can be attached with the GUI-tool. PCI devices can be attached using the Qube Settings, but require a VM reboot. Microphones, block devices and USB devices can be attached with the GUI-tool.
PCI devices can be attached using the Qube Settings, but require a VM reboot.
## General Qubes Device Widget Behavior And Handling ## ## General Qubes Device Widget Behavior And Handling ##
When clicking on the tray icon (which looks similar to this): ![SD card and thumbdrive][device manager icon] several device-classes separated by lines are displayed as tooltip. Block devices are displayed on top, microphones one below and USB-devices at the bottom. When clicking on the tray icon (which looks similar to this): ![SD card and thumbdrive][device manager icon] several device-classes separated by lines are displayed as tooltip.
Block devices are displayed on top, microphones one below and USB-devices at the bottom.
On most laptops, integrated hardware such as cameras and fingerprint-readers are implemented as USB-devices and can be found here. On most laptops, integrated hardware such as cameras and fingerprint-readers are implemented as USB-devices and can be found here.
### Attaching Using The Widget ### ### Attaching Using The Widget ###
Click the tray icon. Hover on a device you want to attach to a VM. A list of running VMs (except dom0) appears. Click on one and your device will be attached! Click the tray icon.
Hover on a device you want to attach to a VM.
A list of running VMs (except dom0) appears.
Click on one and your device will be attached!
### Detaching Using The Widget ### ### Detaching Using The Widget ###
To detach a device, click the Qubes Devices Widget icon again. Attached devices are displayed in bold. Hover the one you want to detach. A list of VMs appears, one showing the eject symbol: ![eject icon] To detach a device, click the Qubes Devices Widget icon again.
Attached devices are displayed in bold.
Hover the one you want to detach.
A list of VMs appears, one showing the eject symbol: ![eject icon]
### Attaching a Device to Several VMs ### ### Attaching a Device to Several VMs ###
Only `mic` should be attached to more than one running VM. You may *assign* a device to more than one VM (using the [`--persistent`][#attaching-devices] option), however, only one of them can be started at the same time. Only `mic` should be attached to more than one running VM.
You may *assign* a device to more than one VM (using the [`--persistent`][#attaching-devices] option), however, only one of them can be started at the same time.
But be careful: There is a [bug in `qvm-device block` or `qvm-block`][i4692] which will allow you to *attach* a block device to two running VMs. Don't do that! But be careful: There is a [bug in `qvm-device block` or `qvm-block`][i4692] which will allow you to *attach* a block device to two running VMs.
Don't do that!
## General `qvm-device` Command Line Tool Behavior ## ## General `qvm-device` Command Line Tool Behavior ##
@ -60,7 +74,8 @@ All devices, including PCI-devices, may be attached from the commandline using t
### Device Classes ### ### Device Classes ###
`qvm-device` expects DEVICE_CLASS as first argument. DEVICE_CLASS can be one of `qvm-device` expects DEVICE_CLASS as first argument.
DEVICE_CLASS can be one of
- `pci` - `pci`
- `usb` - `usb`
@ -85,7 +100,9 @@ These three options are always available:
- `--verbose`, `-v` - increase verbosity - `--verbose`, `-v` - increase verbosity
- `--quiet`, `-q` - decrease verbosity - `--quiet`, `-q` - decrease verbosity
A full command consists of one DEVICE_CLASS and one action. If no action is given, list is implied. DEVICE_CLASS however is required. A full command consists of one DEVICE_CLASS and one action.
If no action is given, list is implied.
DEVICE_CLASS however is required.
**SYNOPSIS**: **SYNOPSIS**:
`qvm-device DEVICE_CLASS {action} [action-specific arguments] [options]` `qvm-device DEVICE_CLASS {action} [action-specific arguments] [options]`
@ -98,12 +115,16 @@ Actions are applicable to every DEVICE_CLASS and expose some additional options.
### Listing Devices ### ### Listing Devices ###
The `list` action lists known devices in the system. `list` accepts VM-names to narrow down listed devices. Devices available in, as well as attached to the named VMs will be listed. The `list` action lists known devices in the system.
`list` accepts VM-names to narrow down listed devices.
Devices available in, as well as attached to the named VMs will be listed.
`list` accepts two options: `list` accepts two options:
- `--all` - equivalent to specifying every VM name after `list`. No VM-name implies `--all`. - `--all` - equivalent to specifying every VM name after `list`.
- `--exclude` - exclude VMs from `--all`. Requires `--all`. No VM-name implies `--all`.
- `--exclude` - exclude VMs from `--all`.
Requires `--all`.
**SYNOPSIS** **SYNOPSIS**
`qvm-device DEVICE_CLASS {list|ls|l} [--all [--exclude VM [VM [...]]] | VM [VM [...]]]` `qvm-device DEVICE_CLASS {list|ls|l} [--all [--exclude VM [VM [...]]] | VM [VM [...]]]`
@ -111,11 +132,15 @@ The `list` action lists known devices in the system. `list` accepts VM-names to
### Attaching Devices ### ### Attaching Devices ###
The `attach` action assigns an exposed device to a VM. This makes the device available in the VM it's attached to. Required argument are targetVM and sourceVM:deviceID. (sourceVM:deviceID can be determined from `list` output) The `attach` action assigns an exposed device to a VM.
This makes the device available in the VM it's attached to.
Required argument are targetVM and sourceVM:deviceID.
(sourceVM:deviceID can be determined from `list` output)
`attach` accepts two options: `attach` accepts two options:
- `--persistent` - attach device on targetVM-boot. If the device is unavailable (physically missing or sourceVM not started), booting the targetVM fails. - `--persistent` - attach device on targetVM-boot.
If the device is unavailable (physically missing or sourceVM not started), booting the targetVM fails.
- `--option`, `-o` - set additional options specific to DEVICE_CLASS. - `--option`, `-o` - set additional options specific to DEVICE_CLASS.
**SYNOPSIS** **SYNOPSIS**
@ -124,7 +149,9 @@ The `attach` action assigns an exposed device to a VM. This makes the device ava
### Detaching Devices ### ### Detaching Devices ###
The `detach` action removes an assigned device from a targetVM. It won't be available afterwards anymore. Though it tries to do so gracefully, beware that data-connections might be broken unexpectedly, so close any transaction before detaching a device! The `detach` action removes an assigned device from a targetVM.
It won't be available afterwards anymore.
Though it tries to do so gracefully, beware that data-connections might be broken unexpectedly, so close any transaction before detaching a device!
If no specific `sourceVM:deviceID` combination is given, *all devices of that DEVICE_CLASS will be detached.* If no specific `sourceVM:deviceID` combination is given, *all devices of that DEVICE_CLASS will be detached.*