Qubes OS

Qubes OS security-through-isolation. Xen-based compartmentalization, disposable VMs, Whonix integration, split-GPG, USB isolation, and operational security architecture.

#Overview

#What is Qubes OS

Qubes OS is a security-focused desktop operating system built on the Xen hypervisor. Instead of running everything in a single OS, Qubes compartmentalizes your digital life into isolated virtual machines called "qubes."

Core principles:

  • Security through compartmentalization - each activity runs in its own isolated VM
  • Xen bare-metal hypervisor - qubes run directly on hardware via Xen, not inside a host OS
  • Compromise containment - if one qube is compromised, others remain unaffected
  • Isolated networking - network stack runs in a dedicated qube, separate from user apps
  • Hardware-enforced isolation - uses VT-x/VT-d and IOMMU for true hardware separation

Qubes is not a Linux distribution. It is a Xen distribution that runs Linux (and Windows) VMs as isolated compartments.

#Security Model

Traditional OS: malware in browser = full system compromise. Qubes OS: malware in browser qube = only that qube is compromised.

Traditional Linux:
  [Browser] [Email] [Files] [Keys]
  ──────────── One OS ─────────────
  ──────── One kernel ─────────────
  → Compromise anything = game over

Qubes OS:
  [Browser] [Email] [Files] [Keys]
  │ VM-1  │ VM-2  │ VM-3  │VM-4 │
  ──────── Xen Hypervisor ────────
  → Compromise VM-1 = only VM-1

Each qube has a color-coded window border so you always know which security domain you are in (red = untrusted, green = trusted, etc.).

#Architecture

#Core System Qubes

Qube Role Network Notes
dom0 Admin domain Never online Controls all other qubes, GUI, runs Xen
sys-net Network handler Physical NIC Holds network drivers, first point of contact
sys-firewall Firewall Between sys-net and AppVMs Filters traffic, per-qube rules
sys-usb USB controller None Isolates USB stack from dom0
sys-whonix Tor gateway Through sys-firewall Whonix Gateway for Tor routing

dom0 is the most privileged domain. It must never connect to any network. All admin operations happen here. If dom0 is compromised, the entire system is compromised.

#Qube Types

TemplateVM - Read-only base image. AppVMs inherit the root filesystem from here. Install software in the template, use it in AppVMs. Changes to the root filesystem in an AppVM are discarded on shutdown.

AppVM (Application VM) - Regular qubes for daily work. Root filesystem comes from a TemplateVM (read-only). Only /home and /rw persist across reboots.

DisposableVM - Spawned from a template, destroyed entirely when closed. No persistence at all. Ideal for opening untrusted files, links, or attachments.

StandaloneVM - Fully independent VM with its own root filesystem. Changes persist. Use for VMs that need a unique OS or heavy customization.

ServiceVM (sys-*) - System qubes providing services (networking, firewall, USB, Tor) to other qubes.

#How Qubes Networking Works

Internet
   │
   ▼
[sys-net]       ← physical NIC lives here
   │
   ▼
[sys-firewall]  ← per-qube firewall rules
   │
   ├──► [work]         (clearnet)
   ├──► [dev]          (clearnet)
   │
   ▼
[sys-whonix]    ← Tor gateway
   │
   ├──► [anon-browse]  (Tor)
   ├──► [comms]        (Tor)
   └──► [engagement]   (Tor)

Each AppVM connects through a NetVM. You choose which NetVM per-qube. A qube connected through sys-whonix cannot bypass Tor - the gateway enforces it at the network level.

#Installation

#Hardware Requirements

Requirement Minimum Recommended
CPU 64-bit Intel/AMD with VT-x/VT-d Recent Intel with VT-d + IOMMU
RAM 6 GB 16 GB+ (32 GB ideal)
Storage 32 GB 256 GB+ SSD (NVMe preferred)
GPU Intel integrated Intel integrated (Nvidia problematic)
BIOS VT-x enabled VT-x + VT-d + IOMMU all enabled
TPM Not required TPM 2.0 (for Anti Evil Maid)

Critical BIOS settings to enable:

Intel VT-x (Virtualization Technology)
Intel VT-d (Directed I/O)
IOMMU (Input/Output Memory Management Unit)
TPM 2.0 (optional, for AEM)
Secure Boot: DISABLE (Qubes uses its own chain)

Check the Qubes Hardware Compatibility List (HCL) before purchasing hardware. Lenovo ThinkPads (T480, T480s, X1 Carbon Gen 5/6/7, T14 Gen 1) and NitroPads are popular choices. AMD Ryzen platforms are increasingly well-supported.

#Installation Steps

# 1. Download Qubes ISO and verify signature
wget https://www.qubes-os.org/downloads/
gpg --fetch-keys https://keys.qubes-os.org/keys/qubes-release-4-signing-key.asc
gpg --verify Qubes-R4.2.x-x86_64.iso.asc Qubes-R4.2.x-x86_64.iso

# 2. Write to USB
sudo dd if=Qubes-R4.2.x-x86_64.iso of=/dev/sdX bs=1M status=progress

# 3. Boot from USB, follow installer
# - Full disk encryption (LUKS) - ALWAYS enable
# - Choose default template (Fedora + Debian)
# - Create default system qubes

Post-install first steps:

# In dom0 terminal:
# Update dom0
sudo qubes-dom0-update

# Update Fedora template
qvm-run -u root fedora-41 'dnf upgrade -y'

# Update Debian template
qvm-run -u root debian-12 'apt update && apt upgrade -y'

# Update Whonix templates
qvm-run -u root whonix-gateway-17 'apt update && apt upgrade -y'
qvm-run -u root whonix-workstation-17 'apt update && apt upgrade -y'

#Qube Management

#Creating and Controlling Qubes

# Create a new AppVM based on Fedora template
qvm-create myqube --template fedora-41 --label red

# Create with specific networking
qvm-create torqube --template fedora-41 --label purple \
  --prop netvm=sys-whonix

# Create a StandaloneVM
qvm-create standalone1 --class StandaloneVM --label blue

# Start / shutdown / kill
qvm-start myqube
qvm-shutdown myqube
qvm-shutdown --wait myqube    # wait until fully stopped
qvm-kill myqube               # force kill (like pulling the plug)

# Pause / unpause (freeze RAM state)
qvm-pause myqube
qvm-unpause myqube

#Running Commands in Qubes

# Run a command in a qube (from dom0)
qvm-run myqube 'firefox https://example.com'

# Run as root
qvm-run -u root myqube 'dnf install nmap'

# Run and pass through terminal output
qvm-run --pass-io myqube 'cat /etc/os-release'

# Run with auto-start (starts qube if not running)
qvm-run -a myqube 'xterm'

# Open a terminal in a qube
qvm-run myqube 'xterm'

#Listing and Inspecting Qubes

# List all qubes with status
qvm-ls

# Detailed list with networking info
qvm-ls -n

# List only running qubes
qvm-ls --running

# Show qube properties
qvm-prefs myqube

# Get specific property
qvm-prefs myqube netvm
qvm-prefs myqube memory
qvm-prefs myqube template

# Set properties
qvm-prefs myqube netvm sys-whonix
qvm-prefs myqube memory 4096
qvm-prefs myqube maxmem 8192
qvm-prefs myqube autostart True

#Qube Firewall Rules

# View firewall rules for a qube
qvm-firewall myqube list

# Allow all outgoing (default)
qvm-firewall myqube reset

# Drop all traffic (complete isolation)
qvm-firewall myqube del --rule-no 0
qvm-firewall myqube add drop

# Allow only specific destination
qvm-firewall myqube reset
qvm-firewall myqube del --rule-no 0
qvm-firewall myqube add accept dsthost=10.10.10.0/24
qvm-firewall myqube add accept dsthost=192.168.1.100 proto=tcp dstports=443
qvm-firewall myqube add drop

# Allow only DNS and HTTPS
qvm-firewall myqube reset
qvm-firewall myqube del --rule-no 0
qvm-firewall myqube add accept proto=udp dstports=53
qvm-firewall myqube add accept proto=tcp dstports=443
qvm-firewall myqube add drop

#Templates

#Default Templates

Template Base Use Case
fedora-41 Fedora General purpose, default AppVMs
debian-12 Debian Stability-focused AppVMs
whonix-gateway-17 Debian/Whonix Tor gateway (sys-whonix)
whonix-workstation-17 Debian/Whonix Tor workstation AppVMs
fedora-41-minimal Fedora Lightweight, smaller attack surface
debian-12-minimal Debian Lightweight, minimal packages

#Installing Software in Templates

Software must be installed in the TemplateVM. AppVMs based on that template will see the new software after restart.

# Open a root terminal in the template
qvm-run -u root fedora-41 'xterm'

# Inside the template, install packages
dnf install nmap wireshark python3-pip    # Fedora
apt install nmap wireshark python3-pip    # Debian

# Shut down the template
qvm-shutdown fedora-41

# Restart AppVMs to pick up changes
qvm-shutdown myqube && qvm-start myqube

AppVM persistence model:

TemplateVM (fedora-41)
├── /usr, /bin, /lib, /etc  → read-only overlay in AppVM
│                              (changes discarded on shutdown)
└── AppVM (myqube)
    └── /home/user          → persistent (stored in AppVM's private volume)
    └── /usr/local          → bind-mounted from /rw/usrlocal (persistent)
    └── /rw/config          → persistent (custom startup scripts, rc.local)

#Creating Custom Templates

# Clone an existing template
qvm-clone fedora-41 fedora-41-redteam

# Install offensive tools in the clone
qvm-run -u root fedora-41-redteam 'dnf install -y nmap \
  python3-pip john hashcat hydra'

# Create AppVMs from your custom template
qvm-create engagement --template fedora-41-redteam --label red \
  --prop netvm=sys-whonix

# Minimal template (smaller attack surface for service qubes)
sudo qubes-dom0-update qubes-template-fedora-41-minimal

# Install only what you need in minimal template
qvm-run -u root fedora-41-minimal \
  'dnf install qubes-core-agent-networking iproute'

#Disposable VMs

#DisposableVM Concept

A DisposableVM (DispVM) is created on-the-fly from a template, runs your task, and is completely destroyed when closed. No data persists. Every launch is a fresh state.

Use cases:

  • Opening untrusted email attachments
  • Browsing suspicious links
  • Viewing documents from unknown sources
  • Malware analysis (preliminary)
  • Any one-time task with untrusted data
# Open a file in a DisposableVM (from any qube)
# Right-click file -> Open in DisposableVM

# From dom0, launch a DispVM
qvm-run --dispvm fedora-41-dvm 'firefox https://suspicious-url.com'

# Set the default DispVM template
qvm-prefs myqube default_dispvm fedora-41-dvm

# Create a named DispVM template
qvm-create mydisp --class AppVM --template fedora-41 --label red
qvm-prefs mydisp template_for_dispvms True

# Set this DispVM template as default for a qube
qvm-prefs myqube default_dispvm mydisp

#Custom DispVM Templates

# Create a Whonix-based DisposableVM template
qvm-create whonix-dvm --class AppVM \
  --template whonix-workstation-17 --label purple
qvm-prefs whonix-dvm template_for_dispvms True
qvm-prefs whonix-dvm netvm sys-whonix

# Now DisposableVMs spawned from whonix-dvm
# route through Tor automatically

# Create a red-team DispVM for quick engagement work
qvm-create redteam-dvm --class AppVM \
  --template fedora-41-redteam --label red
qvm-prefs redteam-dvm template_for_dispvms True
qvm-prefs redteam-dvm netvm sys-whonix

Anything done inside a DispVM vanishes when the last window closes. No forensic artifacts remain on disk.

#Split-GPG

#Concept and Setup

Split-GPG keeps your private GPG key in an isolated vault qube (no network access). When another qube needs to sign or decrypt, it sends a request to the vault - the private key never leaves the vault.

[work qube]                    [vault qube]
 wants to sign email    --->    holds private key
 sends hash to vault           signs the hash
 receives signature     <---    returns signature
                                key NEVER leaves vault

Setup in the vault qube:

# In vault qube - generate or import your GPG key
gpg --full-generate-key
# Or import existing:
gpg --import private-key.asc

# The vault qube should have NO network access
# Verify in dom0:
qvm-prefs vault netvm
# Should return: (none) or empty

#Configuring Split-GPG

In dom0, configure the policy:

# /etc/qubes/policy.d/30-user-gpg.policy
# Allow 'work' to use GPG from 'vault'
qubes.Gpg  *  work  vault  allow
qubes.Gpg  *  @anyvm  @anyvm  deny

In the AppVM (work) that needs GPG access:

# Set environment variable (add to ~/.bashrc in the AppVM)
export QUBES_GPG_DOMAIN=vault

# Use qubes-gpg-client instead of gpg for operations
# needing the private key
qubes-gpg-client --list-keys
qubes-gpg-client --sign document.txt
qubes-gpg-client --decrypt secret.txt.gpg

# For git commit signing
git config --global gpg.program qubes-gpg-client-wrapper

The vault qube prompts for confirmation on each signing request, so a compromised AppVM cannot silently sign arbitrary data.

#Split-SSH

#SSH Key Isolation

Same principle as Split-GPG: SSH private keys live in the vault qube. Other qubes request SSH operations through a Qubes RPC mechanism.

# In vault qube: generate SSH key
ssh-keygen -t ed25519 -C "redteam@qubes"

# The key stays here. It never gets copied out.

In dom0, set the policy:

# /etc/qubes/policy.d/30-user-ssh.policy
qubes.SshAgent  *  work  vault  allow
qubes.SshAgent  *  engagement-1  vault  allow
qubes.SshAgent  *  @anyvm  @anyvm  deny

#Client Configuration

In the AppVM that needs SSH access:

# Add to ~/.bashrc in the AppVM
export SSH_AUTH_SOCK=/home/user/.SSH_AGENT_vault

# Verify agent forwarding works
ssh-add -l   # Should show keys from vault

# SSH connections now use the vault's key
ssh user@target-server

Benefits:

  • Private key never exists in the AppVM's filesystem
  • Even if the AppVM is fully compromised, the attacker cannot exfiltrate the key
  • Vault prompts on each use, so you see every SSH auth request
  • Revoke access by changing the policy in dom0

#USB Security

#sys-usb Isolation

The sys-usb qube holds all USB controllers. USB devices are not directly accessible to other qubes, preventing USB-based attacks (BadUSB, rubber ducky, malicious firmware) from reaching dom0 or AppVMs.

# Check which USB devices are connected (from dom0)
qvm-usb list

# Attach a USB device to a specific qube
qvm-usb attach myqube sys-usb:2-1

# Detach
qvm-usb detach myqube sys-usb:2-1

# Attach a USB storage device as a block device
qvm-block list
qvm-block attach myqube sys-usb:sda

# Detach block device
qvm-block detach myqube

#USB Keyboard Considerations

By default, Qubes blocks USB keyboards through sys-usb because a malicious USB device can impersonate a keyboard and inject commands.

# If you MUST use a USB keyboard, configure in dom0:
# /etc/qubes/policy.d/30-user-input.policy
qubes.InputKeyboard  *  sys-usb  dom0  allow

# Or during installation, select the USB keyboard option
# This creates sys-usb with input device passthrough

# Better approach: use PS/2 keyboard or laptop built-in keyboard
# and keep USB keyboards blocked

Risk model: a malicious USB device plugged into the machine can only interact with sys-usb. It cannot type commands into dom0 or any AppVM unless explicitly attached.

#File Transfer

#Inter-Qube File Operations

# Copy file from one qube to another (from source qube)
qvm-copy-to-vm target-qube /path/to/file
# File arrives in: /home/user/QubesIncoming/source-qube/

# Move file (removes from source)
qvm-move-to-vm target-qube /path/to/file

# From dom0, copy a file to a qube
qvm-run --pass-io myqube 'cat > /home/user/file.txt' < /path/in/dom0/file.txt

# From dom0, copy a file from a qube
qvm-run --pass-io myqube 'cat /home/user/file.txt' > /path/in/dom0/file.txt

#Clipboard Operations

# Qubes has a two-step clipboard:
# 1. Copy in source qube: Ctrl+C (normal copy)
# 2. Copy to global clipboard: Ctrl+Shift+C
# 3. Switch to target qube
# 4. Paste from global clipboard: Ctrl+Shift+V
# 5. Paste normally: Ctrl+V

# This prevents any qube from reading another qube's clipboard
# without explicit user action

#Safe File Handling with DispVMs

# Convert untrusted PDF to trusted (sanitize)
# In a qube, right-click file -> Open in DisposableVM
# The DispVM converts it to a safe format

# Using qvm-convert-pdf (Qubes PDF converter)
# Renders each PDF page as pixels, then rebuilds
# Strips all embedded code, JavaScript, macros
qvm-convert-pdf untrusted-document.pdf

# Convert untrusted images
qvm-convert-img untrusted-photo.jpg

#Operational Architecture for Red Team

#Qube Layout for Offensive Operations

dom0 (admin only, never online)
├── sys-net          (physical networking)
├── sys-firewall     (routing/filtering)
├── sys-whonix       (Tor gateway)
├── sys-vpn          (VPN gateway - ProtonVPN/Mullvad)
│
├── work             (daily tasks, clearnet via sys-firewall)
├── vault            (GPG keys, passwords, SSH keys - NO network)
├── comms            (Signal desktop, Matrix, email - via sys-whonix)
│
├── engagement-1     (client A tooling - via sys-whonix)
├── engagement-2     (client B tooling - via sys-vpn)
├── c2-controller    (C2 framework management - via sys-whonix)
│
├── dev              (code, tools, compiling - via sys-firewall)
├── malware-analysis (analysis VM - NO network or sys-whonix)
│
├── disposable-tor   (DispVM template - via sys-whonix)
└── disposable-clear (DispVM template - via sys-firewall)

#Building the Architecture

# Create VPN gateway qube
qvm-create sys-vpn --class AppVM --template fedora-41 --label orange
qvm-prefs sys-vpn provides_network True
qvm-prefs sys-vpn netvm sys-firewall
# Configure VPN inside sys-vpn (OpenVPN/WireGuard)

# Create vault (no network)
qvm-create vault --template fedora-41 --label black
qvm-prefs vault netvm ''

# Create engagement qubes
qvm-create engagement-1 --template fedora-41-redteam --label red \
  --prop netvm=sys-whonix
qvm-create engagement-2 --template fedora-41-redteam --label orange \
  --prop netvm=sys-vpn

# Create comms qube (Tor-only)
qvm-create comms --template fedora-41 --label purple \
  --prop netvm=sys-whonix

# Create malware analysis (isolated or Tor-only)
qvm-create malware-analysis --template fedora-41-redteam --label red
qvm-prefs malware-analysis netvm ''    # fully isolated
# Or: qvm-prefs malware-analysis netvm sys-whonix  # if you need to fetch samples

# Create C2 controller
qvm-create c2-controller --template fedora-41-redteam --label red \
  --prop netvm=sys-whonix

# Firewall rules: engagement qubes only talk to target scope
qvm-firewall engagement-1 reset
qvm-firewall engagement-1 del --rule-no 0
qvm-firewall engagement-1 add accept dsthost=10.10.10.0/24
qvm-firewall engagement-1 add drop

#Operational Rules

Rule Implementation
Client data never touches personal qubes Separate engagement qubes per client
Keys and credentials never leave vault Split-GPG, Split-SSH from vault
Untrusted content opens in DispVM Default DispVM set for all qubes
Each engagement has dedicated networking Per-qube NetVM selection
No clearnet from engagement qubes Route through sys-whonix or sys-vpn
Malware analysis is air-gapped malware-analysis has netvm=''
C2 traffic blends or tunnels through Tor c2-controller via sys-whonix
dom0 never runs untrusted code Admin operations only

#Common Commands Reference

#qvm-* Command Reference

Command Description Example
qvm-create Create a new qube qvm-create work --template fedora-41 --label green
qvm-remove Delete a qube qvm-remove old-qube
qvm-clone Clone a qube or template qvm-clone fedora-41 fedora-41-custom
qvm-start Start a qube qvm-start work
qvm-shutdown Graceful shutdown qvm-shutdown work --wait
qvm-kill Force kill a qube qvm-kill frozen-qube
qvm-run Execute command in a qube qvm-run work 'firefox'
qvm-run --pass-io Run with terminal I/O qvm-run --pass-io work 'ls -la'
qvm-run -u root Run as root in a qube qvm-run -u root fedora-41 'dnf update'
qvm-ls List all qubes qvm-ls -n
qvm-prefs Get/set qube properties qvm-prefs work netvm sys-whonix
qvm-firewall Manage qube firewall rules qvm-firewall work add accept dsthost=10.0.0.0/8
qvm-copy-to-vm Copy file to another qube qvm-copy-to-vm vault secret.key
qvm-move-to-vm Move file to another qube qvm-move-to-vm vault secret.key
qvm-usb List/attach/detach USB devices qvm-usb attach work sys-usb:2-1
qvm-block Manage block devices qvm-block attach work sys-usb:sda
qvm-volume Manage qube disk volumes qvm-volume extend work:private 50G
qvm-backup Create encrypted backup qvm-backup --compress-filter=gzip
qvm-backup-restore Restore from backup qvm-backup-restore /path/to/backup
qubes-dom0-update Update dom0 packages sudo qubes-dom0-update

#Qubes + Whonix Integration

#How It Works

Qubes + Whonix combines Qubes compartmentalization with Whonix Tor enforcement. Two specialized qubes handle this:

  • whonix-gateway (sys-whonix) - runs the Tor process, acts as a network gateway
  • whonix-workstation - template for AppVMs that must use Tor
[AppVM] ---> [sys-whonix] ---> [sys-firewall] ---> [sys-net] ---> Internet
                  │
              Tor process
              (all traffic forced through Tor)

The workstation cannot bypass Tor because it has no knowledge of the real network. It only sees sys-whonix as its gateway, which only routes through Tor.

#Stream Isolation

Whonix provides stream isolation - different applications use different Tor circuits, preventing correlation.

# Default Tor ports in Whonix (each uses a different circuit)
# 9050 - general SocksPort
# 9100 - Tor Browser
# 9101 - IRC
# 9102 - Instant messaging
# 9103 - apt-get
# 9104 - other software
# 9105 - wget

# Create a Whonix-based AppVM
qvm-create anon-browse --template whonix-workstation-17 \
  --label purple --prop netvm=sys-whonix

# Tor connection in the workstation just works
# No configuration needed - all traffic forced through Tor
curl https://check.torproject.org

Benefits of Qubes-Whonix vs standalone Whonix:

  • Hardware-level isolation (Xen) instead of VirtualBox
  • Multiple isolated Whonix workstations simultaneously
  • Compromise of one workstation does not affect others
  • Integrated with Qubes firewall and policy system
  • DisposableVM support for Whonix workstations

#Limitations

#Known Limitations

Hardware compatibility - Many laptops and desktops are not supported. Nvidia GPUs are problematic. Wi-Fi adapters may need specific drivers in sys-net. Always check the HCL.

RAM usage - Each qube consumes RAM. Running 5-10 qubes simultaneously needs 16-32 GB. Minimal templates help (use ~300 MB vs ~1 GB for full templates).

Performance - Xen overhead exists. Not suitable for gaming, video editing, or GPU-intensive tasks. No GPU passthrough for consumer GPUs.

Learning curve - Fundamentally different from standard Linux. File transfers, clipboard, software installation all work differently. Expect 1-2 weeks to become comfortable.

Software installation - Must be done in templates, not AppVMs. Some software that expects system-wide installation or persistence in unusual directories may not work well.

Suspend/resume - Can be unreliable depending on hardware. Some devices may not reconnect properly after resume.

#Mitigations for RAM

# Use minimal templates for service qubes
sudo qubes-dom0-update qubes-template-fedora-41-minimal

# Set lower memory for qubes that don't need much
qvm-prefs myqube memory 400
qvm-prefs myqube maxmem 2048

# Monitor memory usage
xl top        # in dom0, shows Xen domain resource usage
qvm-ls -n     # shows memory allocation per qube

#Compartmentalization Examples

#Color-Coded Qube Layout

Qubes uses color-coded window borders to visually identify security domains. Each qube's label determines its border color.

Label Color Qube Name Purpose NetVM
Green personal Personal browsing, social media sys-firewall
Blue work Work email, documents, meetings sys-firewall
Yellow banking Online banking, financial only sys-firewall
Red untrusted Sketchy links, unknown files sys-firewall
Purple anon-browse Anonymous browsing sys-whonix
Black vault GPG keys, passwords, SSH keys (none)
Orange dev Development, compiling sys-firewall
Red engagement Red team ops, offensive tools sys-whonix
# Build the full compartmentalized layout
qvm-create personal --template fedora-41 --label green
qvm-create work --template fedora-41 --label blue
qvm-create banking --template fedora-41 --label yellow
qvm-create untrusted --template fedora-41 --label red
qvm-create anon-browse --template whonix-workstation-17 \
  --label purple --prop netvm=sys-whonix
qvm-create vault --template fedora-41 --label black
qvm-prefs vault netvm ''
qvm-create dev --template fedora-41 --label orange

#Compartmentalization Rules

Rule Rationale
Never open personal links in work Prevents cross-contamination between identities
Never type passwords outside vault Credential isolation from compromised qubes
Always open unknown files in untrusted or DispVM Contains potential malware to a single qube
Banking only in banking qube Minimizes attack surface for financial sessions
No clearnet from anonymous qubes Prevents accidental identity leaks
GPG/SSH keys exist only in vault Split-GPG/SSH keeps keys off networked qubes
Engagement qubes are per-client Legal and evidence separation between engagements
DispVMs for all one-time tasks Zero persistence eliminates forensic artifacts

#Backup and Restore

#Creating Backups

# Backup all qubes to external drive (encrypted)
qvm-backup --compress-filter=gzip /mnt/backup/

# Backup specific qubes only
qvm-backup --compress-filter=gzip \
  -d /mnt/backup/ work vault personal

# Backup uses dom0 passphrase encryption
# You WILL be prompted for a passphrase
# Losing this passphrase = losing the backup

# List qubes included in a backup
qvm-backup-restore --list /mnt/backup/qubes-backup-2026*

#Restoring Backups

# Restore all qubes from backup
qvm-backup-restore /mnt/backup/qubes-backup-2026*

# Restore specific qubes only
qvm-backup-restore --include=work,vault \
  /mnt/backup/qubes-backup-2026*

# Restore to different template (if original is missing)
qvm-backup-restore --rename-conflicting \
  /mnt/backup/qubes-backup-2026*

# Verify backup integrity without restoring
qvm-backup-restore --verify-only \
  /mnt/backup/qubes-backup-2026*

Backup strategy: keep multiple encrypted backups on separate physical devices. Store at least one offsite. Test restores periodically - an untested backup is not a backup.

#Security Considerations

#What Qubes Protects Against

Threat Protection
Malware spreading between apps Each app runs in a separate VM with isolated filesystems
Network-based attacks on local apps Network stack is in sys-net, isolated from AppVMs
USB-based attacks (BadUSB, rubber ducky) USB controllers isolated in sys-usb
Clipboard sniffing Two-step clipboard requires explicit user action
Browser exploits compromising entire system Browser qube compromise stays in that qube
Evil maid attacks Anti Evil Maid (AEM) with TPM for boot integrity
Kernel exploits (in guest) Guest kernel exploit only affects that VM, not the Xen hypervisor
Traffic correlation (with Whonix) Per-qube Tor circuits via stream isolation

#What Qubes Does NOT Protect Against

Threat Why
Xen hypervisor exploits If Xen is compromised, all qubes are compromised
dom0 compromise dom0 controls everything - total compromise
Hardware implants / firmware rootkits Below the hypervisor layer, invisible to Qubes
User error (running malware in dom0) No OS protects against deliberate admin sabotage
Cold boot attacks RAM contents may be extractable with physical access
Side-channel attacks (Spectre, Meltdown) Mitigated but not fully eliminated at hypervisor level
Compromised templates If a TemplateVM is backdoored, all derived AppVMs inherit it
Screen capture from dom0 dom0 renders all windows, could screenshot any qube
Global adversaries with traffic analysis Tor helps but Qubes alone does not anonymize traffic

Key principle: Qubes assumes the guest OS will be compromised. It protects the system by containing that compromise. It does NOT protect against attacks below the hypervisor (hardware, firmware) or above the user (social engineering, operational mistakes).

#Comparison: Qubes vs Whonix vs Tails vs Linux

#Security-Focused OS Comparison

Feature Qubes OS Whonix Tails Standard Linux
Isolation model Xen VM per activity Two-VM (gateway + workstation) Single live system Single OS, no isolation
Anonymity Optional (with Whonix) Tor-enforced Tor-enforced None by default
Persistence Yes (per-qube) Yes Opt-in encrypted volume Full
Amnesic No (DispVMs are) No Yes (by default) No
Hardware isolation Yes (VT-d, IOMMU) No (relies on VirtualBox/KVM) No No
Network isolation Per-qube networking Gateway/workstation split Single Tor connection Shared stack
USB isolation sys-usb qube No No No
Bootable from USB No (installed to disk) No (installed in VM) Yes (designed for it) Depends on distro
RAM requirement 16 GB+ recommended 4 GB+ 2 GB+ 2 GB+
Best for Daily driver with compartments Anonymous workstation Temporary anonymous sessions General purpose
Threat model Compartmentalized compromise Network anonymity Leave no trace N/A
Can run simultaneously Many isolated environments One gateway + workstations One session One environment
Compromise impact One qube only Workstation (gateway may survive) Full system Full system

#When to Use What

Scenario Use Reason
Daily driver with compartmentalized security Qubes OS Persistent isolation between all activities
Anonymous research or communications Qubes + Whonix Tor enforcement with VM-level isolation
Temporary session that leaves no trace Tails Amnesic by design, boots from USB
Travel to hostile jurisdiction Tails on USB No disk persistence, plausible deniability
Red team engagement workstation Qubes + Whonix Per-client isolation, Tor-routed tooling, Split-GPG
Malware analysis lab Qubes (air-gapped qube) Snapshot, isolate, destroy per sample
Quick anonymous task (one-time) Tails or Whonix DispVM Fast, disposable, no setup overhead
Long-term anonymous identity Qubes + Whonix Persistent identity separation across qubes

Combine them: Qubes + Whonix gives both compartmentalization and anonymity. Use Tails on a USB stick for situations where you cannot use your Qubes machine or need to leave no trace on hardware.

#Also See

#Cyber Aurelien Guidi

  • Whonix (Tor-enforced anonymity OS with gateway isolation)
  • Tails (Amnesic live OS for temporary anonymous sessions)
  • GrapheneOS (Hardened mobile OS for privacy-focused devices)
  • Anonymization (Identity separation and OPSEC methodology)
  • Mullvad VPN (Privacy-focused VPN with anonymous signup)
  • OPSEC Checklist (Operational security verification steps)
  • Red Team Infra (Offensive infrastructure setup and management)