Skip to content

Instantly share code, notes, and snippets.

@GermanAizek
Created April 8, 2025 21:46
Show Gist options
  • Save GermanAizek/2cc09f39f9366a237338061f8ae8545e to your computer and use it in GitHub Desktop.
Save GermanAizek/2cc09f39f9366a237338061f8ae8545e to your computer and use it in GitHub Desktop.
Deploy Whonix Gateway on Debian 12

in host debian 12

sudo apt -y install qemu-kvm libvirt-daemon bridge-utils virtinst libvirt-daemon-system
sudo apt -y install virt-top libguestfs-tools libosinfo-bin qemu-system virt-manager
sudo sed '/net.ipv4_forward=/s/^#//' -i /etc/sysctl.conf
sudo sysctl -p
sudo ln -s /etc/apparmor.d/libvirt/TEMPLATE.qemu /etc/apparmor.d/libvirt/TEMPLATE.kvm
sudo addgroup "$(whoami)" libvirt
sudo addgroup "$(whoami)" kvm
mkdir whonix-image && cd whonix-image
wget https://download.whonix.org/libvirt/15.0.1.9.3/Whonix-XFCE-15.0.1.9.3.Intel_AMD64.qcow2.libvirt.xz

extract whonix-gateway.qcow2 and xml edit xml to qcow2

sudo virsh -c qemu:///system net-define Whonix_external*.xml
sudo virsh -c qemu:///system net-define Whonix_internal*.xml
sudo virsh -c qemu:///system net-autostart Whonix-External
sudo virsh -c qemu:///system net-start Whonix-External
sudo virsh -c qemu:///system net-autostart Whonix-Internal
sudo virsh -c qemu:///system net-start Whonix-Internal
sudo virsh -c qemu:///system define Whonix-Gateway*.xml

in whonix-gateway

sudo apt-get -f install
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get update
sudo apt-get purge xfce4 lightdm
sudo apt autoremove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment