This guide explains the process of installing and using Trezor cryptocurrency hardware wallets on Qubes OS. Many people have been having issues using Trezor on Qubes so I compiled an exhaustive and ultimate guide on the process. Please comment any issues and I will help troubleshoot.
I am posting the brief instructions here. If you require more detail please see my Github.
Written by Ursidae: https://ursidaecyber.com
Install the Trezor Suite .AppImage from the Trezor website along with the signature and signing key in a new Whonix AppVM dedicated to Trezor.
Verify the download.
Execute code:
sudo chmod u+x /Downloads/Trezor-Suite-23.4.2-linux-x86_64.AppImage
In Trezor Whonix AppVM:
sudo nano /rw/config/rc.local
socat TCP-LISTEN:21325,fork EXEC:”qrexec-client-vm sys-usb trezord-service” &
In Dom0:
sudo nano /etc/qubes-rpc/policy/trezord-service
$anyvm $anyvm allow,user=trezord,target=sys-usb
Clone your current regular fedora-37 template Qube and name it fedora-37-sys.
Clone the fedora-37-dvm Qube and name it fedora-37-sys-dvm.
Set the template for the fedora-37-sys-dvm as fedora-37-sys.
Set sys-usb’s template as fedora-37-sys-dvm.
In fedora-37-sys-dvm:
sudo mkdir /usr/local/etc/qubes-rpc
sudo nano /usr/local/etc/qubes-rpc/trezord-service
socat -- TCP:localhost:21325
Save and exit.
Execute:
sudo chmod +x /usr/local/etc/qubes-rpc/trezord-service
In fedora-37-sys:
Download the Trezor Bridge .rpm file from Trezor.
sudo chmod u+x /Downloads/trezor-bridge-2.0.27-1.x86_64.rpm
sudo rpm -i /Downloads/trezor-bridge-2.0.27-1.x86_64.rpm
Note on Udev rpm use: Using the Trezor-provided Udev rpm file does not work for Qubes. See in-depth explanation section below. Use the provided Method 1 or 2 here. Use method 1 if comforable with enabling networking in template and method 2 if not.
Method 1: Manual Build
In fedora-37-sys:
sudo nano /etc/udev/rules.d/51-trezor.rules
Copy and paste this code into the file:
# Trezor
SUBSYSTEM=="usb", ATTR{idVendor}=="534c", ATTR{idProduct}=="0001", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="trezor%n"
KERNEL=="hidraw*", ATTRS{idVendor}=="534c", ATTRS{idProduct}=="0001", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
# Trezor v2
SUBSYSTEM=="usb", ATTR{idVendor}=="1209", ATTR{idProduct}=="53c0", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="trezor%n"
SUBSYSTEM=="usb", ATTR{idVendor}=="1209", ATTR{idProduct}=="53c1", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="trezor%n"
KERNEL=="hidraw*", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="53c1", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
Save and exit.
Execute:
sudo chmod +x /etc/udev/rules.d/51-trezor.rules
OR
Method 2: Curl Installation
In fedora-37-sys enable networking.
Install curl:
sudo dnf install curl
sudo curl https://data.trezor.io/udev/51-trezor.rules -o /etc/udev/rules.d/51-trezor.rules
sudo chmod +x /etc/udev/rules.d/51-trezor.rules
In the Trezor Whonix AppVM:
sudo apt install pip
pip3 install --user trezor
AND
In fedora-37-sys:
Allow networking.
Execute:
sudo dnf install trezor-common
Done.