mirror of
https://github.com/QubesOS/qubes-doc.git
synced 2025-04-16 06:03:17 -04:00
Compare commits
31 Commits
adw_c4129f
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f8e2bb2258 | ||
![]() |
b9bec14ae4 | ||
![]() |
df5f5b9ede | ||
![]() |
63ad8ab1c1 | ||
![]() |
81e4abc416 | ||
![]() |
7b8f4e0740 | ||
![]() |
362b0618b6 | ||
![]() |
68be810d95 | ||
![]() |
abdafabff2 | ||
![]() |
674f9b6dd2 | ||
![]() |
187db01576 | ||
![]() |
06e37e444b | ||
![]() |
8ae7c24958 | ||
![]() |
ec1f501c53 | ||
![]() |
0aee55a8dd | ||
![]() |
6e15603483 | ||
![]() |
1e7a9f7437 | ||
![]() |
781780f07e | ||
![]() |
e1abb55e63 | ||
![]() |
f24299be1e | ||
![]() |
d4778384da | ||
![]() |
0251ed63d5 | ||
![]() |
51d387a9fe | ||
![]() |
35b16e2e37 | ||
![]() |
034976f80f | ||
![]() |
3b550699af | ||
![]() |
f43e54f3a5 | ||
![]() |
edbfa3c9b6 | ||
![]() |
39342e8c98 | ||
![]() |
b6c99d486b | ||
![]() |
9eb7926ffe |
@ -12,42 +12,41 @@ title: Development workflow
|
|||||||
|
|
||||||
A workflow for developing Qubes OS+
|
A workflow for developing Qubes OS+
|
||||||
|
|
||||||
First things first, setup [QubesBuilder](/doc/qubes-builder/). This guide
|
To begin, setup [QubesBuilder](/doc/qubes-builder-v2/). This guide
|
||||||
assumes you're using qubes-builder to build Qubes.
|
assumes you're using qubes-builder v2 to build Qubes.
|
||||||
|
|
||||||
## Repositories and committing Code
|
## Repositories and committing Code
|
||||||
|
|
||||||
Qubes is split into a bunch of git repos. These are all contained in the
|
Qubes source code is split into many git repos. These are all contained in the
|
||||||
`qubes-src` directory under qubes-builder. Subdirectories there are separate
|
`artifacts/sources` directory under qubes-builder. Subdirectories there are
|
||||||
components, stored in separate git repositories.
|
separate components, stored in separate git repositories.
|
||||||
|
|
||||||
The best way to write and contribute code is to create a git repo somewhere
|
The best way to write and contribute code is to create a git repo somewhere
|
||||||
(e.g., github) for the repo you are interested in editing (e.g.,
|
(e.g., GitHub) for the repo you are interested in editing (e.g.,
|
||||||
`qubes-manager`, `core-agent-linux`, etc). To integrate your repo with the rest
|
`qubes-manager`, `core-agent-linux`, etc). To integrate your repo with the rest
|
||||||
of Qubes, cd to the repo directory and add your repository as a remote in git
|
of Qubes, cd to the repo directory and add your repository as a remote in git
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
$ cd qubes-builder/qubes-src/qubes-manager
|
$ cd qubes-builder/artifacts/sources/qubes-manager
|
||||||
$ git remote add abel git@github.com:abeluck/qubes-manager.git
|
$ git remote add abel git@GitHub.com:abeluck/qubes-manager.git
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
You can then proceed to easily develop in your own branches, pull in new
|
You can then proceed to easily develop in your own branches, pull in new
|
||||||
commits from the dev branches, merge them, and eventually push to your own repo
|
commits from the dev branches, merge them, and eventually push to your own repo.
|
||||||
on github.
|
|
||||||
|
|
||||||
When you are ready to submit your changes to Qubes to be merged, push your
|
When you are ready to submit your changes to Qubes to be merged, push your
|
||||||
changes, then create a signed git tag (using `git tag -s`). Finally, send a
|
changes, then create a signed git tag (using `git tag -s`). Finally, send a
|
||||||
letter to the Qubes listserv describing the changes and including the link to
|
letter to the Qubes listserv describing the changes, and including a link to
|
||||||
your repository. You can also create pull request on github. Don't forget to
|
your repository. If you are using GitHub you can instead create a pull request.
|
||||||
include your public PGP key you use to sign your tags.
|
Don't forget to include the public PGP key you use to sign your tags.
|
||||||
|
|
||||||
### Kernel-specific notes
|
### Kernel-specific notes
|
||||||
|
|
||||||
#### Prepare fresh version of kernel sources, with Qubes-specific patches applied
|
#### Prepare fresh version of kernel sources, with Qubes-specific patches applied
|
||||||
|
|
||||||
In qubes-builder/qubes-src/linux-kernel:
|
In qubes-builder/artifacts/sources/linux-kernel:
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
make prep
|
make prep
|
||||||
@ -66,7 +65,7 @@ drwxr-xr-x 6 user user 4096 Nov 21 20:48 kernel-3.4.18/linux-obj
|
|||||||
|
|
||||||
#### Go to the kernel tree and update the version
|
#### Go to the kernel tree and update the version
|
||||||
|
|
||||||
In qubes-builder/qubes-src/linux-kernel:
|
In qubes-builder/artifacts/sources/linux-kernel:
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
cd kernel-3.4.18/linux-3.4.18
|
cd kernel-3.4.18/linux-3.4.18
|
||||||
@ -117,9 +116,7 @@ vi series.conf
|
|||||||
|
|
||||||
#### Building RPMs
|
#### Building RPMs
|
||||||
|
|
||||||
TODO: Is this step generic for all subsystems?
|
Now is a good moment to make sure you have changed the kernel release name in
|
||||||
|
|
||||||
Now it is a good moment to make sure you have changed kernel release name in
|
|
||||||
rel file. For example, if you change it to '1debug201211116c' the
|
rel file. For example, if you change it to '1debug201211116c' the
|
||||||
resulting RPMs will be named
|
resulting RPMs will be named
|
||||||
'kernel-3.4.18-1debug20121116c.pvops.qubes.x86\_64.rpm'. This will help
|
'kernel-3.4.18-1debug20121116c.pvops.qubes.x86\_64.rpm'. This will help
|
||||||
@ -131,34 +128,23 @@ your changes locally.
|
|||||||
To actually build RPMs, in qubes-builder:
|
To actually build RPMs, in qubes-builder:
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
make linux-kernel
|
./qb -c linux-kernel package fetch prep build
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
RPMs will appear in qubes-src/linux-kernel/pkgs/fc20/x86\_64:
|
RPMs will appear in
|
||||||
|
`artifacts/repository/destination_name/package_name`
|
||||||
|
(for example `artifacts/repository/host-fc37/linux-kernel-6.6.31-1.1/`
|
||||||
|
|
||||||
~~~
|
### Useful [QubesBuilder](/doc/qubes-builder-v2/) commands
|
||||||
-rw-rw-r-- 1 user user 42996126 Nov 17 04:08 kernel-3.4.18-1debug20121116c.pvops.qubes.x86_64.rpm
|
|
||||||
-rw-rw-r-- 1 user user 43001450 Nov 17 05:36 kernel-3.4.18-1debug20121117a.pvops.qubes.x86_64.rpm
|
|
||||||
-rw-rw-r-- 1 user user 8940138 Nov 17 04:08 kernel-devel-3.4.18-1debug20121116c.pvops.qubes.x86_64.rpm
|
|
||||||
-rw-rw-r-- 1 user user 8937818 Nov 17 05:36 kernel-devel-3.4.18-1debug20121117a.pvops.qubes.x86_64.rpm
|
|
||||||
-rw-rw-r-- 1 user user 54490741 Nov 17 04:08 kernel-qubes-vm-3.4.18-1debug20121116c.pvops.qubes.x86_64.rpm
|
|
||||||
-rw-rw-r-- 1 user user 54502117 Nov 17 05:37 kernel-qubes-vm-3.4.18-1debug20121117a.pvops.qubes.x86_64.rpm
|
|
||||||
~~~
|
|
||||||
|
|
||||||
### Useful [QubesBuilder](/doc/qubes-builder/) commands
|
1. `./qb package diff` - show uncommitted changes
|
||||||
|
2. ` ./qb repository check-release-status-for-component` and
|
||||||
1. `make check` - will check if all the code was committed into repository and
|
`./qb repository check-release-status-for-template`- show version of each
|
||||||
if all repository are tagged with signed tag.
|
component/template (based on git tags)
|
||||||
2. `make show-vtags` - show version of each component (based on git tags) -
|
3. `./qb package sign` - sign built packages
|
||||||
mostly useful just before building ISO. **Note:** this will not show version
|
4. `./qb package publish` and `./qb package upload` - publish signed packages
|
||||||
for components containing changes since last version tag.
|
and upload published
|
||||||
3. `make push` - push change from **all** repositories to git server. You must
|
repository
|
||||||
set proper remotes (see above) for all repositories first.
|
|
||||||
4. `make prepare-merge` - fetch changes from remote repositories (can be
|
|
||||||
specified on commandline via GIT\_SUBDIR or GIT\_REMOTE vars), (optionally)
|
|
||||||
verify tags and show the changes. This do not merge the changes - there are
|
|
||||||
left for review as FETCH\_HEAD ref. You can merge them using `git merge
|
|
||||||
FETCH_HEAD` (in each repo directory). Or `make do-merge` to merge all of them.
|
|
||||||
|
|
||||||
## Copying Code to dom0
|
## Copying Code to dom0
|
||||||
|
|
||||||
@ -297,12 +283,12 @@ if [ "$1" = "tb" ]; then
|
|||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git remote add $1 git@github.com:$1/qubes-`basename $PWD`
|
git remote add $1 git@GitHub.com:$1/qubes-`basename $PWD`
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
It should be executed from component top level directory. This script takes one
|
It should be executed from component top level directory. This script takes one
|
||||||
argument - remote name. If it is `tb`, then it creates qrexec-based git remote
|
argument - remote name. If it is `tb`, then it creates qrexec-based git remote
|
||||||
to `testbuilder` VM. Otherwise it creates remote pointing at github account of
|
to `testbuilder` VM. Otherwise it creates remote pointing at GitHub account of
|
||||||
the same name. In any case it points at repository matching current directory
|
the same name. In any case it points at repository matching current directory
|
||||||
name.
|
name.
|
||||||
|
|
||||||
@ -321,7 +307,7 @@ current and current-testing).
|
|||||||
|
|
||||||
### RPM packages - yum repo
|
### RPM packages - yum repo
|
||||||
|
|
||||||
In source VM, grab [linux-yum](https://github.com/QubesOS/qubes-linux-yum) repository (below is assumed you've made it in
|
In source VM, grab [linux-yum](https://GitHub.com/QubesOS/qubes-linux-yum) repository (below is assumed you've made it in
|
||||||
`~/repo-yum-upload` directory) and replace `update_repo.sh` script with:
|
`~/repo-yum-upload` directory) and replace `update_repo.sh` script with:
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
@ -337,7 +323,7 @@ find -type f -name '*.rpm' -delete
|
|||||||
qrexec-client-vm $VMNAME local.UpdateYum
|
qrexec-client-vm $VMNAME local.UpdateYum
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
In target VM, setup actual yum repository (also based on [linux-yum](https://github.com/QubesOS/qubes-linux-yum), this time
|
In target VM, setup actual yum repository (also based on [linux-yum](https://GitHub.com/QubesOS/qubes-linux-yum), this time
|
||||||
without modifications). You will also need to setup some gpg key for signing
|
without modifications). You will also need to setup some gpg key for signing
|
||||||
packages (it is possible to force yum to install unsigned packages, but it
|
packages (it is possible to force yum to install unsigned packages, but it
|
||||||
isn't possible for `qubes-dom0-update` tool). Fill `~/.rpmmacros` with
|
isn't possible for `qubes-dom0-update` tool). Fill `~/.rpmmacros` with
|
||||||
@ -417,7 +403,7 @@ Remember to also import gpg public key using `rpm --import`.
|
|||||||
|
|
||||||
Steps are mostly the same as in the case of yum repo. The only details that differ:
|
Steps are mostly the same as in the case of yum repo. The only details that differ:
|
||||||
|
|
||||||
- use [linux-deb](https://github.com/QubesOS/qubes-linux-deb) instead of [linux-yum](https://github.com/QubesOS/qubes-linux-yum) as a base - both in source and target VM
|
- use [linux-deb](https://GitHub.com/QubesOS/qubes-linux-deb) instead of [linux-yum](https://GitHub.com/QubesOS/qubes-linux-yum) as a base - both in source and target VM
|
||||||
- use different `update_repo.sh` script in source VM (below)
|
- use different `update_repo.sh` script in source VM (below)
|
||||||
- use `local.UpdateApt` qrexec service in target VM (code below)
|
- use `local.UpdateApt` qrexec service in target VM (code below)
|
||||||
- in target VM additionally place `update-local-repo.sh` script in repository dir (code below)
|
- in target VM additionally place `update-local-repo.sh` script in repository dir (code below)
|
||||||
|
162
developer/building/qubes-builder-v2.md
Normal file
162
developer/building/qubes-builder-v2.md
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
---
|
||||||
|
lang: en
|
||||||
|
layout: doc
|
||||||
|
permalink: /doc/qubes-builder-v2/
|
||||||
|
redirect_from:
|
||||||
|
- /en/doc/qubes-builder-v2/
|
||||||
|
- /doc/QubesBuilder2/
|
||||||
|
- /wiki/QubesBuilder2/
|
||||||
|
ref: 311
|
||||||
|
title: Qubes builder v2
|
||||||
|
---
|
||||||
|
|
||||||
|
This is a brief introduction to using Qubes Builder v2 to work with Qubes OS
|
||||||
|
sources. It will walk you through installing and configuring Builder v2, and
|
||||||
|
using it to fetch and build Qubes OS packages.
|
||||||
|
|
||||||
|
For details and customization, use [Qubes OS v2 builder documentation](https://github.com/QubesOS/qubes-builderv2/).
|
||||||
|
|
||||||
|
# Overview
|
||||||
|
|
||||||
|
In the second generation of Qubes OS builder, container or disposable qube
|
||||||
|
isolation is used to perform every stage of the build and release process.
|
||||||
|
From fetching sources to building, everything is executed inside an isolated
|
||||||
|
*cage* (either a disposable or a container) using an *executor*. For every
|
||||||
|
command that needs to perform an action on sources, like cloning and
|
||||||
|
verifying Git repos, rendering a SPEC file, generating SRPM or Debian
|
||||||
|
source packages, a new cage is used. Only the signing, publishing, and
|
||||||
|
uploading stages are executed locally outside a cage.
|
||||||
|
|
||||||
|
|
||||||
|
# Setup
|
||||||
|
|
||||||
|
This is a simple setup using a docker executor. This is a good default choice;
|
||||||
|
if you don't know which executor to use, use docker.
|
||||||
|
|
||||||
|
1. First, decide what qube you are going to use when working with Qubes
|
||||||
|
Builder v2. It can be an AppVM or a Standalone qube, with some steps
|
||||||
|
different between the two.
|
||||||
|
|
||||||
|
2. Installing dependencies
|
||||||
|
|
||||||
|
If you want to use an app qube for developing, install dependencies in the template.
|
||||||
|
If you are using a standalone, install them in the qube itself.
|
||||||
|
Dependencies are specified in `dependencies-*.
|
||||||
|
txt` files in the main builder directory, and you can install them easily
|
||||||
|
in the following ways:
|
||||||
|
1. for Fedora, use:
|
||||||
|
```shell
|
||||||
|
$ sudo dnf install $(cat dependencies-fedora.txt)
|
||||||
|
$ test -f /usr/share/qubes/marker-vm && sudo dnf install qubes-gpg-split
|
||||||
|
```
|
||||||
|
2. for Debian (note: some Debian packages require Debian version 13 or
|
||||||
|
later), use:
|
||||||
|
```shell
|
||||||
|
$ sudo apt install $(cat dependencies-debian.txt)
|
||||||
|
$ test -f /usr/share/qubes/marker-vm && sudo apt install qubes-gpg-split
|
||||||
|
```
|
||||||
|
|
||||||
|
If you have installed dependencies in the template, close it, and
|
||||||
|
(re)start the development qube.
|
||||||
|
|
||||||
|
3. Clone the qubes-builder v2 repository into a location of your choice:
|
||||||
|
```shell
|
||||||
|
git clone https://github.com/QubesOS/qubes-builderv2
|
||||||
|
cd qubes-builderv2/
|
||||||
|
```
|
||||||
|
|
||||||
|
4. If you haven't previously used docker in the current qube, you need to set up
|
||||||
|
some permissions. In particular, the user has to be added to the `docker`
|
||||||
|
group:
|
||||||
|
```shell
|
||||||
|
$ sudo usermod -aG docker user
|
||||||
|
```
|
||||||
|
Next, **restart the qube**.
|
||||||
|
|
||||||
|
5. Finally, you need to generate a docker image:
|
||||||
|
```shell
|
||||||
|
$ tools/generate-container-image.sh docker
|
||||||
|
```
|
||||||
|
|
||||||
|
In an app qube, as `/var/lib/docker` is not persistent by default, you also
|
||||||
|
need to use [bind-dirs](/doc/bind-dirs/) to avoid repeating this step after reboot, adding
|
||||||
|
the following to the `/rw/config/qubes-bind-dirs.d/docker.conf` file in
|
||||||
|
this qube:
|
||||||
|
|
||||||
|
```
|
||||||
|
binds+=( '/var/lib/docker' )
|
||||||
|
```
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
|
||||||
|
To use Qubes OS Builder v2, you need to have a `builder.yml` configuration file.
|
||||||
|
You can use one of the sample files from the `example-configs/` directory; for a
|
||||||
|
more readable `builder.yml`, you can also include one of the files from that
|
||||||
|
directory in your `builder.yml`. An example `builder.yml` is:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# include configuration relevant for the current release
|
||||||
|
include:
|
||||||
|
- example-configs/qubes-os-r4.2.yml
|
||||||
|
|
||||||
|
# which repository to use to fetch sources
|
||||||
|
use-qubes-repo:
|
||||||
|
version: 4.2
|
||||||
|
testing: true
|
||||||
|
|
||||||
|
# each package built will have local build number appended to package release
|
||||||
|
# number. It makes it easier to update in testing environment
|
||||||
|
increment-devel-versions: true
|
||||||
|
|
||||||
|
# reduce output
|
||||||
|
debug: false
|
||||||
|
|
||||||
|
# this can be set to true if you do not want sources to be automatically
|
||||||
|
# fetched from git
|
||||||
|
skip-git-fetch: false
|
||||||
|
|
||||||
|
# executor configuration
|
||||||
|
executor:
|
||||||
|
type: docker
|
||||||
|
options:
|
||||||
|
image: "qubes-builder-fedora:latest"
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# Using Builder v2
|
||||||
|
|
||||||
|
To fetch sources - in this example, for the `core-admin-client` package, you
|
||||||
|
can use the following command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ ./qb -c core-admin-client package fetch
|
||||||
|
```
|
||||||
|
|
||||||
|
This will fetch the sources for the listed package and place them in
|
||||||
|
`artifacts/sources` directory.
|
||||||
|
|
||||||
|
To build a package (from sources in the `artifacts/sources` directory), use:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ ./qb -c core-admin-client package fetch prep build
|
||||||
|
```
|
||||||
|
|
||||||
|
or, if you want to build for a specific target (`host-fc37` is a `dom0`
|
||||||
|
using Fedora 37, `vm-fc40` would be a qube using Fedora 40 etc.), use:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ ./qb -c core-admin-client -d host-fc37 package fetch prep build
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to fetch the entire Qubes OS source use the following:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ ./qb package fetch
|
||||||
|
```
|
||||||
|
|
||||||
|
**caution**: some repositories might have additional requirements. You can
|
||||||
|
disable repositories that are not needed in the `example-configs/*.yml`
|
||||||
|
file you are using by commenting them out. In particular, `python-fido2`,
|
||||||
|
`lvm` and `windows`-related repositories have special requirements.
|
||||||
|
|
@ -132,7 +132,7 @@ Whereas integration tests are mostly stored in the [qubes-core-admin](https://gi
|
|||||||
To for example run the `qubes-core-admin` unit tests, you currently have to clone at least [qubes-core-admin](https://github.com/QubesOS/qubes-core-admin) and
|
To for example run the `qubes-core-admin` unit tests, you currently have to clone at least [qubes-core-admin](https://github.com/QubesOS/qubes-core-admin) and
|
||||||
its dependency [qubes-core-qrexec](https://github.com/QubesOS/qubes-core-qrexec) repository in the branches that you want to test.
|
its dependency [qubes-core-qrexec](https://github.com/QubesOS/qubes-core-qrexec) repository in the branches that you want to test.
|
||||||
|
|
||||||
The below example however will assume that you set up a build environment as described in the [Qubes Builder documentation](/doc/qubes-builder/).
|
The below example however will assume that you set up a build environment as described in the [Qubes Builder documentation](/doc/qubes-builder-v2/).
|
||||||
|
|
||||||
Assuming you cloned the `qubes-builder` repository to your home directory inside a fedora VM, you can use the following commands to run the unit tests:
|
Assuming you cloned the `qubes-builder` repository to your home directory inside a fedora VM, you can use the following commands to run the unit tests:
|
||||||
|
|
||||||
|
@ -205,9 +205,10 @@ pushd ${HOME}/builder >/dev/null
|
|||||||
|
|
||||||
# the following are needed only if you have sources outside builder
|
# the following are needed only if you have sources outside builder
|
||||||
#rm -rf qubes-src/core-admin
|
#rm -rf qubes-src/core-admin
|
||||||
#make COMPONENTS=core-admin get-sources
|
#qb -c core-admin package fetch
|
||||||
|
|
||||||
make core-admin
|
qb -c core-admin -d host-fc41 prep build
|
||||||
|
# update your dom0 fedora distribution as appropriate
|
||||||
qtb-install qubes-src/core-admin/rpm/x86_64/qubes-core-dom0-*.rpm
|
qtb-install qubes-src/core-admin/rpm/x86_64/qubes-core-dom0-*.rpm
|
||||||
qtb-runtests
|
qtb-runtests
|
||||||
```
|
```
|
||||||
|
@ -31,7 +31,7 @@ You should start learning the components that you plan on working on before the
|
|||||||
|
|
||||||
Coming up with an interesting idea that you can realistically achieve in the time available to you (one summer) is probably the most difficult part. We strongly recommend getting involved in advance of the beginning of GSoC, and we will look favorably on applications from prospective contributors who have already started to act like free and open source developers.
|
Coming up with an interesting idea that you can realistically achieve in the time available to you (one summer) is probably the most difficult part. We strongly recommend getting involved in advance of the beginning of GSoC, and we will look favorably on applications from prospective contributors who have already started to act like free and open source developers.
|
||||||
|
|
||||||
Before the summer starts, there are some preparatory tasks which are highly encouraged. First, if you aren't already, definitely start using Qubes as your primary OS as soon as possible! Also, it is encouraged that you become familiar and comfortable with the Qubes development workflow sooner than later. A good way to do this (and also a great way to stand out as an awesome applicant and make us want to accept you!) might be to pick up some issues from [qubes-issues](https://github.com/QubesOS/qubes-issues/issues) (our issue-tracking repo) and submit some patches addressing them. Some suitable issues might be those with tags ["help wanted" and "P: minor"](https://github.com/QubesOS/qubes-issues/issues?q=is%3Aissue%20is%3Aopen%20label%3A%22P%3A%20minor%22%20label%3A%22help%20wanted%22) (although more significant things are also welcome, of course). Doing this will get you some practice with [qubes-builder](/doc/qubes-builder/), our code-signing policies, and some familiarity with our code base in general so you are ready to hit the ground running come summer.
|
Before the summer starts, there are some preparatory tasks which are highly encouraged. First, if you aren't already, definitely start using Qubes as your primary OS as soon as possible! Also, it is encouraged that you become familiar and comfortable with the Qubes development workflow sooner than later. A good way to do this (and also a great way to stand out as an awesome applicant and make us want to accept you!) might be to pick up some issues from [qubes-issues](https://github.com/QubesOS/qubes-issues/issues) (our issue-tracking repo) and submit some patches addressing them. Some suitable issues might be those with tags ["help wanted" and "P: minor"](https://github.com/QubesOS/qubes-issues/issues?q=is%3Aissue%20is%3Aopen%20label%3A%22P%3A%20minor%22%20label%3A%22help%20wanted%22) (although more significant things are also welcome, of course). Doing this will get you some practice with [qubes-builder](/doc/qubes-builder-v2/), our code-signing policies, and some familiarity with our code base in general so you are ready to hit the ground running come summer.
|
||||||
|
|
||||||
### Contributor proposal guidelines
|
### Contributor proposal guidelines
|
||||||
|
|
||||||
@ -422,7 +422,7 @@ for more information and qubes-specific background.
|
|||||||
|
|
||||||
**Difficulty**: medium
|
**Difficulty**: medium
|
||||||
|
|
||||||
**Knowledge prerequisite**: qubes-builder [[1]](/doc/qubes-builder/) [[2]](/doc/qubes-builder-details/) [[3]](https://github.com/QubesOS/qubes-builder/tree/master/doc), and efficient at introspecting complex systems: comfortable with tracing and debugging tools, ability to quickly identify and locate issues within a large codebase (upstream build tools), etc.
|
**Knowledge prerequisite**: qubes-builder [[1]](/doc/qubes-builder-v2/) [[2]](https://github.com/QubesOS/qubes-builderv2), and efficient at introspecting complex systems: comfortable with tracing and debugging tools, ability to quickly identify and locate issues within a large codebase (upstream build tools), etc.
|
||||||
|
|
||||||
**Size of the project**: 350 hours
|
**Size of the project**: 350 hours
|
||||||
|
|
||||||
|
@ -678,7 +678,7 @@ Any rpm-based, 64-bit environment, the preferred OS being Fedora.
|
|||||||
|
|
||||||
### How do I build Qubes from sources?
|
### How do I build Qubes from sources?
|
||||||
|
|
||||||
See [these instructions](/doc/qubes-builder/).
|
See [these instructions](/doc/qubes-builder-v2/).
|
||||||
|
|
||||||
### How do I submit a patch?
|
### How do I submit a patch?
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ Watch all the talks from Qubes OS Summit 2022, which took place September 9-11,
|
|||||||
|
|
||||||
## Micah Lee presents "Qubes OS: The Operating System That Can Protect You Even If You Get Hacked"
|
## Micah Lee presents "Qubes OS: The Operating System That Can Protect You Even If You Get Hacked"
|
||||||
|
|
||||||
[Micah Lee](https://micahflee.com/), a long-time Qubes [advocate](/endorsements/), presented [Qubes OS: The Operating System That Can Protect You Even If You Get Hacked](https://www.hope.net/schedule.html#-qubes-os-the-operating-system-that-can-protect-you-even-if-you-get-hacked-) at the [Circle of HOPE](https://www.hope.net/index.html) conference, which took place July 20-22, 2018 in New York City.
|
[Micah Lee](https://micahflee.com/), a long-time Qubes [advocate](/endorsements/), presented [Qubes OS: The Operating System That Can Protect You Even If You Get Hacked](https://archive.org/details/QubesOSTheOperatingSystemThatCanProtectYouEvenIfYouGetHackedTalkByMicahLee) at the Circle of HOPE conference, which took place July 20-22, 2018 in New York City.
|
||||||
|
|
||||||
<div class="video more-bottom">
|
<div class="video more-bottom">
|
||||||
<iframe class="responsive" referrerpolicy="no-referrer" scrolling="no" allowfullscreen src="https://livestream.com/accounts/9197973/events/8286152/videos/178431606/player?autoPlay=false"></iframe>
|
<iframe class="responsive" referrerpolicy="no-referrer" scrolling="no" allowfullscreen src="https://livestream.com/accounts/9197973/events/8286152/videos/178431606/player?autoPlay=false"></iframe>
|
||||||
|
@ -18,7 +18,7 @@ That way, they can be used to customize a single VM instead of all VMs based on
|
|||||||
The scripts here all run as root.
|
The scripts here all run as root.
|
||||||
|
|
||||||
- `/rw/config/rc.local` - script runs at VM startup.
|
- `/rw/config/rc.local` - script runs at VM startup.
|
||||||
Good place to change some service settings, replace config files with its copy stored in `/rw/config`, etc.
|
Good place to change some service settings, replace config files with its copy stored in `/rw/config`, etc. The script need to have the executable permission set to be executed.
|
||||||
Example usage:
|
Example usage:
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
@ -32,6 +32,8 @@ The scripts here all run as root.
|
|||||||
echo '127.0.0.1 example.com' >> /etc/hosts
|
echo '127.0.0.1 example.com' >> /etc/hosts
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
- `/rw/config/rc.local.d/*.rc` - scripts run at VM startup just before `/rw/config/rc.local`
|
||||||
|
- `/rw/config/rc.local-early.d/*.rc`, `/rw/config/rc.local-early` - scripts similar to `/rw/config/rc.local`, but running earlier in the system startup sequence - just before `sysinit.target`, and setting up the network.
|
||||||
- `/rw/config/qubes-ip-change-hook` - script runs in NetVM after every external IP change and on "hardware" link status change.
|
- `/rw/config/qubes-ip-change-hook` - script runs in NetVM after every external IP change and on "hardware" link status change.
|
||||||
|
|
||||||
- In ProxyVMs (or app qubes with `qubes-firewall` service enabled), scripts placed in the following directories will be executed in the listed order followed by `qubes-firewall-user-script` at start up.
|
- In ProxyVMs (or app qubes with `qubes-firewall` service enabled), scripts placed in the following directories will be executed in the listed order followed by `qubes-firewall-user-script` at start up.
|
||||||
|
@ -17,7 +17,7 @@ How to test upcoming Qubes OS releases:
|
|||||||
|
|
||||||
- Test the latest release candidate (RC) on the [downloads](/downloads/) page, if one is currently available. (Or try an older RC from our [FTP server](https://ftp.qubes-os.org/iso/).)
|
- Test the latest release candidate (RC) on the [downloads](/downloads/) page, if one is currently available. (Or try an older RC from our [FTP server](https://ftp.qubes-os.org/iso/).)
|
||||||
- Try the [signed weekly builds](https://qubes.notset.fr/iso/). ([Learn more](https://forum.qubes-os.org/t/16929) and [track their status](https://github.com/fepitre/updates-status-iso/issues).)
|
- Try the [signed weekly builds](https://qubes.notset.fr/iso/). ([Learn more](https://forum.qubes-os.org/t/16929) and [track their status](https://github.com/fepitre/updates-status-iso/issues).)
|
||||||
- Use [qubes-builder](/doc/qubes-builder/) to build the latest release yourself.
|
- Use [qubes-builder](/doc/qubes-builder-v2/) to build the latest release yourself.
|
||||||
- (No support) Experiment with developer alpha ISOs found from time to time at [Qubes OpenQA](https://openqa.qubes-os.org/).
|
- (No support) Experiment with developer alpha ISOs found from time to time at [Qubes OpenQA](https://openqa.qubes-os.org/).
|
||||||
|
|
||||||
Please make sure to [report any bugs you encounter](/doc/issue-tracking/).
|
Please make sure to [report any bugs you encounter](/doc/issue-tracking/).
|
||||||
|
@ -8,7 +8,7 @@ image: /attachment/posts/dasharo-fidelisguard-z690_2.jpg
|
|||||||
|
|
||||||
The [Dasharo FidelisGuard Z690](https://web.archive.org/web/20240917145232/https://shop.3mdeb.com/shop/open-source-hardware/dasharo-fidelisguard-z690-qubes-os-certified/) is [officially certified](/doc/certified-hardware/) for Qubes OS Release 4.
|
The [Dasharo FidelisGuard Z690](https://web.archive.org/web/20240917145232/https://shop.3mdeb.com/shop/open-source-hardware/dasharo-fidelisguard-z690-qubes-os-certified/) is [officially certified](/doc/certified-hardware/) for Qubes OS Release 4.
|
||||||
|
|
||||||
[](https://3mdeb.com/shop/open-source-hardware/dasharo-fidelisguard-z690-qubes-os-certified/)
|
[](https://web.archive.org/web/20240917145232/https://shop.3mdeb.com/shop/open-source-hardware/dasharo-fidelisguard-z690-qubes-os-certified/)
|
||||||
|
|
||||||
The [Dasharo FidelisGuard Z690](https://web.archive.org/web/20240917145232/https://shop.3mdeb.com/shop/open-source-hardware/dasharo-fidelisguard-z690-qubes-os-certified/) is a full desktop PC build that brings the [Dasharo](https://dasharo.com/) open-source firmware distribution to the MSI PRO Z690-A DDR4 motherboard with Qubes OS preinstalled. The full configuration includes:
|
The [Dasharo FidelisGuard Z690](https://web.archive.org/web/20240917145232/https://shop.3mdeb.com/shop/open-source-hardware/dasharo-fidelisguard-z690-qubes-os-certified/) is a full desktop PC build that brings the [Dasharo](https://dasharo.com/) open-source firmware distribution to the MSI PRO Z690-A DDR4 motherboard with Qubes OS preinstalled. The full configuration includes:
|
||||||
|
|
||||||
|
@ -12,13 +12,17 @@ title: Emergency backup recovery (v4)
|
|||||||
This page describes how to perform an emergency restore of a backup created on
|
This page describes how to perform an emergency restore of a backup created on
|
||||||
Qubes R4.X (which uses backup format version 4).
|
Qubes R4.X (which uses backup format version 4).
|
||||||
|
|
||||||
The Qubes backup system has been designed with emergency disaster recovery in
|
The Qubes backup system is designed with emergency disaster recovery in mind. No
|
||||||
mind. No special Qubes-specific tools are required to access data backed up by
|
special Qubes-specific tools are required to access data backed up by Qubes. In
|
||||||
Qubes. In the event a Qubes system is unavailable, you can access your data on
|
the event a Qubes system is unavailable, you can access your data on any
|
||||||
any GNU/Linux system with the following procedure.
|
GNU/Linux system by following the instructions on this page.
|
||||||
|
|
||||||
Required `scrypt` Utility
|
**Important:** You may wish to store a copy of these instructions with your
|
||||||
-------------------------
|
Qubes backups. All Qubes documentation, including this page, is available in
|
||||||
|
plain text format in the [qubes-doc](https://github.com/QubesOS/qubes-doc) Git
|
||||||
|
repository.
|
||||||
|
|
||||||
|
## Required `scrypt` utility
|
||||||
|
|
||||||
In Qubes 4.X, backups are encrypted and integrity-protected with
|
In Qubes 4.X, backups are encrypted and integrity-protected with
|
||||||
[scrypt](https://www.tarsnap.com/scrypt.html). You will need a copy of this
|
[scrypt](https://www.tarsnap.com/scrypt.html). You will need a copy of this
|
||||||
@ -34,8 +38,8 @@ easier scripting, which means you'll need to enter the passphrase for each file
|
|||||||
separately, instead of using `echo ... | scrypt`.
|
separately, instead of using `echo ... | scrypt`.
|
||||||
|
|
||||||
Here are instructions for obtaining a compiled `scrypt` binary. This example
|
Here are instructions for obtaining a compiled `scrypt` binary. This example
|
||||||
uses an RPM-based system (Fedora), but the same general procedure should work
|
uses an RPM-based system (Fedora), but the same general procedure should work on
|
||||||
on any GNU/Linux system.
|
any GNU/Linux system.
|
||||||
|
|
||||||
1. If you're not on Qubes 4.X, [import and authenticate the Release 4 Signing
|
1. If you're not on Qubes 4.X, [import and authenticate the Release 4 Signing
|
||||||
Key](/security/verifying-signatures/#how-to-import-and-authenticate-release-signing-keys).
|
Key](/security/verifying-signatures/#how-to-import-and-authenticate-release-signing-keys).
|
||||||
@ -46,7 +50,7 @@ on any GNU/Linux system.
|
|||||||
|
|
||||||
[user@restore ~]$ dnf download scrypt
|
[user@restore ~]$ dnf download scrypt
|
||||||
|
|
||||||
or, if that doesn't work:
|
Or, if that doesn't work:
|
||||||
|
|
||||||
[user@restore ~]$ curl -O https://yum.qubes-os.org/r4.0/current/vm/fc28/rpm/scrypt-1.2.1-1.fc28.x86_64.rpm
|
[user@restore ~]$ curl -O https://yum.qubes-os.org/r4.0/current/vm/fc28/rpm/scrypt-1.2.1-1.fc28.x86_64.rpm
|
||||||
|
|
||||||
@ -62,60 +66,35 @@ on any GNU/Linux system.
|
|||||||
|
|
||||||
[user@restore ~]$ sudo dnf install rpmdevtools
|
[user@restore ~]$ sudo dnf install rpmdevtools
|
||||||
|
|
||||||
5. Extract the `scrypt` binary from the RPM.
|
5. Extract the `scrypt` binary from the RPM and make it conveniently
|
||||||
|
available.
|
||||||
|
|
||||||
[user@restore ~]$ rpmdev-extract scrypt-*.rpm
|
[user@restore ~]$ rpmdev-extract scrypt-*.rpm
|
||||||
|
[user@restore ~]$ alias scrypt="$PWD/scrypt-*/usr/bin/scrypt"
|
||||||
|
|
||||||
6. (Optional) Create an alias for the new binary.
|
## Emergency recovery instructions
|
||||||
|
|
||||||
[user@restore ~]$ alias scrypt="scrypt-*/usr/bin/scrypt"
|
|
||||||
|
|
||||||
Emergency Recovery Instructions
|
|
||||||
-------------------------------
|
|
||||||
|
|
||||||
**Note:** In the following example, the backup file is both *encrypted* and
|
**Note:** In the following example, the backup file is both *encrypted* and
|
||||||
*compressed*.
|
*compressed*.
|
||||||
|
|
||||||
1. Untar the main backup file.
|
1. Untar the backup metadata from the main backup file.
|
||||||
|
|
||||||
[user@restore ~]$ tar -i -xvf qubes-backup-2015-06-05T123456
|
[user@restore ~]$ tar -i -xvf qubes-backup-2023-04-05T123456 \
|
||||||
|
backup-header backup-header.hmac qubes.xml.000.enc
|
||||||
backup-header
|
backup-header
|
||||||
backup-header.hmac
|
backup-header.hmac
|
||||||
qubes.xml.000.enc
|
qubes.xml.000.enc
|
||||||
vm1/private.img.000.enc
|
|
||||||
vm1/private.img.001.enc
|
|
||||||
vm1/private.img.002.enc
|
|
||||||
vm1/icon.png.000.enc
|
|
||||||
vm1/firewall.xml.000.enc
|
|
||||||
vm1/whitelisted-appmenus.list.000.enc
|
|
||||||
dom0-home/dom0user.000.enc
|
|
||||||
|
|
||||||
**To extract only specific VMs:** Each VM in the backup file has its path
|
|
||||||
listed in `qubes.xml.000.enc`. Decrypt it. (In this example, the password is
|
|
||||||
`password`.)
|
|
||||||
|
|
||||||
[user@restore ~]$ cat backup-header | grep backup-id
|
|
||||||
backup-id=20190128T123456-1234
|
|
||||||
[user@restore ~]$ scrypt dec -P qubes.xml.000.enc qubes.xml.000
|
|
||||||
Please enter passphrase: 20190128T123456-1234!qubes.xml.000!password
|
|
||||||
[user@restore ~]$ tar -i -xvf qubes.xml.000
|
|
||||||
|
|
||||||
Now that you have the decrypted `qubes.xml.000` file, search for the
|
|
||||||
`backup-path` property inside of it. With the `backup-path`, extract only
|
|
||||||
the files necessary for your VM (`vmX`).
|
|
||||||
|
|
||||||
[user@restore ~]$ tar -i -xvf qubes-backup-2015-06-05T123456 \
|
|
||||||
backup-header backup-header.hmac vmX/
|
|
||||||
|
|
||||||
2. Set the backup passphrase environment variable. While this isn't strictly
|
2. Set the backup passphrase environment variable. While this isn't strictly
|
||||||
required, it will be handy later and will avoid saving the passphrase in
|
required, it will be handy later and will avoid saving the passphrase in the
|
||||||
the shell's history.
|
shell's history.
|
||||||
|
|
||||||
[user@restore ~]$ read -r backup_pass
|
[user@restore ~]$ read -r backup_pass
|
||||||
|
|
||||||
3. Verify the integrity of `backup-header`. For compatibility reasons,
|
Type in your passphrase (it will be visible on screen!) and press Enter.
|
||||||
`backup-header.hmac` is an encrypted *and integrity protected*
|
|
||||||
version of `backup-header`.
|
3. Verify the integrity of `backup-header` using `backup-header.hmac` (an
|
||||||
|
encrypted *and integrity protected* version of `backup-header`).
|
||||||
|
|
||||||
[user@restore ~]$ set +H
|
[user@restore ~]$ set +H
|
||||||
[user@restore ~]$ echo "backup-header!$backup_pass" |\
|
[user@restore ~]$ echo "backup-header!$backup_pass" |\
|
||||||
@ -123,34 +102,34 @@ Emergency Recovery Instructions
|
|||||||
diff -qs backup-header backup-header.verified
|
diff -qs backup-header backup-header.verified
|
||||||
Files backup-header and backup-header.verified are identical
|
Files backup-header and backup-header.verified are identical
|
||||||
|
|
||||||
**Note:** If this command fails, it may be that the backup was tampered
|
**Note:** If this command fails, it may be that the backup was tampered with
|
||||||
with or is in a different format. In the latter case, look inside
|
or is in a different format. In the latter case, look inside `backup-header`
|
||||||
`backup-header` at the `version` field. If it contains a value other than
|
at the `version` field. If it contains a value other than `version=4`, go to
|
||||||
`version=4`, go to the instructions for that format version:
|
the instructions for that format version:
|
||||||
- [Emergency Backup Recovery without Qubes (v2)](/doc/backup-emergency-restore-v2/)
|
- [Emergency Backup Recovery without Qubes (v2)](/doc/backup-emergency-restore-v2/)
|
||||||
- [Emergency Backup Recovery without Qubes (v3)](/doc/backup-emergency-restore-v3/)
|
- [Emergency Backup Recovery without Qubes (v3)](/doc/backup-emergency-restore-v3/)
|
||||||
|
|
||||||
4. Read `backup-header`:
|
4. Read `backup-header`.
|
||||||
|
|
||||||
[user@restore ~]$ cat backup-header
|
[user@restore ~]$ cat backup-header
|
||||||
version=4
|
version=4
|
||||||
encrypted=True
|
encrypted=True
|
||||||
compressed=True
|
compressed=True
|
||||||
compression-filter=gzip
|
compression-filter=gzip
|
||||||
backup_id=20161020T123455-1234
|
hmac-algorithm=scrypt
|
||||||
|
backup-id=20230405T123455-1234
|
||||||
|
|
||||||
5. Set `backup_id` to the value in the last line of `backup-header`:
|
5. Set `backup_id` to the value in the last line of `backup-header`. (Note that
|
||||||
|
there is a hyphen in `backup-id` in the file, whereas there is an underscore
|
||||||
|
in `backup_id` in the variable you're setting.)
|
||||||
|
|
||||||
[user@restore ~]$ backup_id=20161020T123455-1234
|
[user@restore ~]$ backup_id=20230405T123455-1234
|
||||||
|
|
||||||
6. Verify the integrity of your data, decrypt, decompress, and extract
|
6. Verify and decrypt, decompress, and extract the `qubes.xml` file.
|
||||||
`private.img`:
|
|
||||||
|
|
||||||
[user@restore ~]$ find vm1 -name 'private.img.*.enc' | sort -V | while read f_enc; do \
|
[user@restore ~]$ echo "$backup_id!qubes.xml.000!$backup_pass" |\
|
||||||
f_dec=${f_enc%.enc}; \
|
scrypt dec -P qubes.xml.000.enc | gzip -d | tar -xv
|
||||||
echo "$backup_id!$f_dec!$backup_pass" | scrypt dec -P $f_enc || break; \
|
qubes.xml
|
||||||
done | gzip -d | tar -xv
|
|
||||||
vm1/private.img
|
|
||||||
|
|
||||||
If this pipeline fails, it is likely that the backup is corrupted or has
|
If this pipeline fails, it is likely that the backup is corrupted or has
|
||||||
been tampered with.
|
been tampered with.
|
||||||
@ -158,23 +137,66 @@ Emergency Recovery Instructions
|
|||||||
**Note:** If your backup was compressed with a program other than `gzip`,
|
**Note:** If your backup was compressed with a program other than `gzip`,
|
||||||
you must substitute the correct compression program in the command above.
|
you must substitute the correct compression program in the command above.
|
||||||
This information is contained in `backup-header` (see step 4). For example,
|
This information is contained in `backup-header` (see step 4). For example,
|
||||||
if your backup is compressed with `bzip2`, use `bzip2 -d` instead in the
|
if your backup is compressed with `bzip2`, use `bzip2 -d` instead of `gzip
|
||||||
command above.
|
-d` in the command above. You might need to install a package of the same
|
||||||
|
name (in this example, `bzip2`) through your distribution's package manager.
|
||||||
|
|
||||||
7. Mount `private.img` and access your data.
|
7. Search inside of the `qubes.xml` file for the `backup-path` of the qube
|
||||||
|
whose data you wish to restore. If you install the `xmlstarlet` package, the
|
||||||
|
following command will convert `qubes.xml` to a friendlier listing for this
|
||||||
|
purpose:
|
||||||
|
|
||||||
[user@restore vm1]$ sudo mkdir /mnt/img
|
[user@restore ~]$ xmlstarlet sel -T -t -m //domain \
|
||||||
[user@restore vm1]$ sudo mount -o loop vm1/private.img /mnt/img/
|
-v 'concat(.//property[@name="name"], " ", .//feature[@name="backup-path"])' \
|
||||||
[user@restore vm1]$ cat /mnt/img/home/user/your_data.txt
|
-n qubes.xml
|
||||||
This data has been successfully recovered!
|
|
||||||
|
anon-whonix
|
||||||
|
debian-11
|
||||||
|
default-mgmt-dvm
|
||||||
|
disp2345
|
||||||
|
fedora-37
|
||||||
|
fedora-37-dvm
|
||||||
|
personal vm123/
|
||||||
|
sys-firewall
|
||||||
|
sys-net
|
||||||
|
sys-usb
|
||||||
|
sys-whonix
|
||||||
|
untrusted
|
||||||
|
vault vm321/
|
||||||
|
whonix-gw-16
|
||||||
|
whonix-ws-16
|
||||||
|
whonix-ws-16-dvm
|
||||||
|
work
|
||||||
|
|
||||||
8. Success! If you wish to recover data from more than one VM in your backup,
|
The example output above shows that the backup file includes a qube named
|
||||||
simply repeat steps 6 and 7 for each additional VM.
|
`personal` and a qube named `vault`, with `backup-path` values of `vm123/`
|
||||||
|
and `vm321/` respectively. (Every other listed qube was not selected to be
|
||||||
|
included in the backup file.) Use the corresponding value to untar the
|
||||||
|
necessary data files of the qube:
|
||||||
|
|
||||||
**Note:** You may wish to store a copy of these instructions with your
|
[user@restore ~]$ tar -i -xvf qubes-backup-2023-04-05T123456 vm123/
|
||||||
Qubes backups in the event that you fail to recall the above procedure
|
|
||||||
while this web page is inaccessible. All Qubes documentation, including
|
|
||||||
this page, is available in plain text format in the following Git
|
|
||||||
repository:
|
|
||||||
|
|
||||||
https://github.com/QubesOS/qubes-doc.git
|
8. Verify and decrypt the backed up data, decompress it, and extract it.
|
||||||
|
|
||||||
|
[user@restore ~]$ find vm123/ -name 'private.img.*.enc' | sort -V | while read f_enc; do \
|
||||||
|
f_dec=${f_enc%.enc}; \
|
||||||
|
echo "$backup_id!$f_dec!$backup_pass" | scrypt dec -P $f_enc || break; \
|
||||||
|
done | gzip -d | tar -xv
|
||||||
|
vm123/private.img
|
||||||
|
|
||||||
|
If this pipeline fails, it is likely that the backup is corrupted or has
|
||||||
|
been tampered with.
|
||||||
|
|
||||||
|
Also see the note in step 6 about substituting a different compression
|
||||||
|
program for `gzip`.
|
||||||
|
|
||||||
|
9. Mount `private.img` and access your data.
|
||||||
|
|
||||||
|
[user@restore ~]$ sudo mkdir /mnt/img
|
||||||
|
[user@restore ~]$ sudo mount -o loop vm123/private.img /mnt/img/
|
||||||
|
[user@restore ~]$ ls /mnt/img/home/user/
|
||||||
|
example_data_file.txt
|
||||||
|
...
|
||||||
|
|
||||||
|
Success! If you wish to recover data from more than one qube in your backup,
|
||||||
|
simply repeat steps 7, 8, and 9 for each additional qube.
|
||||||
|
@ -269,7 +269,8 @@ As an example we can take the use case of qube QubeDest running a web server lis
|
|||||||
|
|
||||||
**1. Identify the IP addresses you will need to use for sys-net, sys-firewall and the destination qube.**
|
**1. Identify the IP addresses you will need to use for sys-net, sys-firewall and the destination qube.**
|
||||||
|
|
||||||
You can get this information using various methods, but only the first one can be used for `sys-net` outside world IP:
|
You can get this information using various methods.
|
||||||
|
Only the first method can be used for `sys-net` to find the external IP:
|
||||||
|
|
||||||
- by running this command in each qube: `ip -4 -br a | grep UP`
|
- by running this command in each qube: `ip -4 -br a | grep UP`
|
||||||
- using `qvm-ls -n`
|
- using `qvm-ls -n`
|
||||||
@ -284,7 +285,12 @@ Note the IP addresses you will need, they will be required in the next steps.
|
|||||||
|
|
||||||
For the following example, we assume that the physical interface ens6 in sys-net is on the local network 192.168.x.y with the IP 192.168.x.n, and that the IP address of sys-firewall is 10.137.1.z.
|
For the following example, we assume that the physical interface ens6 in sys-net is on the local network 192.168.x.y with the IP 192.168.x.n, and that the IP address of sys-firewall is 10.137.1.z.
|
||||||
|
|
||||||
In the sys-net VM's Terminal, the first step is to define an ntables chain that will receive DNAT rules to relay the network traffic on a given port to the qube NetVM, we recommend to define a new chain for each destination qube to ease rules management:
|
When writing rules in sys-net, you can use `iif` or `iifname`.
|
||||||
|
`iif` is faster, but can change where interfaces are dynamically created and destroyed, eg. ppp0.
|
||||||
|
In that case use `iifname`, like this `iifname ens6`.
|
||||||
|
`iifname` can also match wildcards - `iifname "eth*"`
|
||||||
|
|
||||||
|
In the sys-net VM's Terminal, the first step is to define an nftables chain that will receive DNAT rules to relay the network traffic on a given port to the qube NetVM, we recommend to define a new chain for each destination qube to ease rules management:
|
||||||
|
|
||||||
```
|
```
|
||||||
nft add chain qubes custom-dnat-qubeDEST '{ type nat hook prerouting priority filter +1 ; policy accept; }'
|
nft add chain qubes custom-dnat-qubeDEST '{ type nat hook prerouting priority filter +1 ; policy accept; }'
|
||||||
@ -292,25 +298,24 @@ nft add chain qubes custom-dnat-qubeDEST '{ type nat hook prerouting priority fi
|
|||||||
|
|
||||||
> Note: the name `custom-dnat-qubeDST` is arbitrary
|
> Note: the name `custom-dnat-qubeDST` is arbitrary
|
||||||
|
|
||||||
> Note: while we use a DNAT chain for a single qube, it's totally possible to have a single DNAT chain for multiple qubes
|
> Note: while we use a DNAT chain for a single qube, it's possible to have a single DNAT chain for multiple qubes
|
||||||
|
|
||||||
Second step, code a natting firewall rule to route traffic on the outside interface for the service to the sys-firewall VM
|
Second step, code a natting firewall rule to route traffic on the outside interface for the service to the sys-firewall VM
|
||||||
|
|
||||||
```
|
```
|
||||||
nft add rule qubes custom-dnat-qubeDEST iif == "ens6" ip saddr 192.168.x.y/24 tcp dport 443 ct state new,established,related counter dnat 10.137.1.z
|
nft add rule qubes custom-dnat-qubeDEST iifname ens6 ip saddr 192.168.x.y/24 tcp dport 443 ct state new,established,related counter dnat 10.137.1.z
|
||||||
```
|
```
|
||||||
|
|
||||||
Third step, code the appropriate new filtering firewall rule to allow new connections for the service
|
Third step, code the appropriate new filtering firewall rule to allow new connections for the service
|
||||||
|
|
||||||
```
|
```
|
||||||
nft add rule qubes custom-forward iif == "ens6" ip saddr 192.168.x.y/24 ip daddr 10.137.1.z tcp dport 443 ct state new,established,related counter accept
|
nft add rule qubes custom-forward iifname ens6 ip saddr 192.168.x.y/24 ip daddr 10.137.1.z tcp dport 443 ct state new,established,related counter accept
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note: If you do not wish to limit the IP addresses connecting to the service, remove `ip saddr 192.168.x.y/24` from the rules
|
> Note: If you do not wish to limit the IP addresses connecting to the service, remove `ip saddr 192.168.x.y/24` from the rules
|
||||||
|
> If you want to expose the service on multiple interfaces, repeat steps 2 and 3 above, for each interface. Alternatively, you can leave out the interface completely.
|
||||||
|
|
||||||
> If you want to expose the service on multiple interfaces, repeat the steps 2 and 3 described above, for each interface. Alternatively, you can leave out the interface completely.
|
Verify the rules on the sys-net firewall correctly match the packets you want by looking at the counters: check for the counter lines in the chains `custom-forward` and `custom-dnat-qubeDEST`:
|
||||||
|
|
||||||
Verify the rules on sys-net firewall correctly match the packets you want by looking at its counters, check for the counter lines in the chains `custom-forward` and `custom-dnat-qubeDEST`:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
nft list table ip qubes
|
nft list table ip qubes
|
||||||
@ -320,12 +325,12 @@ In this example, we can see 7 packets in the forward rule, and 3 packets in the
|
|||||||
|
|
||||||
```
|
```
|
||||||
chain custom-forward {
|
chain custom-forward {
|
||||||
iif "ens6" ip saddr 192.168.x.y/24 ip daddr 10.137.1.z tcp dport 443 ct state new,established,related counter packets 7 bytes 448 accept
|
iifname ens6 ip saddr 192.168.x.y/24 ip daddr 10.137.1.z tcp dport 443 ct state new,established,related counter packets 7 bytes 448 accept
|
||||||
}
|
}
|
||||||
|
|
||||||
chain custom-dnat-qubeDEST {
|
chain custom-dnat-qubeDEST {
|
||||||
type nat hook prerouting priority filter + 1; policy accept;
|
type nat hook prerouting priority filter + 1; policy accept;
|
||||||
iif "ens6" ip saddr 192.168.x.y/24 tcp dport 443 ct state new,established,related counter packets 3 bytes 192 dnat to 10.138.33.59
|
iifname ens6 ip saddr 192.168.x.y/24 tcp dport 443 ct state new,established,related counter packets 3 bytes 192 dnat to 10.138.33.59
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -351,18 +356,20 @@ Content of `/rw/config/qubes-firewall-user-script` in `sys-net`:
|
|||||||
if nft add chain qubes custom-dnat-qubeDEST '{ type nat hook prerouting priority filter +1 ; policy accept; }'
|
if nft add chain qubes custom-dnat-qubeDEST '{ type nat hook prerouting priority filter +1 ; policy accept; }'
|
||||||
then
|
then
|
||||||
# create the dnat rule
|
# create the dnat rule
|
||||||
nft add rule qubes custom-dnat-qubeDEST iif == "ens6" saddr 192.168.x.y/24 tcp dport 443 ct state new,established,related counter dnat 10.137.1.z
|
nft add rule qubes custom-dnat-qubeDEST iifname ens6 saddr 192.168.x.y/24 tcp dport 443 ct state new,established,related counter dnat 10.137.1.z
|
||||||
|
|
||||||
# allow forwarded traffic
|
# allow forwarded traffic
|
||||||
nft add rule qubes custom-forward iif == "ens6" ip saddr 192.168.x.y/24 ip daddr 10.137.1.z tcp dport 443 ct state new,established,related counter accept
|
nft add rule qubes custom-forward iifname ens6 ip saddr 192.168.x.y/24 ip daddr 10.137.1.z tcp dport 443 ct state new,established,related counter accept
|
||||||
fi
|
fi
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
**3. Route packets from the FirewallVM to the VM**
|
**3. Route packets from the FirewallVM to the VM**
|
||||||
|
|
||||||
For the following example, we use the fact that the physical interface of sys-firewall, facing sys-net, is eth0. Furthermore, we assume that the target VM running the web server has the IP address 10.137.0.xx and that the IP address of sys-firewall is 10.137.1.z.
|
For the following example, we use the fact that the interface of sys-firewall facing sys-net, is eth0.
|
||||||
|
This is allocated to iifgroup 1.
|
||||||
|
Furthermore, we assume that the IP address of sys-firewall is 10.137.1.z, and the target VM running the web server has the IP address 10.137.0.xx.
|
||||||
|
|
||||||
In the sys-firewall VM's Terminal, add a DNAT chain that will contain routing rules:
|
In the sys-firewall Terminal, add a DNAT chain that will contain routing rules:
|
||||||
|
|
||||||
```
|
```
|
||||||
nft add chain qubes custom-dnat-qubeDEST '{ type nat hook prerouting priority filter +1 ; policy accept; }'
|
nft add chain qubes custom-dnat-qubeDEST '{ type nat hook prerouting priority filter +1 ; policy accept; }'
|
||||||
@ -371,13 +378,13 @@ nft add chain qubes custom-dnat-qubeDEST '{ type nat hook prerouting priority fi
|
|||||||
Second step, code a natting firewall rule to route traffic on the outside interface for the service to the destination qube
|
Second step, code a natting firewall rule to route traffic on the outside interface for the service to the destination qube
|
||||||
|
|
||||||
```
|
```
|
||||||
nft add rule qubes custom-dnat-qubeDEST iif == "eth0" ip saddr 192.168.x.y/24 tcp dport 443 ct state new,established,related counter dnat 10.137.0.xx
|
nft add rule qubes custom-dnat-qubeDEST iifgroup 1 ip saddr 192.168.x.y/24 tcp dport 443 ct state new,established,related counter dnat 10.137.0.xx
|
||||||
```
|
```
|
||||||
|
|
||||||
Third step, code the appropriate new filtering firewall rule to allow new connections for the service
|
Third step, code the appropriate new filtering firewall rule to allow new connections for the service
|
||||||
|
|
||||||
```
|
```
|
||||||
nft add rule qubes custom-forward iif == "eth0" ip saddr 192.168.x.y/24 ip daddr 10.137.0.xx tcp dport 443 ct state new,established,related counter accept
|
nft add rule qubes custom-forward iifgroup 1 ip saddr 192.168.x.y/24 ip daddr 10.137.0.xx tcp dport 443 ct state new,established,related counter accept
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note: If you do not wish to limit the IP addresses connecting to the service, remove `ip saddr 192.168.x.y/24` from the rules
|
> Note: If you do not wish to limit the IP addresses connecting to the service, remove `ip saddr 192.168.x.y/24` from the rules
|
||||||
@ -398,10 +405,10 @@ Content of `/rw/config/qubes-firewall-user-script` in `sys-firewall`:
|
|||||||
if nft add chain qubes custom-dnat-qubeDEST '{ type nat hook prerouting priority filter +1 ; policy accept; }'
|
if nft add chain qubes custom-dnat-qubeDEST '{ type nat hook prerouting priority filter +1 ; policy accept; }'
|
||||||
then
|
then
|
||||||
# create the dnat rule
|
# create the dnat rule
|
||||||
nft add rule qubes custom-dnat-qubeDEST iif == "eth0" tcp dport 443 ct state new,established,related counter dnat 10.137.0.xx
|
nft add rule qubes custom-dnat-qubeDEST iifgroup 1 tcp dport 443 ct state new,established,related counter dnat 10.137.0.xx
|
||||||
|
|
||||||
# allow forwarded traffic
|
# allow forwarded traffic
|
||||||
nft add rule qubes custom-forward iif == "eth0" ip saddr 192.168.x.y/24 ip daddr 10.137.0.xx tcp dport 443 ct state new,established,related counter accept
|
nft add rule qubes custom-forward iifgroup 1 ip saddr 192.168.x.y/24 ip daddr 10.137.0.xx tcp dport 443 ct state new,established,related counter accept
|
||||||
fi
|
fi
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -158,68 +158,21 @@ Please see [How to Install Software](/doc/how-to-install-software).
|
|||||||
|
|
||||||
## Uninstalling
|
## Uninstalling
|
||||||
|
|
||||||
If you want to remove a template you must make sure that it is not being used.
|
To remove a template, the graphical `Qube Manager` (Qubes Menu > Qubes Tools > Qube Manager) may be used. Right-click the template to be uninstalled and click "Delete qube" to begin removal. If no issues are found, a dialog box will request the template's name be typed as a final confirmation. Upon completion, the template will be deleted.
|
||||||
You should check that the template is not being used by any qubes,
|
|
||||||
and also that it is not set as the default template.
|
|
||||||
|
|
||||||
The procedure for uninstalling a template depends on how it was created.
|
|
||||||
|
|
||||||
If the template was originaly created by cloning another template, then you can
|
|
||||||
delete it the same way as you would any other qube. In the Qube Manager,
|
|
||||||
right-click on the template and select **Delete qube**. (If you're not sure,
|
|
||||||
you can safely try this method first to see if it works.)
|
|
||||||
|
|
||||||
If, on the other hand, the template came pre-installed or was installed by
|
|
||||||
installing a template package in dom0, per the instructions
|
|
||||||
[above](#installing), then you must execute the following type of command in
|
|
||||||
dom0 in order to uninstall it:
|
|
||||||
|
|
||||||
|
Alternatively, to remove a template via the command line in dom0:
|
||||||
```
|
```
|
||||||
$ qvm-template remove qubes-template-<DISTRO_NAME>-<RELEASE_NUMBER>
|
$ qvm-template remove <TEMPLATE_NAME>
|
||||||
```
|
```
|
||||||
|
|
||||||
`qubes-template-<DISTRO_NAME>-<RELEASE_NUMBER>` is the name of the desired
|
\<TEMPLATE_NAME> is the first column from the output of:
|
||||||
template package.
|
|
||||||
|
|
||||||
You may see warning messages like the following:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/whitelisted-appmenus.list: remove failed: No such file or directory
|
$ qvm-template list --installed
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/vm-whitelisted-appmenus.list: remove failed: No such file or directory
|
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/root.img.part.04: remove failed: No such file or directory
|
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/root.img.part.03: remove failed: No such file or directory
|
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/root.img.part.02: remove failed: No such file or directory
|
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/root.img.part.01: remove failed: No such file or directory
|
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/root.img.part.00: remove failed: No such file or directory
|
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/netvm-whitelisted-appmenus.list: remove failed: No such file or directory
|
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/icon.png: remove failed: No such file or directory
|
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/clean-volatile.img.tar: remove failed: No such file or directory
|
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/apps.templates: remove failed: No such file or directory
|
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/apps.tempicons: remove failed: No such file or directory
|
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX/apps: remove failed: No such file or directory
|
|
||||||
warning: file /var/lib/qubes/vm-templates/fedora-XX: remove failed: No such file or directory
|
|
||||||
```
|
```
|
||||||
|
|
||||||
These are normal and expected. Nothing is wrong, and no action is required to
|
In either case, issues with template removal may be raised. If an issue is raised, the template will remain installed and a list of concerns displayed. "Global property default_template" requires [switching](#switching) the default_template property to another template. "Template for" can be resolved by [switching](#switching) the dependent qubes' template. Once the issues are addressed, attempt the removal again.
|
||||||
address these warnings.
|
|
||||||
|
|
||||||
If the uninstallation command doesn't work, pay close attention to
|
If the template's entry in the Qubes Menu is not removed with its uninstallation, consult the [troubleshooting page](/doc/app-menu-shortcut-troubleshooting/#fixing-shortcuts).
|
||||||
any error message: it may tell you what qube is using the template,
|
|
||||||
or if the template is default. In other cases, please see [VM Troubleshooting](/doc/vm-troubleshooting/).
|
|
||||||
|
|
||||||
If the Applications Menu entry doesn't go away after you uninstall a template,
|
|
||||||
execute the following type of command in dom0:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ rm ~/.local/share/applications/<TEMPLATE_NAME>
|
|
||||||
```
|
|
||||||
|
|
||||||
Applications Menu entries for backups of removed qubes can also be found in
|
|
||||||
`/usr/local/share/applications/` of dom0.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ rm /usr/local/share/applications/<TEMPLATE_NAME>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Reinstalling
|
## Reinstalling
|
||||||
|
|
||||||
@ -434,8 +387,9 @@ this context: the same as their template filesystem, of course.
|
|||||||
|
|
||||||
* Some templates are available in ready-to-use binary form, but some of them
|
* Some templates are available in ready-to-use binary form, but some of them
|
||||||
are available only as source code, which can be built using the [Qubes
|
are available only as source code, which can be built using the [Qubes
|
||||||
Builder](/doc/qubes-builder/). In particular, some template "flavors" are
|
Builder](https://github.com/QubesOS/qubes-builderv2/). In particular, some
|
||||||
available in source code form only. For the technical details of the template
|
template "flavors" are available in source code form only. For the
|
||||||
|
technical details of the template
|
||||||
system, please see [Template Implementation](/doc/template-implementation/).
|
system, please see [Template Implementation](/doc/template-implementation/).
|
||||||
Take a look at the [Qubes Builder](/doc/qubes-builder/) documentation for
|
Take a look at the [Qubes Builder](/doc/qubes-builder-v2/) documentation for
|
||||||
instructions on how to compile them.
|
instructions on how to compile them.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user