This how-to guide provides an easy and secure setup of Zim in Qubes OS.
What is Zim ?
In a nutshell, Zim - a notebook application - can be used to:
- Keep an archive of notes
- Keep a daily or weekly journal
- Take notes during meetings or lectures
- Organize task lists
- Draft blog entries and emails
- Do brainstorming
- a special usage for Qubes OS
Use Zim as offline bookmark manager (special usage for Qubes OS)
The idea, instead of using a persistent web-browser or a complex split-browser setup to store your bookmarks, you are using Zim to manage your bookmarks.
How does it work?
The Zim notebook should be placed into an offline qube and all hyperlink should open a disposable qube as default. The Qubes OS default setting will ask for an user confirmation to open it in dispxxxx, alternatively you can set the default i.e. to whonix-workstation. This configuration requires modification of Qubes OS RPC policies. Further information can be found in the Qubes OS Documentation.
RPC policy example
In dom0:
nano /etc/qubes/policy.d/10-user-open-url-and-file-in-dvm.policy
qubes.OpenInVM * @anyvm @dispvm ask default_target=default-vm
qubes.OpenURL * @anyvm @dispvm ask default_target=default-vm
Obviously, this simple setup comes with the downside, that you have no login or password auto-fill feature for your favorite bookmarks.
Remark:
To keep things minimal and avoid messing up your default templates, we are going to use a Debian minimal template as a baseline (the ‘deb-12-m-zim
’ will be a clone of it).
1. Create zim qubes
Open a dom0 terminal:
dxy=$(qvm-template list --available | grep -Eo "debian.*minimal" | tail -n 1 | grep -Eo "[0-9]+")
src="debian-${dxy}-minimal"
tpl="deb-${dxy}-m-zim"
app="zim"
qvm-template install ${src}
qvm-clone ${src} ${tpl}
qvm-create ${app} --template ${tpl} --label green
qvm-prefs ${app} netvm none
2. Install zim software packages
open the deb- * -m-zim (template) terminal from the dom0 terminal:
qvm-run --pass-io --user root ${tpl} xterm
afterwards, in the deb- * -m-zim terminal:
apt update && apt upgrade --yes
apt install --no-install-recommends qubes-core-agent-passwordless-root qubes-core-agent-nautilus nautilus gnome-terminal zim --yes
exit
3. Some additional tuning and configuration
There is a desktop icon tray which can be use to autostart Zim silently on boot.
open the zim (appVM) terminal:
nano ~/.config/autostart/zim-desktop-tray
[Desktop Entry]
Type=Application
Name=zim-trayicon
Exec=zim --plugin trayicon
X-GNOME-Autostart-enable=true
Afterwards, go to the Zim appVM Settings, in the Basic Tab check
Start qube automatically on boot.
Further customization can be easily made in the zim folder:
ls ~/.config/zim
Done.
Now, you have an easy solution in Qubes OS, to quickly note some thoughts, work on your daily to do’s list, or manage your offline bookmarks.
Enjoy