mirror of
https://github.com/QubesOS/qubes-doc.git
synced 2025-12-15 07:53:07 -05:00
Merge branch 'master' into unman-patch-2
This commit is contained in:
commit
f821799c17
42 changed files with 638 additions and 563 deletions
|
|
@ -1,31 +1,41 @@
|
|||
---
|
||||
layout: doc
|
||||
title: Disposable VM Customization
|
||||
permalink: /doc/dispvm-customization/
|
||||
title: DisposableVM Customization
|
||||
permalink: /doc/disposablevm-customization/
|
||||
redirect_from:
|
||||
- /doc/dispvm-customization/
|
||||
- /en/doc/dispvm-customization/
|
||||
- /doc/DispVMCustomization/
|
||||
- /doc/UserDoc/DispVMCustomization/
|
||||
- /wiki/UserDoc/DispVMCustomization/
|
||||
---
|
||||
|
||||
Disposable VM Customization
|
||||
DisposableVM Customization
|
||||
============================
|
||||
|
||||
Security
|
||||
--------
|
||||
|
||||
If a DVM Template becomes compromised, then any DisposableVM based on that DVM Template could be compromised.
|
||||
Therefore, you should not make any risky customizations (e.g., installing untrusted browser plugins) in important DVM Templates.
|
||||
In particular, the *default* DVM Template is important becuase it is used by the "Open in DisposableVM" 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 DVM Template on a trusted TemplateVM and refrain from making any risky customizations to it.
|
||||
|
||||
Qubes 4.0
|
||||
----------
|
||||
|
||||
Disposable VM (DispVM) in Qubes 4.0 can be based on any TemplateBasedVM. You can also choose to use different AppVMs for different Disposable VMs. To prepare AppVM to be a base for Disposable VM, you need to set `template_for_dispvms` property, for example:
|
||||
A DisposableVM (previously known as a "DispVM") in Qubes 4.0 can be based on any TemplateBasedVM. You can also choose to use different AppVMs for different DisposableVMs. To prepare AppVM to be a base for DisposableVM, you need to set `template_for_dispvms` property, for example:
|
||||
|
||||
[user@dom0 ~]$ qvm-prefs fedora-26-dvm template_for_dispvms True
|
||||
|
||||
Additionally, if you want to have menu entries for starting applications in Disposable VM based on this AppVM (instead of in the AppVM itself), you can achieve it with `appmenus-dispvm` feature:
|
||||
Additionally, if you want to have menu entries for starting applications in DisposableVM based on this AppVM (instead of in the AppVM itself), you can achieve it with `appmenus-dispvm` feature:
|
||||
|
||||
[user@dom0 ~]$ qvm-features fedora-26-dvm appmenus-dispvm 1
|
||||
|
||||
### Creating new Disposable VM base AppVM ###
|
||||
### Creating new DisposableVM base AppVM ###
|
||||
|
||||
In Qubes 4.0, you're no longer restricted to a single DVM Template. Instead, you can create as many as you want. Whenever you start a new Disposable VM, you can choose to base it on whichever DVM Template you like.
|
||||
In Qubes 4.0, you're no longer restricted to a single DVM Template. Instead, you can create as many as you want. Whenever you start a new DisposableVM, you can choose to base it on whichever DVM Template you like.
|
||||
To create new DVM Template, lets say `custom-dvm`, based on `debian-9` template, use following commands:
|
||||
|
||||
[user@dom0 ~]$ qvm-create --template debian-9 --label red custom-dvm
|
||||
|
|
@ -36,30 +46,30 @@ Additionally you may want to set it as default DVM Template:
|
|||
|
||||
[user@dom0 ~]$ qubes-prefs default_dispvm custom-dvm
|
||||
|
||||
The above default is used whenever a qube request starting a new Disposable VM 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/qrexec3/#extra-keywords-available-in-qubes-40-and-later) for details.
|
||||
The above default is used whenever a qube request starting a new DisposableVM 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/qrexec3/#extra-keywords-available-in-qubes-40-and-later) for details.
|
||||
|
||||
If you wish to use the `fedora-minimal` template as a DVM Template, see the "DVM Template" use case under [fedora-minimal customization](/doc/templates/fedora-minimal/#customization).
|
||||
|
||||
|
||||
### Customization of Disposable VM ###
|
||||
### Customization of DisposableVM ###
|
||||
|
||||
It is possible to change the settings for each new Disposable VM (DispVM). This can be done by customizing the base AppVM:
|
||||
It is possible to change the settings for each new DisposableVM. This can be done by customizing the base AppVM:
|
||||
|
||||
1. Start a terminal in the `fedora-26-dvm` qube (or another base for DispVM) 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 DispVM based on that VM (`fedora-26-dvm`). Not in that VM (`fedora-26-dvm`) itself).
|
||||
1. Start a terminal in the `fedora-26-dvm` qube (or another base for DisposableVM) 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 DisposableVM based on that VM (`fedora-26-dvm`). Not in that VM (`fedora-26-dvm`) itself).
|
||||
|
||||
[user@dom0 ~]$ qvm-run -a fedora-26-dvm gnome-terminal
|
||||
|
||||
2. Change the qube's settings and/or applications, as desired. Some examples of changes you may want to make include:
|
||||
- Changing Firefox's default startup settings and homepage.
|
||||
- Changing default editor, image viewer.
|
||||
- Changing the DispVM's default NetVM. For example, you may wish to set the NetVM to "none." Then, whenever you start a new DispVM, you can choose your desired ProxyVM manually (by changing the newly-started DispVMs settings). This is useful if you sometimes wish to use a DispVM with a Whonix Gateway, for example. It is also useful if you sometimes wish to open untrusted files in a network-disconnected DispVM.
|
||||
- Changing the DisposableVM's default NetVM. For example, you may wish to set the NetVM to "none." Then, whenever you start a new DisposableVM, you can choose your desired ProxyVM manually (by changing the newly-started DisposableVMs settings). This is useful if you sometimes wish to use a DisposableVM with a Whonix Gateway, for example. It is also useful if you sometimes wish to open untrusted files in a network-disconnected DisposableVM.
|
||||
|
||||
4. Shutdown the qube (either by `poweroff` from qube's terminal, or `qvm-shutdown` from dom0 terminal).
|
||||
|
||||
|
||||
### Using static Disposable VMs for sys-* ###
|
||||
### Using static DisposableVMs for sys-* ###
|
||||
|
||||
You can use a static DispVM for `sys-*` as long as it is stateless.
|
||||
You can use a static DisposableVM 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 AppVM 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 AppVM.
|
||||
|
|
@ -88,7 +98,7 @@ 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 ''
|
||||
# optional, if this DispVM will be providing networking
|
||||
# optional, if this DisposableVM will be providing networking
|
||||
qvm-prefs <sys-VMName> provides_network true
|
||||
~~~
|
||||
|
||||
|
|
@ -109,31 +119,31 @@ qvm-prefs sys-firewall netvm sys-net2
|
|||
qubes-prefs clockvm sys-net2
|
||||
~~~
|
||||
|
||||
Note that these types of DispVMs will not show in the Application menu, but you can still get to a terminal if needed with `qvm-run <sys-VMName> gnome-terminal`.
|
||||
Note that these types of DisposableVMs will not show in the Application menu, but you can still get to a terminal if needed with `qvm-run <sys-VMName> gnome-terminal`.
|
||||
|
||||
### Adding programs to Disposable VM Application Menu ###
|
||||
### Adding programs to DisposableVM Application Menu ###
|
||||
|
||||
For added convenience, arbitrary programs can be added to the Application Menu of the Disposable VM.
|
||||
For added convenience, arbitrary programs can be added to the Application Menu of the DisposableVM.
|
||||
|
||||
In order to do that, select "Qube settings" entry in selected base AppVM, 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 DispVMs ###
|
||||
### Create Custom sys-net sys-firewall and sys-usb DisposableVMs ###
|
||||
|
||||
Users have the option of creating customized DispVMs for the `sys-net`, `sys-firewall` and `sys-usb` VMs. In this configuration, a fresh VM instance is created each time a DispVM 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.
|
||||
Users have the option of creating customized DisposableVMs for the `sys-net`, `sys-firewall` and `sys-usb` VMs. In this configuration, a fresh VM instance is created each time a DisposableVM 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 DispVMs to autostart at system boot.
|
||||
* Set DisposableVMs to autostart at system boot.
|
||||
* Attach PCI devices with the `--persistent` option.
|
||||
|
||||
Using DispVMs in this manner is ideal for untrusted qubes which require persistent PCI devices, such as USB VMs and NetVMs.
|
||||
Using DisposableVMs 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 dvm for use by each DispVM. If dvm customization is not needed, then a single dvm is used as a template for all DispVMs.
|
||||
>_**Note:**_ Users who want customized VPN or firewall rule sets must create a separate dvm for use by each DisposableVM. If dvm customization is not needed, then a single dvm is used as a template for all DisposableVMs.
|
||||
|
||||
#### Create and configure the dvm from which the DispVM will be based on ####
|
||||
#### Create and configure the dvm from which the DisposableVM will be based on ####
|
||||
|
||||
1. Create the dvm
|
||||
|
||||
|
|
@ -143,13 +153,13 @@ Using DispVMs in this manner is ideal for untrusted qubes which require persiste
|
|||
|
||||
Firewall rules sets and Qubes VPN scripts can be added just like any other VM
|
||||
|
||||
3. Set the dvm as template for DispVMs
|
||||
3. Set the dvm as template for DisposableVMs
|
||||
|
||||
[user@dom0 ~]$ qvm-prefs <dvm_name> template_for_dispvms true
|
||||
|
||||
#### Create the sys-net DispVM ####
|
||||
#### Create the sys-net DisposableVM ####
|
||||
|
||||
1. Create `sys-net` DispVM based on the dvm
|
||||
1. Create `sys-net` DisposableVM based on the dvm
|
||||
|
||||
[user@dom0 ~]$ qvm-create --template <dvm_name> --class DispVM --label red disp-sys-net
|
||||
|
||||
|
|
@ -181,9 +191,9 @@ Using DispVMs in this manner is ideal for untrusted qubes which require persiste
|
|||
|
||||
[user@dom0 ~]$ qubes-prefs clockvm disp-sys-net
|
||||
|
||||
#### Create the sys-firewall DispVM ####
|
||||
#### Create the sys-firewall DisposableVM ####
|
||||
|
||||
1. Create `sys-firewall` DispVM
|
||||
1. Create `sys-firewall` DisposableVM
|
||||
|
||||
[user@dom0 ~]$ qvm-create --template <dvm_name> --class DispVM --label green disp-sys-firewall
|
||||
|
||||
|
|
@ -207,7 +217,7 @@ Using DispVMs in this manner is ideal for untrusted qubes which require persiste
|
|||
|
||||
[user@dom0 ~]$ qubes-prefs default_netvm disp-sys-firewall
|
||||
|
||||
#### Create the sys-usb DispVM ####
|
||||
#### Create the sys-usb DisposableVM ####
|
||||
|
||||
1. Create the `disp-sys-usb`
|
||||
|
||||
|
|
@ -238,9 +248,9 @@ Using DispVMs in this manner is ideal for untrusted qubes which require persiste
|
|||
7. Users should now follow instructions on [How to hide USB controllers from dom0](/doc/usb/#how-to-hide-all-usb-controllers-from-dom0)
|
||||
|
||||
|
||||
#### Starting the DispVMs ####
|
||||
#### Starting the DisposableVMs ####
|
||||
|
||||
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 DispVMs fail to start.
|
||||
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 DisposableVMs fail to start.
|
||||
|
||||
Detach PCI device from VM
|
||||
|
||||
|
|
@ -254,7 +264,7 @@ The `disp-sys-usb` VM does not start
|
|||
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/assigning-devices/#pci-passthrough-issues)
|
||||
|
||||
|
||||
### Deleting Disposable VM ###
|
||||
### Deleting DisposableVM ###
|
||||
|
||||
Deleting disposable VM is slightly peculiar. While working in a VM or disposable VM, you may want to open a document in another disposable VM. For this reason, the property `default_dispvm` may be set to the name of your disposable VM in a number of VMs:
|
||||
|
||||
|
|
@ -282,15 +292,15 @@ Qubes 3.2
|
|||
|
||||
You may want to use a non-default template the [DVM Template](/doc/glossary/#dvm-template). One example is to use a less-trusted template with some less trusted, third-party, often unsigned, applications installed, such as e.g. third-party printer drivers.
|
||||
|
||||
In order to regenerate the Disposable VM "snapshot" (called 'savefile' on Qubes) one can use the following command in Dom0:
|
||||
In order to regenerate the DisposableVM "snapshot" (called 'savefile' on Qubes) one can use the following command in Dom0:
|
||||
|
||||
[user@dom0 ~]$ qvm-create-default-dvm <custom-template-name>
|
||||
|
||||
This would create a new Disposable VM savefile based on the custom template.
|
||||
This would create a new DisposableVM savefile based on the custom template.
|
||||
For example `<custom-template-name>` could be the name of the existing `debian-8` vm, which creates the disposable vm `debain-8-dvm`.
|
||||
Now, whenever one opens a file (from any AppVM) in a Disposable VM, a Disposable VM based on this template will be used.
|
||||
Now, whenever one opens a file (from any AppVM) in a DisposableVM, a DisposableVM based on this template will be used.
|
||||
|
||||
One can easily verify if the new Disposable VM template is indeed based on a custom template (in the example below the template called "f17-yellow" was used as a basis for the Disposable VM):
|
||||
One can easily verify if the new DisposableVM template is indeed based on a custom template (in the example below the template called "f17-yellow" was used as a basis for the DisposableVM):
|
||||
|
||||
|
||||
[user@dom0 ~]$ ll /var/lib/qubes/dvmdata/
|
||||
|
|
@ -302,19 +312,19 @@ One can easily verify if the new Disposable VM template is indeed based on a cus
|
|||
If you wish to use the `fedora-minimal` template as a DVM Template, see the "DVM Template" use case under [fedora-minimal customization](/doc/templates/fedora-minimal/#customization).
|
||||
|
||||
|
||||
### Customization of Disposable VM ###
|
||||
### Customization of DisposableVM ###
|
||||
|
||||
It is possible to change the settings of each new Disposable VM (DispVM). This can be done by customizing the DispVM template:
|
||||
It is possible to change the settings of each new DisposableVM. This can be done by customizing the DVM Template:
|
||||
|
||||
1. Start a terminal in the `fedora-23-dvm` TemplateVM by running the following command in a dom0 terminal. (By default, this TemplateVM is not shown in Qubes VM Manager. However, it can be shown by selecting "Show/Hide internal VMs.")
|
||||
|
||||
|
||||
[user@dom0 ~]$ qvm-run -a fedora-23-dvm gnome-terminal
|
||||
|
||||
2. Change the VM's settings and/or applications, as desired. Note that currently Qubes supports exactly one DispVM template, so any changes you make here will affect all DispVMs. Some examples of changes you may want to make include:
|
||||
2. Change the VM's settings and/or applications, as desired. Note that currently Qubes supports exactly one DVM Template, so any changes you make here will affect all DisposableVMs. Some examples of changes you may want to make include:
|
||||
- Changing Firefox's default startup settings and homepage.
|
||||
- Changing Nautilus' default file preview settings.
|
||||
- Changing the DispVM's default NetVM. For example, you may wish to set the NetVM to "none." Then, whenever you start a new DispVM, you can choose your desired ProxyVM manually (by changing the newly-started DispVM's settings). This is useful if you sometimes wish to use a DispVM with a Whonix Gateway, for example. It is also useful if you sometimes wish to open untrusted files in a network-disconnected DispVM.
|
||||
- Changing the DisposableVM's default NetVM. For example, you may wish to set the NetVM to "none." Then, whenever you start a new DisposableVM, you can choose your desired ProxyVM manually (by changing the newly-started DisposableVM's settings). This is useful if you sometimes wish to use a DisposableVM with a Whonix Gateway, for example. It is also useful if you sometimes wish to open untrusted files in a network-disconnected DisposableVM.
|
||||
|
||||
3. Create an empty `/home/user/.qubes-dispvm-customized` file in the VM (not in dom0):
|
||||
|
||||
|
|
@ -322,11 +332,11 @@ It is possible to change the settings of each new Disposable VM (DispVM). This c
|
|||
[user@fedora-23-dvm ~]$ touch /home/user/.qubes-dispvm-customized
|
||||
|
||||
4. Shutdown the VM (either by `poweroff` from VM terminal, or `qvm-shutdown` from dom0 terminal).
|
||||
5. Regenerate the DispVM template using the default template:
|
||||
5. Regenerate the DVM Template using the default template:
|
||||
|
||||
[user@dom0 ~]$ qvm-create-default-dvm --default-template
|
||||
|
||||
Or, if you're [using a non-default template](#changing-the-dvm-template), regenerate the DispVM using your custom template:
|
||||
Or, if you're [using a non-default template](#changing-the-dvm-template), regenerate the DVM Template using your custom template:
|
||||
|
||||
[user@dom0 ~]$ qvm-create-default-dvm <custom-template-name>
|
||||
|
||||
|
|
@ -334,9 +344,9 @@ It is possible to change the settings of each new Disposable VM (DispVM). This c
|
|||
**Note:** All of the above requires at least qubes-core-vm \>= 2.1.2 installed in template.
|
||||
|
||||
|
||||
### Adding arbitrary programs to Disposable VM Application Menu ###
|
||||
### Adding arbitrary programs to DisposableVM Application Menu ###
|
||||
|
||||
For added convenience, arbitrary programs can be added to the Application Menu of the Disposable VM. In order to do that create (e.g.) `arbitrary.desktop` file in `/usr/local/share/applications` in Dom0. That file will point to the desired program. Use the following template for the file:
|
||||
For added convenience, arbitrary programs can be added to the Application Menu of the DisposableVM. In order to do that create (e.g.) `arbitrary.desktop` file in `/usr/local/share/applications` in Dom0. That file will point to the desired program. Use the following template for the file:
|
||||
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
|
|
@ -359,4 +369,4 @@ Add a `<Filename>arbitrary.desktop</Filename>` line so that your modified file l
|
|||
<Filename>arbitrary.desktop</Filename>
|
||||
</Include>
|
||||
|
||||
After saving the changes the new shortcut should appear in the Disposable VM Applications menu.
|
||||
After saving the changes the new shortcut should appear in the DisposableVM Applications menu.
|
||||
|
|
@ -11,18 +11,25 @@ redirect_from:
|
|||
|
||||
# i3 installation in dom0
|
||||
|
||||
i3 is part of the testing repository (as of Qubes R3.1) and can be installed from there
|
||||
using the dom0 update mechanism.
|
||||
i3 is part of the stable repository (as of Qubes R3.1) and can be installed by
|
||||
using the [dom0 update mechanism](/doc/software-update-dom0/). To install the i3
|
||||
window manager and the its Qubes specific configuration:
|
||||
|
||||
$ sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing i3
|
||||
|
||||
Qubes-specific configuation is available in a separate package and can be installed
|
||||
optionally. Otherwise you can write your own configuration (see below).
|
||||
$ sudo qubes-dom0-update i3 i3-settings-qubes
|
||||
|
||||
The Qubes-specific configuration (package `i3-settings-qubes`) can be installed
|
||||
optionally in case you would prefer writing your own configuration (see
|
||||
[customization](#customization) section for scripts and configuration).
|
||||
|
||||
$ sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing i3-settings-qubes
|
||||
|
||||
That's it. After logging out, you can select i3 in the login manager.
|
||||
|
||||
### Customization
|
||||
|
||||
* [xdg_autostart_script](https://gist.github.com/SietsevanderMolen/7b4cc32ce7b4884513b0a639540e454f)
|
||||
* [i3bar_script](https://gist.github.com/SietsevanderMolen/e7f594f209dfaa3596907e427b657e30)
|
||||
* [terminal_start_script](https://gist.github.com/SietsevanderMolen/7c6f2b5773dbc0c08e1509e49abd1e96)
|
||||
* [i3 config with dmenu-i3-window-jumper](https://github.com/anadahz/qubes-i3-config/blob/master/config)
|
||||
|
||||
## Compilation and installation from source
|
||||
|
||||
Note that the compilation from source is done in a Fedora based domU (could
|
||||
|
|
@ -33,7 +40,7 @@ installed through the package manager.
|
|||
|
||||
Clone the i3-qubes repository here:
|
||||
|
||||
$ git clone https://github.com/SietsevanderMolen/i3-qubes.git
|
||||
$ git clone https://github.com/QubesOS/qubes-desktop-linux-i3
|
||||
|
||||
In this case, the most interesting file is probably
|
||||
`i3/0001-Show-qubes-domain-in-non-optional-colored-borders.patch` It's the patch
|
||||
|
|
@ -47,7 +54,7 @@ it.
|
|||
### Building
|
||||
|
||||
You'll need to install the build dependencies, which are listed in
|
||||
build-deps.list. You can verify them and then install them with
|
||||
build-deps.list. You can verify them and then install them with:
|
||||
|
||||
$ sudo dnf install -y $(cat build-deps.list)
|
||||
|
||||
|
|
@ -76,12 +83,8 @@ dependencies that we can easily install with:
|
|||
rxvt-unicode xcb-util-wm perl-JSON-XS xcb-util-cursor \\
|
||||
dzen2 dmenu xorg-x11-fonts-misc libev
|
||||
|
||||
After that you can just install the generated rpm like any other local package
|
||||
After that you can just install the generated rpm like any other local package:
|
||||
|
||||
$ sudo yum localinstall i3.rpm
|
||||
|
||||
Log out, select i3, then log in again.
|
||||
|
||||
[xdg_autostart_script]:https://gist.github.com/SietsevanderMolen/7b4cc32ce7b4884513b0a639540e454f
|
||||
[i3bar_script]: https://gist.github.com/SietsevanderMolen/e7f594f209dfaa3596907e427b657e30
|
||||
[terminal_start_script]: https://gist.github.com/SietsevanderMolen/7c6f2b5773dbc0c08e1509e49abd1e96
|
||||
|
|
|
|||
93
customization/removing-templatevm-packages.md
Normal file
93
customization/removing-templatevm-packages.md
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
---
|
||||
layout: doc
|
||||
title: Removing TemplateVM Packages
|
||||
permalink: /doc/removing-templatevm-packages/
|
||||
---
|
||||
|
||||
# Removing TemplateVM Packages
|
||||
When removing any packages from a default TemplateVM, be sure to check what's being removed by `apt autoremove` or `dnf`.
|
||||
When removing certain packages, for instance Thunderbird, `apt` and `dnf` will attempt to remove many packages required by qubes for the template to function correctly under qubes.
|
||||
|
||||
As an example from a terminal in a TemplateVM:
|
||||
```shell_session
|
||||
$ sudo apt remove thunderbird
|
||||
Reading package lists... Done
|
||||
Building dependency tree
|
||||
Reading state information... Done
|
||||
The following packages were automatically installed and are no longer required:
|
||||
debugedit libjs-sphinxdoc libjs-underscore librpm3 librpmbuild3 librpmio3
|
||||
librpmsign3 libsqlite0 linux-headers-4.9.0-6-amd64
|
||||
linux-headers-4.9.0-6-common linux-image-4.9.0-6-amd64 python-backports-abc
|
||||
python-cffi-backend python-concurrent.futures python-croniter
|
||||
python-cryptography python-dateutil python-enum34 python-idna
|
||||
python-iniparse python-ipaddress python-jinja2 python-libxml2 python-lzma
|
||||
python-markupsafe python-msgpack python-openssl python-pyasn1 python-pycurl
|
||||
python-requests python-rpm python-singledispatch python-six python-sqlite
|
||||
python-sqlitecachec python-tornado python-tz python-urlgrabber
|
||||
python-urllib3 python-xpyb python-yaml qubes-core-agent-dom0-updates
|
||||
qubes-core-agent-passwordless-root qubes-gpg-split qubes-img-converter
|
||||
qubes-input-proxy-sender qubes-mgmt-salt-vm-connector qubes-pdf-converter
|
||||
qubes-usb-proxy rpm rpm-common rpm2cpio salt-common salt-ssh usbutils yum
|
||||
yum-utils
|
||||
Use 'sudo apt autoremove' to remove them.
|
||||
The following packages will be REMOVED:
|
||||
icedove lightning qubes-thunderbird qubes-vm-recommended thunderbird
|
||||
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
|
||||
After this operation, 151 MB disk space will be freed.
|
||||
Do you want to continue? [Y/n]
|
||||
```
|
||||
|
||||
Note all of the qubes packages are tracked as dependencies that will no longer be required. `apt remove` will only remove the packages listed, which is ok.
|
||||
If, however you also run `apt autoremove` the other qubes packages necessary for TemplateVMs will be removed.
|
||||
|
||||
If you'd still like to remove one of these applications without breaking your TemplateVM you have a couple different options.
|
||||
|
||||
## Removing Only Packages Not Needed for a Qubes TemplateVM
|
||||
|
||||
### Debian
|
||||
1. In your TemplateVM terminal run:
|
||||
```shell_session $ apt remove package-name```
|
||||
Note the packages "no longer required"
|
||||
2. If the list of "no longer required" packages includes anything beginning with `qubes-` or `salt-` make a note to yourself to **never** run `$ sudo apt autoremove` on this TemplateVM
|
||||
|
||||
**Recommended but optional:** Use `apt-mark` to make `apt autoremove` safe again.
|
||||
```shell_session
|
||||
$ sudo apt mark-manual package-name package-name
|
||||
```
|
||||
|
||||
Replace package-names with actual `qubes-*` and `salt-*` packages you'd like to retain.
|
||||
|
||||
For example, still in your TemplateVM terminal:
|
||||
```shell_session
|
||||
$ sudo apt-mark manual qubes-core-agent-dom0-updates qubes-core-agent-passwordless-root qubes-gpg-split qubes-img-converter qubes-input-proxy-sender qubes-mgmt-salt-vm-connector qubes-pdf-converter salt-common salt-ssh qubes-usb-proxy
|
||||
```
|
||||
|
||||
`$ apt autoremove` should now be safe to use.
|
||||
|
||||
### Fedora
|
||||
In your TemplateVM terminal, run:
|
||||
```shell_session
|
||||
$ dnf remove --noautoremove package-name
|
||||
```
|
||||
|
||||
|
||||
## Recovering A TemplateVM which you've already removed needed qubes-* packages
|
||||
If you've already removed packages, run `apt autoremove` and restarted your VM you've lost passwordless sudo access.
|
||||
You can login as root, open a terminal in dom0 and run:
|
||||
```shell_session
|
||||
$ qvm-run -u root vmname xterm
|
||||
```
|
||||
This will open an xterm terminal in the TemplateVM named `vmname`
|
||||
|
||||
Once you're logged in as root, reinstall these packages & their dependencies:
|
||||
|
||||
### Debian
|
||||
```shell_session
|
||||
$ sudo apt install qubes-core-agent-dom0-updates qubes-core-agent-passwordless-root qubes-gpg-split qubes-img-converter qubes-input-proxy-sender qubes-mgmt-salt-vm-connector qubes-pdf-converter salt-common salt-ssh
|
||||
```
|
||||
|
||||
### Fedora
|
||||
Similar to Debian for example (package names may vary):
|
||||
```shell_session
|
||||
$ sudo dnf install qubes-core-agent-dom0-updates qubes-core-agent-passwordless-root qubes-gpg-split qubes-img-converter qubes-input-proxy-sender qubes-mgmt-salt-vm-connector qubes-pdf-converter salt-common salt-ssh
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue