mirror of
https://github.com/QubesOS/qubes-doc.git
synced 2025-01-11 23:39:38 -05:00
Merge branch 'disposables'
This commit is contained in:
commit
72804995d6
@ -15,62 +15,54 @@ title: Disposable customization
|
||||
|
||||
## Introduction
|
||||
|
||||
A [disposable](/doc/disposable/) can be based on any [app qube](/doc/glossary/#app-qube).
|
||||
You can also choose to use different [disposable templates](/doc/glossary/#disposable-template) for different disposables.
|
||||
To prepare an app qube to be a disposable template, you need to set `template_for_dispvms` property, for example:
|
||||
A [disposable](/doc/disposable/) can be based on any [app qube](/doc/glossary/#app-qube). You can also choose to use different [disposable templates](/doc/glossary/#disposable-template) for different disposables. To prepare an app qube to be a disposable template, you need to set the `template_for_dispvms` property:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs fedora-26-dvm template_for_dispvms True
|
||||
[user@dom0 ~]$ qvm-prefs <DISPOSABLE_TEMPLATE> template_for_dispvms True
|
||||
```
|
||||
|
||||
Additionally, if you want to have menu entries for starting applications in disposable based on this app qube (instead of in the app qube itself), you can achieve it with `appmenus-dispvm` feature:
|
||||
Additionally, if you want to have menu entries for starting applications in disposables based on this app qube (instead of in the app qube itself), you can achieve that with the `appmenus-dispvm` feature:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-features fedora-26-dvm appmenus-dispvm 1
|
||||
[user@dom0 ~]$ qvm-features <DISPOSABLE_TEMPLATE> appmenus-dispvm 1
|
||||
```
|
||||
|
||||
Note: application shortcuts that existed before setting this feature will not be updated automatically. Please go the the "Applications" tab in the qube's "Settings" dialog and unselect all existing shortcuts by clicking "<<", then click "OK" and close the dialog. Give it a few seconds time and then reopen and re-select all the shortcuts you want to see in the menu. See [this page](/doc/managing-appvm-shortcuts) for background information.
|
||||
**Note:** Application shortcuts that existed before setting this feature will not be updated automatically. Please go the the "Applications" tab in the qube's "Settings" dialog and unselect all existing shortcuts by clicking "<<", then click "OK" and close the dialog. Give it a few seconds time and then reopen and re-select all the shortcuts you want to see in the menu. See [this page](/doc/managing-appvm-shortcuts) for background information.
|
||||
|
||||
## Security
|
||||
|
||||
If a disposable template becomes compromised, then any disposable based on that disposable template could be compromised.
|
||||
Therefore, you should not make any risky customizations (e.g., installing untrusted browser plugins) in important disposable templates.
|
||||
In particular, the *default* disposable template is important because it is used by the "Open in disposable" feature.
|
||||
This means that it will have access to everything that you open with this feature.
|
||||
For this reason, it is strongly recommended that you base the default disposable template on a trusted template and refrain from making any risky customizations to it.
|
||||
If a disposable template becomes compromised, then any disposable based on that disposable template could be compromised. Therefore, you should not make any risky customizations (e.g., installing untrusted browser plugins) in important disposable templates. In particular, the *default* disposable template is important because it is used by the "Open in disposable" feature. This means that it will have access to everything that you open with this feature. For this reason, it is strongly recommended that you base the default disposable template on a trusted template and refrain from making any risky customizations to it.
|
||||
|
||||
## Creating a new disposable template
|
||||
|
||||
In Qubes 4.0, you're no longer restricted to a single disposable template. Instead, you can create as many as you want. Whenever you start a new disposable, you can choose to base it on whichever disposable template you like.
|
||||
To create new disposable template, lets say `custom-disposable-template`, based on `debian-9` template, use following commands:
|
||||
In Qubes 4.0, you're no longer restricted to a single disposable template. Instead, you can create as many as you want. Whenever you start a new disposable, you can choose to base it on whichever disposable template you like. To create a new disposable template:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-create --template debian-9 --label red custom-disposable-template
|
||||
[user@dom0 ~]$ qvm-prefs custom-disposable-template template_for_dispvms True
|
||||
[user@dom0 ~]$ qvm-features custom-disposable-template appmenus-dispvm 1
|
||||
[user@dom0 ~]$ qvm-create --template <TEMPLATE> --label red <DISPOSABLE_TEMPLATE>
|
||||
[user@dom0 ~]$ qvm-prefs <DISPOSABLE_TEMPLATE> template_for_dispvms True
|
||||
[user@dom0 ~]$ qvm-features <DISPOSABLE_TEMPLATE> appmenus-dispvm 1
|
||||
```
|
||||
|
||||
Additionally you may want to set it as default disposable template:
|
||||
Optionally, set it as the default disposable template:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qubes-prefs default_dispvm custom-disposable-template
|
||||
[user@dom0 ~]$ qubes-prefs default_dispvm <DISPOSABLE_TEMPLATE>
|
||||
```
|
||||
|
||||
The above default is used whenever a qube request starting a new disposable and do not specify which one (for example `qvm-open-in-dvm` tool). This can be also set in qube settings and will affect service calls from that qube. See [qrexec documentation](/doc/qrexec/#specifying-vms-tags-types-targets-etc) for details.
|
||||
|
||||
If you wish to use a [Minimal Template](/doc/templates/minimal/) as a disposable template, please see the [Minimal Template](/doc/templates/minimal/) page.
|
||||
If you wish to use a [minimal template](/doc/templates/minimal/) as a disposable template, please see the [minimal template](/doc/templates/minimal/) page.
|
||||
|
||||
## Customization of disposable
|
||||
|
||||
_**Note:** If you are trying to customize Tor Browser in a Whonix disposable, please consult the [Whonix documentation](https://www.whonix.org/wiki/Tor_Browser/Advanced_Users#disposable_Template_Customization)._
|
||||
|
||||
It is possible to change the settings for each new disposable.
|
||||
This can be done by customizing the disposable template on which it is based:
|
||||
It is possible to change the settings for each new disposable. This can be done by customizing the disposable template on which it is based:
|
||||
|
||||
1. Start a terminal in the `fedora-26-dvm` qube (or another disposable template) by running the following command in a dom0 terminal. (If you enable `appmenus-dispvm` feature (as explained at the top), applications menu for this VM (`fedora-26-dvm`) will be "Disposable: fedora-26-dvm" (instead of "Domain: fedora-26-dvm") and entries there will start new disposable based on that VM (`fedora-26-dvm`). Not in that VM (`fedora-26-dvm`) itself).
|
||||
1. Start a terminal in the `<DISPOSABLE_TEMPLATE>` qube (or another disposable template) by running the following command in a dom0 terminal. (If you enable `appmenus-dispvm` feature (as explained at the top), applications menu for this VM (`<DISPOSABLE_TEMPLATE>`) will be "Disposable: <DISPOSABLE_TEMPLATE>" (instead of "Domain: <DISPOSABLE_TEMPLATE>") and entries there will start new disposable based on that VM (`<DISPOSABLE_TEMPLATE>`). Not in that VM (`<DISPOSABLE_TEMPLATE>`) itself).
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-run -a fedora-26-dvm gnome-terminal
|
||||
[user@dom0 ~]$ qvm-run -a <DISPOSABLE_TEMPLATE> gnome-terminal
|
||||
```
|
||||
|
||||
2. Change the qube's settings and/or applications, as desired. Some examples of changes you may want to make include:
|
||||
@ -78,50 +70,53 @@ This can be done by customizing the disposable template on which it is based:
|
||||
- Changing default editor, image viewer. In Debian-based templates this can be done with the `mimeopen` command.
|
||||
- Changing the disposable's default NetVM. For example, you may wish to set the NetVM to "none." Then, whenever you start a new disposable, you can choose your desired ProxyVM manually (by changing the newly-started disposables settings). This is useful if you sometimes wish to use a disposable with a Whonix Gateway, for example. It is also useful if you sometimes wish to open untrusted files in a network-disconnected disposable.
|
||||
|
||||
4. Shutdown the qube (either by `poweroff` from qube's terminal, or `qvm-shutdown` from dom0 terminal).
|
||||
3. Shutdown the qube (either by `poweroff` from qube's terminal, or `qvm-shutdown` from dom0 terminal).
|
||||
|
||||
## Using named disposables for sys-*
|
||||
## Using named disposables for service qubes
|
||||
|
||||
You can use a [named disposable](/doc/glossary/#named-disposable) for `sys-*` as long as it is stateless.
|
||||
For example, a `sys-net` using DHCP or `sys-usb` will work.
|
||||
In most cases `sys-firewall` will also work, even if you have configured app qube firewall rules.
|
||||
The only exception is if you require something like VM to VM communication and have manually edited `iptables` or other items directly inside the firewall app qube.
|
||||
You can use a [named disposable](/doc/glossary/#named-disposable) for service qubes (such as those with the `sys-*` naming scheme) as long as they are stateless. For example, a `sys-net` using DHCP or `sys-usb` will work. In most cases `sys-firewall` will also work, even if you have configured app qube firewall rules. The only exception is if you require something like VM to VM communication and have manually edited `iptables` or other items directly inside the firewall app qube.
|
||||
|
||||
To create one that has no PCI devices attached, such as for `sys-firewall`:
|
||||
|
||||
~~~
|
||||
qvm-create -C DispVM -l green <sys-VMName>
|
||||
qvm-prefs <sys-VMName> autostart true
|
||||
qvm-prefs <sys-VMName> netvm <sys-net>
|
||||
qvm-prefs <sys-VMName> provides_network true
|
||||
qvm-features <sys-VMName> appmenus-dispvm ''
|
||||
qvm-create -C DispVM -l green <SERVICE_QUBE>
|
||||
qvm-prefs <SERVICE_QUBE> autostart true
|
||||
qvm-prefs <SERVICE_QUBE> netvm <NET_QUBE>
|
||||
qvm-prefs <SERVICE_QUBE> provides_network true
|
||||
qvm-features <SERVICE_QUBE> appmenus-dispvm ''
|
||||
~~~
|
||||
|
||||
Next, set the old `sys-firewall` autostart to false, and update any references to the old one to instead point to the new.
|
||||
For example, with `qvm-prefs work netvm sys-firewall2`.
|
||||
Next, set the old `sys-firewall` autostart to false, and update any references to the old one to instead point to the new, for example, with `qvm-prefs work netvm sys-firewall2`.
|
||||
|
||||
To create one with a PCI device attached such as for `sys-net` or `sys-usb`, use the additional commands as follows.
|
||||
|
||||
**Note** You can use `qvm-pci` to [determine](/doc/how-to-use-pci-devices/#qvm-pci-usage) the `<BDF>`.
|
||||
Also, you will often need to include the `-o no-strict-reset=True` [option](/doc/how-to-use-pci-devices/#no-strict-reset) with USB controllers.
|
||||
**Note:** You can use `qvm-pci` to [determine](/doc/how-to-use-pci-devices/#qvm-pci-usage) the `<BDF>`. Also, you will often need to include the `-o no-strict-reset=True` [option](/doc/how-to-use-pci-devices/#no-strict-reset) with USB controllers.
|
||||
|
||||
~~~
|
||||
qvm-create -C DispVM -l red <sys-VMName>
|
||||
qvm-prefs <sys-VMName> virt_mode hvm
|
||||
qvm-service <sys-VMName> meminfo-writer off
|
||||
qvm-pci attach --persistent <sys-VMName> dom0:<BDF>
|
||||
qvm-prefs <sys-VMName> autostart true
|
||||
qvm-prefs <sys-VMName> netvm ''
|
||||
qvm-features <sys-VMName> appmenus-dispvm ''
|
||||
# optional, if this disposable will be providing networking
|
||||
qvm-prefs <sys-VMName> provides_network true
|
||||
qvm-create -C DispVM -l red <SERVICE_QUBE>
|
||||
qvm-prefs <SERVICE_QUBE> virt_mode hvm
|
||||
qvm-service <SERVICE_QUBE> meminfo-writer off
|
||||
qvm-pci attach --persistent <SERVICE_QUBE> dom0:<BDF>
|
||||
qvm-prefs <SERVICE_QUBE> autostart true
|
||||
qvm-prefs <SERVICE_QUBE> netvm ''
|
||||
qvm-features <SERVICE_QUBE> appmenus-dispvm ''
|
||||
~~~
|
||||
|
||||
Next, set the old `sys-` VM's autostart to false, and update any references to the old one.
|
||||
In particular, make sure to update `/etc/qubes-rpc/policy/qubes.UpdatesProxy` in dom0.
|
||||
Optionally, if this disposable will also provide network access to other qubes:
|
||||
|
||||
For example, `qvm-prefs sys-firewall netvm <sys-VMName>`.
|
||||
See below for a complete example of a `sys-net` replacement:
|
||||
~~~
|
||||
qvm-prefs <SERVICE_QUBE> provides_network true
|
||||
~~~
|
||||
|
||||
Next, set the old service qube's autostart to false, and update any references to the old one, e.g.:
|
||||
|
||||
~~~
|
||||
qvm-prefs sys-firewall netvm <SERVICE_QUBE>
|
||||
~~~
|
||||
|
||||
Also make sure to update any [RPC policies](/doc/rpc-policy/), if needed.
|
||||
|
||||
Here is an example of a complete `sys-net` replacement:
|
||||
|
||||
~~~
|
||||
qvm-create -C DispVM -l red sys-net2
|
||||
@ -137,248 +132,38 @@ qvm-prefs sys-firewall netvm sys-net2
|
||||
qubes-prefs clockvm sys-net2
|
||||
~~~
|
||||
|
||||
## Adding programs to disposable Application Menu
|
||||
## Adding programs to the app menu
|
||||
|
||||
For added convenience, arbitrary programs can be added to the Application Menu of the disposable.
|
||||
For added convenience, arbitrary programs can be added to the app menu of the disposable.
|
||||
|
||||
In order to do that, select "Qube settings" entry in selected base app qube, go to "Applications" tab and select desired applications as for any other qube.
|
||||
|
||||
Note that currently only applications whose main process keeps running until you close the application (i.e. do not start a background process instead) will work. One of known examples of incompatible applications is GNOME Terminal (shown on the list as "Terminal"). Choose different terminal emulator (like XTerm) instead.
|
||||
|
||||
## Create Custom sys-net sys-firewall and sys-usb disposables
|
||||
|
||||
Users have the option of creating customized disposables for the `sys-net`, `sys-firewall` and `sys-usb` VMs. In this configuration, a fresh VM instance is created each time a disposable is launched. Functionality is near-identical to the default VMs created following a new Qubes’ installation, except the user benefits from a non-persistent filesystem.
|
||||
|
||||
Functionality is not limited, users can:
|
||||
|
||||
- Set custom firewall rule sets and run Qubes VPN scripts.
|
||||
- Set disposables to autostart at system boot.
|
||||
- Attach PCI devices with the `--persistent` option.
|
||||
|
||||
Using disposables in this manner is ideal for untrusted qubes which require persistent PCI devices, such as USB VMs and NetVMs.
|
||||
|
||||
>_**Note:**_ Users who want customized VPN or firewall rule sets must create a separate disposable template for use by each disposable. If disposable template customization is not needed, then a single disposable template is used as a template for all disposables.
|
||||
|
||||
### Create and configure the disposable template on which the disposable will be based
|
||||
|
||||
1. Create the disposable template:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-create --class AppVM --label gray <disposable-Template-Name>
|
||||
```
|
||||
|
||||
2. _(optional)_ In the disposable template, add custom firewall rule sets, Qubes VPN scripts, etc.
|
||||
|
||||
Firewall rules sets and Qubes VPN scripts can be added just like any other VM.
|
||||
|
||||
3. Set the disposable template as template for disposables:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs <disposable-Template-Name> template_for_dispvms true
|
||||
```
|
||||
|
||||
### Create the sys-net disposable
|
||||
|
||||
1. Create `sys-net` disposable based on the disposable template:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-create --template <disposable-Template-Name> --class DispVM --label red disp-sys-net
|
||||
```
|
||||
|
||||
2. Set `disp-sys-net` virtualization mode to [hvm](/doc/hvm/):
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs disp-sys-net virt_mode hvm
|
||||
```
|
||||
|
||||
3. Set `disp-sys-net` to provide network for other VMs:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs disp-sys-net provides_network true
|
||||
```
|
||||
|
||||
4. Set `disp-sys-net` NetVM to none:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs disp-sys-net netvm ""
|
||||
```
|
||||
|
||||
5. List all available PCI devices to determine the correct _backend:BDF_ address(es) to assign to `disp-sys-net`:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-pci
|
||||
```
|
||||
|
||||
6. Attach the network PCI device(s) to `disp-sys-net` (finding and assigning PCI devices can be found [here](/doc/how-to-use-pci-devices/):
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-pci attach --persistent disp-sys-net <backend>:<bdf>
|
||||
```
|
||||
|
||||
7. _(recommended)_ Set `disp-sys-net` to start automatically when Qubes boots:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs disp-sys-net autostart true
|
||||
```
|
||||
|
||||
8. _(recommended)_ Disable the `appmenus-dispvm` feature, as disp-sys-net is not itself a disposable template (Note: this is only necessary if you enabled the `appmenus-dispvm` feature for the disposable template):
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-features disp-sys-net appmenus-dispvm ''
|
||||
```
|
||||
|
||||
9. _(optional)_ Set `disp-sys-net` as the dom0 time source:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qubes-prefs clockvm disp-sys-net
|
||||
```
|
||||
|
||||
10. _(recommended)_ Allow templates to be updated via `disp-sys-net`. In dom0, edit `/etc/qubes-rpc/policy/qubes.UpdatesProxy` to change the target from `sys-net` to `disp-sys-net`.
|
||||
|
||||
### Create the sys-firewall disposable
|
||||
|
||||
1. Create `sys-firewall` disposable:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-create --template <disposable-Template-Name> --class DispVM --label green disp-sys-firewall
|
||||
```
|
||||
|
||||
2. Set `disp-sys-firewall` to provide network for other VMs:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs disp-sys-firewall provides_network true
|
||||
```
|
||||
|
||||
3. Set `disp-sys-net` as the NetVM for `disp-sys-firewall`:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs disp-sys-firewall netvm disp-sys-net
|
||||
```
|
||||
|
||||
4. Set `disp-sys-firewall` as NetVM for other app qubes:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs <vm_name> netvm disp-sys-firewall
|
||||
```
|
||||
|
||||
5. _(recommended)_ Set `disp-sys-firewall` to auto-start when Qubes boots:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs disp-sys-firewall autostart true
|
||||
```
|
||||
|
||||
6. _(recommended)_ Disable the `appmenus-dispvm` feature, as disp-sys-firewall is not itself a disposable template (Note: this is only necessary if you enabled the `appmenus-dispvm` feature for the disposable template):
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-features disp-sys-firewall appmenus-dispvm ''
|
||||
```
|
||||
|
||||
7. _(optional)_ Set `disp-sys-firewall` as the default NetVM:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qubes-prefs default_netvm disp-sys-firewall
|
||||
```
|
||||
|
||||
### Create the sys-usb disposable
|
||||
|
||||
1. Create the `disp-sys-usb`:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-create --template <disposable-template-name> --class DispVM --label red disp-sys-usb
|
||||
```
|
||||
|
||||
2. Set the `disp-sys-usb` virtualization mode to hvm:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs disp-sys-usb virt_mode hvm
|
||||
```
|
||||
|
||||
3. Set `disp-sys-usb` NetVM to none:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs disp-sys-usb netvm ""
|
||||
```
|
||||
|
||||
4. List all available PCI devices:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-pci
|
||||
```
|
||||
|
||||
5. Attach the USB controller to the `disp-sys-usb`:
|
||||
>_**Note:**_ Most of the commonly used USB controllers (all Intel integrated controllers) require the `-o no-strict-reset=True` option to be set. Instructions detailing how this option is set can be found [here](/doc/how-to-use-pci-devices/#no-strict-reset).
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-pci attach --persistent disp-sys-usb <backined>:<bdf>
|
||||
```
|
||||
|
||||
6. _(optional)_ Set `disp-sys-usb` to auto-start when Qubes boots:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs disp-sys-usb autostart true
|
||||
```
|
||||
|
||||
7. _(recommended)_ Disable the `appmenus-dispvm` feature, as disp-sys-usb is not itself a disposable template (Note: this is only necessary if you enabled the `appmenus-dispvm` feature for the disposable template):
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-features disp-sys-usb appmenus-dispvm ''
|
||||
```
|
||||
|
||||
8. Users should now follow instructions on [How to hide USB controllers from dom0](/doc/usb-qubes/#how-to-hide-usb-controllers-from-dom0).
|
||||
|
||||
9. At this point, your mouse may not work.
|
||||
Edit the `qubes.InputMouse` policy file in dom0, which is located here:
|
||||
|
||||
```
|
||||
/etc/qubes-rpc/policy/qubes.InputMouse
|
||||
```
|
||||
|
||||
Add a line like this to the top of the file:
|
||||
|
||||
```
|
||||
disp-sys-usb dom0 allow,user=root
|
||||
```
|
||||
|
||||
### Starting the disposables
|
||||
|
||||
Prior to starting the new VMs, users should ensure that no other VMs such as the old `sys-net` and `sys-usb` VMs are running. This is because no two VMs can share the same PCI device while both running. It is recommended that users detach the PCI devices from the old VMs without deleting them. This will allow users to reattach the PCI devices if the newly created disposables fail to start.
|
||||
|
||||
Detach PCI device from VM:
|
||||
|
||||
```shell_session
|
||||
[user@dom0~]$ qvm-pci detach <vm_name> <backend>:<bdf>
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
If the `disp-sys-usb` does not start, it could be due to a PCI passthrough problem. For more details on this issue along with possible solutions, users can look [here](/doc/pci-troubleshooting/#pci-passthrough-issues).
|
||||
|
||||
## Deleting disposables
|
||||
|
||||
While working in a disposable, you may want to open a document in another disposable.
|
||||
For this reason, the property `default_dispvm` may be set to the name of your disposable in a number of VMs:
|
||||
While working in a disposable, you may want to open a document in another disposable. For this reason, the property `default_dispvm` may be set to the name of your disposable in a number of qubes:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs workvm | grep default_dispvm
|
||||
default_dispvm - custom-disposable-template
|
||||
[user@dom0 ~]$ qvm-prefs <QUBE> | grep default_dispvm
|
||||
default_dispvm - <DISPOSABLE_TEMPLATE>
|
||||
```
|
||||
|
||||
This will prevent the deletion of the disposable template. In order to fix this you need to unset the `default_dispvm` property:
|
||||
This will prevent the deletion of the disposable template. In order to fix this, you need to unset the `default_dispvm` property:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-prefs workvm default_dispvm ""
|
||||
[user@dom0 ~]$ qvm-prefs <QUBE> default_dispvm ""
|
||||
```
|
||||
|
||||
You can then delete the disposable template:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ qvm-remove custom-disposable-template
|
||||
[user@dom0 ~]$ qvm-remove <DISPOSABLE_TEMPLATE>
|
||||
This will completely remove the selected VM(s)
|
||||
custom-disposable-template
|
||||
<DISPOSABLE_TEMPLATE>
|
||||
```
|
||||
|
||||
|
||||
If you still encounter the issue, you may have forgot to clean an entry. Looking at the system logs will help you:
|
||||
If you still encounter a problem, you may have forgotten to clean an entry. Looking at the system logs will help you:
|
||||
|
||||
```shell_session
|
||||
[user@dom0 ~]$ journalctl | tail
|
||||
|
@ -14,14 +14,9 @@ ref: 203
|
||||
title: How to use disposables
|
||||
---
|
||||
|
||||
A [disposable](/doc/glossary/#disposable) is a lightweight [qube](/doc/glossary/#qube) that can be created quickly and will self-destruct when closed.
|
||||
Disposables are usually created in order to host a single application, like a viewer, editor, or web browser.
|
||||
A [disposable](/doc/glossary/#disposable) is a lightweight [qube](/doc/glossary/#qube) that can be created quickly and will self-destruct when closed. Disposables are usually created in order to host a single application, like a viewer, editor, or web browser.
|
||||
|
||||
From inside an app qube, choosing the `Open in disposable` option on a file will launch a disposable for just that file.
|
||||
Changes made to a file opened in a disposable are passed back to the originating VM.
|
||||
This means that you can safely work with untrusted files without risk of compromising your other VMs.
|
||||
Disposables can be launched either directly from dom0's Start Menu or terminal window, or from within app qubes.
|
||||
While running, disposables will appear in Qubes VM Manager with the name `disp####`.
|
||||
From inside an app qube, choosing the `Open in disposable` option on a file will launch a disposable for just that file. Changes made to a file opened in a disposable are passed back to the originating qube. This means that you can safely work with untrusted files without risk of compromising your other qubes. Disposables can be launched either directly from dom0's app menu or terminal window, or from within app qubes. Disposables are generated with names like `disp####`, where `####` is random number.
|
||||
|
||||
[![disposablevm-example.png](/attachment/doc/disposablevm-example.png)](/attachment/doc/disposablevm-example.png)
|
||||
|
||||
@ -29,89 +24,66 @@ This diagram provides a general example of how disposables can be used to safely
|
||||
|
||||
## Security
|
||||
|
||||
If a [disposable template](/doc/glossary/#disposable-template) becomes compromised, then any disposable based on that disposable template could be compromised.
|
||||
In particular, the *default* disposable template is important because it is used by the "Open in disposable" feature.
|
||||
This means that it will have access to everything that you open with this feature.
|
||||
For this reason, it is strongly recommended that you base the default disposable template on a trusted template.
|
||||
If a [disposable template](/doc/glossary/#disposable-template) becomes compromised, then any disposable based on that disposable template could be compromised. In particular, the *default* disposable template is important because it is used by the "Open in disposable" feature. This means that it will have access to everything that you open with this feature. For this reason, it is strongly recommended that you base the default disposable template on a trusted template.
|
||||
|
||||
### Disposables and Local Forensics
|
||||
|
||||
At this time, disposables should not be relied upon to circumvent local forensics, as they do not run entirely in RAM.
|
||||
For details, see [this thread](https://groups.google.com/d/topic/qubes-devel/QwL5PjqPs-4/discussion).
|
||||
At this time, disposables should not be relied upon to circumvent local forensics, as they do not run entirely in RAM. For details, see [this thread](https://groups.google.com/d/topic/qubes-devel/QwL5PjqPs-4/discussion).
|
||||
|
||||
When it is essential to avoid leaving any trace, consider using [Tails](https://tails.boum.org/).
|
||||
|
||||
## Disposables and Networking
|
||||
|
||||
Similarly to how app qubes are based on their underlying [template](/doc/glossary/#template), disposables are based on their underlying [disposable template](/doc/glossary/#disposable-template).
|
||||
R4.0 introduces the concept of multiple disposable templates, whereas R3.2 was limited to only one.
|
||||
Similarly to how app qubes are based on their underlying [template](/doc/glossary/#template), disposables are based on their underlying [disposable template](/doc/glossary/#disposable-template). R4.0 introduces the concept of multiple disposable templates, whereas R3.2 was limited to only one.
|
||||
|
||||
On a fresh installation of Qubes, the default disposable template is called `fedora-XX-dvm` (where `XX` is the Fedora version of the default template).
|
||||
If you have included the Whonix option in your install, there will also be a `whonix-ws-dvm` disposable template available for your use.
|
||||
On a fresh installation of Qubes, the default disposable template is called `fedora-X-dvm` or `debian-X-dvm` (where `X` is a release number). If you have included the Whonix option in your install, there will also be a `whonix-ws-dvm` disposable template available for your use.
|
||||
|
||||
You can set any app qube to have the ability to act as a disposable template with:
|
||||
|
||||
```
|
||||
qvm-prefs <vmname> template_for_dispvms True
|
||||
qvm-prefs <APP_QUBE> template_for_dispvms True
|
||||
```
|
||||
|
||||
The default system wide disposable template can be changed with `qubes-prefs default_dispvm`.
|
||||
By combining the two, choosing `Open in disposable` from inside an app qube will open the document in a disposable based on the default disposable template you specified.
|
||||
The default system wide disposable template can be changed with `qubes-prefs default_dispvm`. By combining the two, choosing `Open in disposable` from inside an app qube will open the document in a disposable based on the default disposable template you specified.
|
||||
|
||||
You can change this behaviour for individual VMs: in the Application Menu, open Qube Settings for the VM in question and go to the "Advanced" tab.
|
||||
Here you can edit the "Default disposable" setting to specify which disposable template will be used to launch disposables from that VM.
|
||||
This can also be changed from the command line with:
|
||||
You can change this behavior for individual qubes: in the Application Menu, open Qube Settings for the qube in question and go to the "Advanced" tab. Here you can edit the "Default disposable" setting to specify which disposable template will be used to launch disposables from that qube. This can also be changed from the command line with:
|
||||
|
||||
```
|
||||
qvm-prefs <VM> default_dispvm <DISPOSABLEVM_TEMPLATE>
|
||||
qvm-prefs <QUBE> default_dispvm <DISPOSABLE_TEMPLATE>
|
||||
```
|
||||
|
||||
For example, `anon-whonix` has been set to use `whonix-ws-dvm` as its `default_dispvm`, instead of the system default.
|
||||
You can even set an app qube that has also been configured as a disposable template to use itself, so disposables launched from within the app qube/disposable template would inherit the same settings.
|
||||
For example, `anon-whonix` has been set to use `whonix-ws-dvm` as its `default_dispvm`, instead of the system default. You can even set an app qube that has also been configured as a disposable template to use itself, so disposables launched from within the app qube/disposable template would inherit the same settings.
|
||||
|
||||
NetVM and firewall rules for disposable templates can be set as they can for a normal VM.
|
||||
By default a disposable will inherit the NetVM and firewall settings of the disposable template on which it is based.
|
||||
This is a change in behaviour from R3.2, where disposables would inherit the settings of the app qube from which they were launched.
|
||||
Therefore, launching a disposable from an app qube will result in it using the network/firewall settings of the disposable template on which it is based.
|
||||
For example, if an app qube uses sys-net as its NetVM, but the default system disposable uses sys-whonix, any disposable launched from this app qube will have sys-whonix as its NetVM.
|
||||
Network and firewall settings for disposable templates can be set as they can for a normal qube. By default a disposable will inherit the network and firewall settings of the disposable template on which it is based. This is a change in behavior from R3.2, where disposables would inherit the settings of the app qube from which they were launched. Therefore, launching a disposable from an app qube will result in it using the network/firewall settings of the disposable template on which it is based. For example, if an app qube uses sys-net as its net qube, but the default system disposable uses sys-whonix, any disposable launched from this app qube will have sys-whonix as its net qube.
|
||||
|
||||
**Warning:** The opposite is also true.
|
||||
This means if you have changed anon-whonix's `default_dispvm` to use the system default, and the system default disposable uses sys-net, launching a disposable from inside anon-whonix will result in the disposable using sys-net.
|
||||
**Warning:** The opposite is also true. This means if you have changed `anon-whonix`'s `default_dispvm` to use the system default, and the system default disposable uses sys-net, launching a disposable from inside `anon-whonix` will result in the disposable using `sys-net`.
|
||||
|
||||
A disposable launched from the Start Menu inherits the NetVM and firewall settings of the disposable template on which it is based.
|
||||
Note that changing the "NetVM" setting for the system default disposable template *does* affect the NetVM of disposables launched from the Start Menu.
|
||||
Different disposable templates with individual NetVM settings can be added to the Start Menu.
|
||||
A disposable launched from the app menu inherits the net qube and firewall settings of the disposable template on which it is based. Note that changing the net qube setting for the system default disposable template *does* affect the net qube of disposables launched from the app menu. Different disposable templates with individual net qube settings can be added to the app menu.
|
||||
|
||||
**Important Notes:**
|
||||
Some disposable templates will automatically create a menu item to launch a disposable, if you do not see an entry and want to add one please use the command:
|
||||
**Important Notes:** Some disposable templates will automatically create a menu item to launch a disposable. If you do not see an entry and want to add one, please use the command:
|
||||
|
||||
```
|
||||
qvm-features <DISPOSABLE> appmenus-dispvm 1
|
||||
qvm-features <DISPOSABLE_TEMPLATE> appmenus-dispvm 1
|
||||
```
|
||||
|
||||
To launch a disposable template from the command line, in dom0 please type the following:
|
||||
To launch a disposable template from the command line, execute the following command in dom0:
|
||||
|
||||
```
|
||||
qvm-run --dispvm=<DISPOSABLE_TEMPLATE> --service qubes.StartApp+NameOfApp
|
||||
qvm-run --dispvm=<DISPOSABLE_TEMPLATE> --service qubes.StartApp+<APPLICATION>
|
||||
```
|
||||
|
||||
## Opening a file in a disposable via GUI
|
||||
|
||||
In an app qube's file manager, right click on the file you wish to open in a disposable, then choose "View in disposable" or "Edit in disposable".
|
||||
Wait a few seconds and the default application for this file type should appear displaying the file content.
|
||||
This app is running in its own dedicated VM -- a disposable created for the purpose of viewing or editing this very file.
|
||||
Once you close the viewing application the whole disposable will be destroyed.
|
||||
If you have edited the file and saved the changes, the changed file will be saved back to the original app qube, overwriting the original.
|
||||
In an app qube's file manager, right click on the file you wish to open in a disposable, then choose "View in disposable" or "Edit in disposable". Wait a few seconds and the default application for this file type should appear displaying the file content. This app is running in its own dedicated qube -- a disposable created for the purpose of viewing or editing this very file. Once you close the viewing application the whole disposable will be destroyed. If you have edited the file and saved the changes, the changed file will be saved back to the original app qube, overwriting the original.
|
||||
|
||||
![r4.0-open-in-dispvm-1.png](/attachment/doc/r4.0-open-in-dispvm-1.png) ![r4.0-open-in-dispvm-2.png](/attachment/doc/r4.0-open-in-dispvm-2.png)
|
||||
![r4.0-open-in-dispvm-1.png](/attachment/doc/r4.0-open-in-dispvm-1.png)
|
||||
|
||||
![r4.0-open-in-dispvm-2.png](/attachment/doc/r4.0-open-in-dispvm-2.png)
|
||||
|
||||
|
||||
## Opening a fresh web browser instance in a new disposable
|
||||
|
||||
Sometimes it is desirable to open an instance of Firefox within a new fresh disposable.
|
||||
This can be done easily using the Start Menu: just go to **Application Menu -\> Disposable -\> Disposable:Firefox web browser**.
|
||||
Wait a few seconds until a web browser starts.
|
||||
Once you close the viewing application the whole disposable will be destroyed.
|
||||
Sometimes it is desirable to open an instance of Firefox within a new fresh disposable. This can be done easily using the app menu: just go to **Application Menu -> Disposable -> Disposable: Firefox web browser**. Wait a few seconds until a web browser starts. Once you close the viewing application the whole disposable will be destroyed.
|
||||
|
||||
![r4.0-open-in-dispvm-3.png](/attachment/doc/r4.0-open-in-dispvm-3.png)
|
||||
|
||||
@ -140,10 +112,7 @@ This will _not_ override the internal handling of PDF documents in Web browsers.
|
||||
|
||||
## Starting an arbitrary program in a disposable from an app qube
|
||||
|
||||
Sometimes it can be useful to start an arbitrary program in a disposable.
|
||||
The disposable will stay running so long as the process which started the disposable has not exited.
|
||||
Some applications, such as GNOME Terminal, do not wait for the application to close before the process exits (details [here](https://github.com/QubesOS/qubes-issues/issues/2581#issuecomment-272664009)).
|
||||
Starting an arbitrary program can be done from an app qube by running
|
||||
Sometimes it can be useful to start an arbitrary program in a disposable. The disposable will stay running so long as the process which started the disposable has not exited. Some applications, such as GNOME Terminal, do not wait for the application to close before the process exits (details [here](https://github.com/QubesOS/qubes-issues/issues/2581#issuecomment-272664009)). Starting an arbitrary program can be done from an app qube by running
|
||||
|
||||
~~~
|
||||
[user@vault ~]$ qvm-run '@dispvm' xterm
|
||||
@ -153,24 +122,17 @@ The created disposable can be accessed via other tools (such as `qvm-copy-to-vm`
|
||||
|
||||
## Starting an arbitrary application in a disposable via command line from dom0
|
||||
|
||||
The Application Launcher has shortcuts for opening a terminal and a web browser in dedicated disposables, since these are very common tasks.
|
||||
The disposable will stay running so long as the process which started the disposable has not exited.
|
||||
Some applications, such as GNOME Terminal, do not wait for the application to close before the process exits (details [here](https://github.com/QubesOS/qubes-issues/issues/2581#issuecomment-272664009)).
|
||||
It is possible to start an arbitrary application in a disposable directly from dom0 by running:
|
||||
The Application Launcher has shortcuts for opening a terminal and a web browser in dedicated disposables, since these are very common tasks. The disposable will stay running so long as the process which started the disposable has not exited. Some applications, such as GNOME Terminal, do not wait for the application to close before the process exits (details [here](https://github.com/QubesOS/qubes-issues/issues/2581#issuecomment-272664009)). It is possible to start an arbitrary application in a disposable directly from dom0 by running:
|
||||
|
||||
~~~
|
||||
$ qvm-run --dispvm=<DISPOSABLE_TEMPLATE> --service qubes.StartApp+xterm
|
||||
~~~
|
||||
|
||||
The label color will be inherited from `<DISPOSABLE_TEMPLATE>`.
|
||||
(The disposable Application Launcher shortcut used for starting programs runs a very similar command to the one above.)
|
||||
The label color will be inherited from `<DISPOSABLE_TEMPLATE>`. (The disposable Application Launcher shortcut used for starting programs runs a very similar command to the one above.)
|
||||
|
||||
### Opening a link in a disposable based on a non-default disposable template from a qube
|
||||
|
||||
Suppose that the default disposable template for your `email` qube has no networking (e.g., so that untrusted attachments can't phone home).
|
||||
However, sometimes you want to open email links in disposables.
|
||||
Obviously, you can't use the default disposable template, since it has no networking, so you need to be able to specify a different disposable template.
|
||||
You can do that with this command from the `email` qube (as long as your RPC policies allow it):
|
||||
Suppose that the default disposable template for your `email` qube has no networking (e.g., so that untrusted attachments can't phone home). However, sometimes you want to open email links in disposables. Obviously, you can't use the default disposable template, since it has no networking, so you need to be able to specify a different disposable template. You can do that with this command from the `email` qube (as long as your RPC policies allow it):
|
||||
|
||||
~~~
|
||||
$ qvm-open-in-vm @dispvm:<ONLINE_DISPOSABLE_TEMPLATE> https://www.qubes-os.org
|
||||
@ -187,16 +149,14 @@ In dom0, add the following line at the beginning of the file `/etc/qubes-rpc/pol
|
||||
~~~
|
||||
|
||||
This line means:
|
||||
- FROM: Any VM
|
||||
- FROM: Any qube
|
||||
- TO: A disposable based on `<ONLINE_DISPOSABLE_TEMPLATE>`
|
||||
- WHAT: Allow sending an "Open URL" request
|
||||
|
||||
In other words, any VM will be allowed to create a new disposable based on `<ONLINE_DISPOSABLE_TEMPLATE>` and open a URL inside of that disposable.
|
||||
In other words, any qube will be allowed to create a new disposable based on `<ONLINE_DISPOSABLE_TEMPLATE>` and open a URL inside of that disposable.
|
||||
|
||||
More information about RPC policies for disposables can be found [here](/doc/qrexec/#qubes-rpc-administration).
|
||||
|
||||
## Customizing disposables
|
||||
|
||||
You can change the template used to generate the disposables, and change settings used in the disposable savefile.
|
||||
These changes will be reflected in every new disposable based on that template.
|
||||
Full instructions can be found [here](/doc/disposable-customization/).
|
||||
You can change the template used to generate the disposables, and change settings used in the disposable savefile. These changes will be reflected in every new disposable based on that template. Full instructions can be found [here](/doc/disposable-customization/).
|
||||
|
Loading…
Reference in New Issue
Block a user