Whonix for KVM
About this KVM Page Contributor maintained wiki page. | |
---|---|
Support Status | stable |
Difficulty | medium |
Contributor | HulaHoop |
Support | Community support only! |
Using Whonix with KVM (Kernel Virtual Machine)
General[edit]
What is KVM?[edit]
For an openly developed, free and open-source software (FOSS), GPL licensed hypervisor that can run Whonix, [2] it is recommended to use Kernel Virtual Machine (KVM) that comes with the GNU/Linux OS. KVM combined with the VirtualMachineManager front-end should provide a familiar, intuitive and easy-to-use GUI. KVM uses libvirt.
For a detailed view on KVM's security merits read the audit report issued by an independent security auditing firm.
Why Use KVM Over VirtualBox?[edit]
The VirtualBox developer team have taken the decision to switch out the BIOS in their hypervisor. However, it now comes with one that requires compilation by a toolchain that does not meet the definition of Free Software as per the guidelines of the Free Software Foundation. This move is considered problematic for free and open source software projects like Debian, on which Whonix is based.
The issues of the Open Watcom License are explained in this thread on the Debian Mailinglist. More references can be found here. In summary, there are issues surrounding the contradictory language of the license, the assertion of patents against software that rely upon it, and the placing of certain restrictions on software uses. For these reasons, those who care about running FOSS and appreciate its ethical views are recommended to avoid running VirtualBox; also see avoid non-freedom software.
Besides this licensing issue, a more tangible reason to avoid VirtualBox is the security practices of Oracle who produce the software. Events and news in recent years (like the Snowden leaks) demonstrate there is an urgent need for increased transparency and verifiable trust in the digital world. Oracle is infamous for their lack of transparency in disclosing the details of security bugs, as well as discouraging full and public disclosure by third parties. Security through obscurity is the flawed modus operandi at Oracle. [3]
Not going public with the details of vulnerabilities only leads to laziness and complacency on behalf of the company that fields the affected products. One example is this historical 0day vulnerability reported privately to Oracle in 2008 by an independent security researcher. Over four years later, the vulnerability remained unfixed, exhibiting Oracle has a history of failing to provide timely patches to customers so they can protect themselves.
On the VirtualBox bugtracker, ticket VirtualBox 5.2.18 is vulnerable to spectre/meltdown despite microcode being installed indicates non-responsiveness and non-progress by upstream. Users must patiently wait for VirtualBox developers to fix this bug. [4]
VirtualBox also contains significant functionality that is only available as a proprietary extension, such as USB / PCI passthrough and RDP connectivity. Based on Oracle's unfriendly track record with the FOSS community in the past -- examples include OpenSolaris and OpenOffice -- it would be unsurprising if users were charged for these restricted features in the future, or if the project was abandoned due to insufficient monetization.
For the opposite viewpoint, see Why use VirtualBox over KVM?
First-time User?[edit]
KVM Setup Instructions[edit]
Install KVM[edit]
Choose your host operating system.
Debian
Setup sudoers. Add the operating system user name to sudoers.
Become root.
su
Add the user account to the sudoer's group. Replace user with the actual operating system user name.
sudo adduser user sudo
Reboot so group changes take effect.
reboot
Update package lists.
sudo apt update
For Debian bookworm+ on Intel / AMD you need to install:
sudo apt install --no-install-recommends qemu-kvm qemu-system-x86 libvirt-daemon-system libvirt-clients virt-manager gir1.2-spiceclientgtk-3.0 dnsmasq-base qemu-utils iptables safe-rm xz-utils
For Debian bookworm+ on PowerPC you need to install:
sudo apt install --no-install-recommends qemu-system-ppc libvirt-daemon-system libvirt-clients virt-manager gir1.2-spiceclientgtk-3.0 dnsmasq-base qemu-utils iptables safe-rm xz-utils
Ubuntu
sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils libguestfs-tools genisoimage virtinst libosinfo-bin virt-manager dnsmasq-base iptables safe-rm xz-utils
Add your user to KVM Groups (1 of 2).
sudo adduser $USER libvirt
Add your user to KVM Groups (2 of 2).
sudo adduser $USER libvirt-qemu
Arch Linux
TODO: Possible to only install dnsmasq-base without the dnsmasq systemd unit or does Arch Linux keep the systemd unit disabled by default? CRITIQUES: "safe-rm" and "xz-utils" aren't Archlinux packages. tar should install xz-utils if there's a dependency. safe-rm has limited value. sudo pacman -Syu qemu libvirt virt-manager qemu-full dnsmasq bridge-utils safe-rm xz-utils
sudo systemctl enable libvirtd
Fedora
Check System Requirements
As KVM requires a CPU with virtualization extensions, check whether the system has either Intel VT or AMD-V. If the following command prints nothing, the system does not support the relevant virtualization extensions.
egrep -E '^flags.*(vmx|svm)' /proc/cpuinfo
Install Dependencies
To install mandatory and default packages in the virtualization group, run.
sudo dnf install @virtualization xz-utils
Alternatively, to install the mandatory, default, and optional packages, run.
sudo dnf group install --with-optional virtualization xz-utils
After package installation, start the libvirtd service.
sudo systemctl start libvirtd
To start the service on boot, run.
sudo systemctl enable libvirtd
Verify the KVM kernel modules loaded properly. If this command lists kvm_intel
or kvm_amd
, KVM is properly configured.
lsmod | grep kvm
Edit the libvirtd Configuration
System administration is limited to the root user by default. To enable a regular user, run the following commands.
Open the /etc/libvirt/libvirtd.conf
file for editing.
sudo nano /etc/libvirt/libvirtd.conf
Set the domain socket group ownership to libvirt.
unix_sock_group = "libvirt"
Adjust the Unix socket permissions for the R/W socket.
unix_sock_rw_perms = "0770"
Save and exit.
To administer libvirt as a regular user, add the user to the libvirt group. [6]
sudo usermod -a -G libvirt $(whoami)
You must log out and log in to apply the changes.
Other Distributions
The qemu-kvm and libvirt-bin packages are necessary. virt-manager is also required in order to use a graphical user interface (which most users want). tar, xz-utils is required to extract the Whonix images. It is most likely this software can be installed using the usual distribution's package manager.
If any of the following errors appear while later using virsh define.
error: Failed to define domain from Whonix-Gateway_kvm.xml error: internal error Unknown controller type 'pci
Whonix-Gateway_kvm.xml:24: element pm: Relax-NG validity error : Element domain has extra content: pm Whonix-Gateway_kvm.xml fails to validate
Relax-NG validity error : Extra element devices in interleave Whonix-Gateway_kvm.xml:24: element devices: Relax-NG validity error : Element domain failed to validate content Whonix-Gateway_kvm.xml fails to validate
Then a more recent version of libvirt and kvm is likely needed.
Readers are welcome to add detailed instructions for other distributions here!
Addgroup[edit]
In order to be able to manage virtual machines as a regular (non-root) user, that user must be added to the libvirt
and the kvm
groups.
- Debian (based) / Ubuntu:
- The following command will work in Debian and assumes the simple scenario whereby KVM will be utilized with the current logged in user. For older Ubuntu versions, note that the group names vary and libvirt may be called libvirtd instead. For Ubuntu 20.04, libvirt works.
- sudo adduser "$(whoami)" libvirt
- sudo adduser "$(whoami)" kvm
- [7]
- Arch Linux:
- sudo gpasswd -a $USER libvirt
- sudo gpasswd -a $USER kvm
- Other Distributions: If another distribution is in use, then first refer to the distribution manual. For example, a necessary reference for Arch users is the Arch Linux libvirt wiki page.
Restart libvirtd[edit]
Note: Restarting libvirtd is required after:
- KVM is installed.
- Users are added to groups.
sudo systemctl restart libvirtd
It's possible that a reboot of the computer maybe required instead, on some systems.
Network Start[edit]
Ensure KVM's / QEMU's default networking is enabled and has started. [8] [9]
sudo virsh -c qemu:///system net-autostart default
sudo virsh -c qemu:///system net-start default
Build from Scratch[edit]
Advanced users are encouraged to build Whonix images for high security assurance.
Information[edit]
It is strongly recommended to read and apply the steps outlined in this section. By applying a known and tested configuration, this will provide better convenience and security.
Be sure to use the qcow2 images that are provided by the Whonix project instead of rolling your own [10] because they contain important performance optimizations. [11] The only exception is if images were created from source. [12]
If problems are encountered with free disk space, using a file system that supports sparse files is recommended. Also refer to the following forum discussion.
If Whonix libvirt images already exist, then consider a Cleanup first.
For simplicity the Whonix images should be downloaded and stored in the home folder (/home/<your user name>) so the following commands can be copied/pasted without changes.
Download Whonix[edit]
GUI
- Whonix with Xfce graphical user interface (GUI).
- This version of Whonix is designed to run inside KVM.
Optional: Digital signature verification.
Version: 17.2.8.5
- Digital signatures are a tool enhancing download security. They are commonly used across the internet and nothing special to worry about.
- Optional, not required: Digital signatures are optional and not mandatory for using Whonix, but an extra security measure for advanced users. If you've never used them before, it might be overwhelming to look into them at this stage. Just ignore them for now.
- Learn more: Curious? If you are interested in becoming more familiar with advanced computer security concepts, you can learn more about digital signatures here digital software signatures.
CLI
- Whonix with command line interface (CLI).
- This version of Whonix is designed to run inside KVM.
- Whonix with CLI is a version suited for advanced users -- those who want Whonix without a graphical user interface (GUI).
Optional: Digital signature verification.
Version: 17.2.8.5
- Digital signatures are a tool enhancing download security. They are commonly used across the internet and nothing special to worry about.
- Optional, not required: Digital signatures are optional and not mandatory for using Whonix, but an extra security measure for advanced users. If you've never used them before, it might be overwhelming to look into them at this stage. Just ignore them for now.
- Learn more: Curious? If you are interested in becoming more familiar with advanced computer security concepts, you can learn more about digital signatures here digital software signatures.
Decompress[edit]
1. Change directory.
The decompression command below needs to be run from within the folder where you downloaded the archive (most likely in ~/Downloads
or ~/
(home) folder).
Note: Adjust the folder if you stored the archive elsewhere.
cd ~/Downloads
2. Do not use unxz
! Extract the images using gnu tar
.
3. Make sure the xz-utils
package is installed on your system.
[13]
If you followed the installation instructions above, this should already be the case.
4. Decompress.
tar -xvf Whonix*.libvirt.xz
5. Wait.
Please be aware that the extraction process may take an exceptionally long time to complete. It is recommended to allow the terminal to run uninterrupted after executing the command to ensure successful decompression.
6. Done.
License Agreement[edit]
Read the Whonix binary license agreement via one of the following resources:
- this online link; or
- open it with a text editor; or
- use
more
.
more WHONIX_BINARY_LICENSE_AGREEMENT
Press Enter
to scroll down.
Indicate either A) acceptance, or B) refusal.
A) In the case of acceptance:
touch WHONIX_BINARY_LICENSE_AGREEMENT_accepted
B) In the case of denial:
touch WHONIX_BINARY_LICENSE_AGREEMENT_denied
You are welcome to attempt negotiations regarding any element of these terms by contacting us.
By proceeding with installation, you acknowledge that you have read, understood and agreed to our Terms of Service and License Agreement.
VM Settings Modification[edit]
Optional.
Select Before VM Import or After VM Import.
Before VM Import
This section describes XML modifications before importing a virtual machine.
Modifying a machine's XML file provides more fine-grained control over its settings than what is exposed through the virt-manager GUI. Unless you are knowledgeable about this process, editing configuration defaults is neither recommended nor necessary.
Open file Whonix-Gateway*.xml
in a text editor of your choice as a regular, non-root user.
If you are using a graphical environment, run. mousepad Whonix-Gateway*.xml
If you are using a terminal, run. nano Whonix-Gateway*.xml
Open file Whonix-Workstation*.xml
in a text editor of your choice as a regular, non-root user.
If you are using a graphical environment, run. mousepad Whonix-Workstation*.xml
If you are using a terminal, run. nano Whonix-Workstation*.xml
After VM Import
For virtual machines that were already imported.
Choose either option A) or B).
A) With an Editor
1. Choose your favorite editor.
Optional.
Eventually configure your favorite editor to make changes. The relevant software of your choice must be already installed, such as kwrite
, leafpad
, kate
, vi
, nano
, vim
and so on. This is done by setting the VISUAL
environment variable.
export VISUAL=kwrite
2. Edit.
Use the virsh
command to open the configuration file.
Whonix-Gateway
sudo -E virsh -c qemu:///system edit Whonix-Gateway
Whonix-Workstation
sudo -E virsh -c qemu:///system edit Whonix-Workstation
3. Save.
4. Done.
Editing an Imported Machine's XML Configuration has been completed.
B) Using virt-manager
In more recent versions of virt-manager, there is a second way available:
Virtual Machine Manager
-> Edit
-> Preferences
-> General
-> Enable XML Editing
Under the Details
view for a VM, a new XML tab in the GUI is visible, allowing editing and saving directly from the VM viewer.
Importing Whonix VM Templates[edit]
The first step after extracting the archive is to import the supplied XML files. They serve as a description for libvirt and define the properties of the Whonix VMs and the networking they should have.
1. Add the virtual networks. This step only needs to be done once and not with every upgrade.
If the definition of a Whonix network fails because the virtual bridge "virbrX" already exists, edit the Whonix_external*.xml
and Whonix_internal*.xml
file and change the name to one that does not exist, for example "virbr3" (all existing bridge adapters can be listed with "sudo brctl show").
sudo virsh -c qemu:///system net-define Whonix_external*.xml
sudo virsh -c qemu:///system net-define Whonix_internal*.xml
2. Activate the virtual networks.
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
3. Import the Whonix Gateway and Workstation images.
sudo virsh -c qemu:///system define Whonix-Gateway*.xml
sudo virsh -c qemu:///system define Whonix-Workstation*.xml
Image File Installation[edit]
The XML files are configured to point to the default storage location of /var/lib/libvirt/images
. The image files can be moved or copied depending on storage constraints.
Notes:
- Changing the default location may cause conflicts with SELinux, which will prevent the machines from booting.
- Administrative rights (
sudo
) are required because the copying is to a privileged location in the system.
The following steps move or copy the images there so the machines can boot.
Either move or copy.
Moving Whonix Image Files
Move.
sudo mv Whonix-Gateway*.qcow2 /var/lib/libvirt/images/Whonix-Gateway.qcow2
sudo mv Whonix-Workstation*.qcow2 /var/lib/libvirt/images/Whonix-Workstation.qcow2
Copying Whonix Image Files
Copy.
Whonix disk images are sparse files , meaning they expand when filled rather than allocating their entire size (100GB outright). Sparse files require special commands when they are copied to ensure they do not lose this property, otherwise they will occupy all of the actual space.
sudo cp --sparse=always Whonix-Gateway*.qcow2 /var/lib/libvirt/images/Whonix-Gateway.qcow2
sudo cp --sparse=always Whonix-Workstation*.qcow2 /var/lib/libvirt/images/Whonix-Workstation.qcow2
Manipulating QCOW2 Images[edit]
Use qemu-img to interact with KVM disk images. This software can resize virtual disks, convert virtual disks to other formats, and more. It is not necessary nor recommended to change the official images, so proceed cautiously and only if the procedure is understood.
For more commands, refer to the qemu-img manual.
Encrypted Containers[edit]
It is possible to run image files from encrypted containers. sVirt protections are confirmed to be in effect for image files at alternative locations.
Change the permissions on the container mount point directory so virtual machine manager can access the image. In Zulucrypt, containers are mounted under /run/media/private/user
: [14]
sudo chmod og+xr /run/media/private/user/$container_name
After this in KVM .xml for both the gateway and the workstation you will need to edit the xml configuration and change the source file tag to: source file="/run/media/private/user/Whonix-Gateway.qcow2"
.
This is so that the VM can actually open and run.
Cleanup[edit]
After importing Whonix, it is advised to delete the archives (.libvirt.xz files) and the temporarily extracted folders, or to move them into a custom location. This is useful to avoid conflicts and confusion if a new version of Whonix is later downloaded.
To delete the archives and temporary folders, run.
Note: this may not work on some Linux distributions, those where safe-rm
is unavailable. In that case, use trash-put
(if trash-cli
package is available) or rm
(always available) instead.
safe-rm Whonix*
safe-rm -r WHONIX*
Start[edit]
If Virtual Machine Manager is familiar, there is nothing special about starting Whonix VMs compared to starting other VMs. First start Whonix-Gateway™, then start Whonix-Workstation™.
Using Whonix-Gateway with Xfce desktop vs CLI mode[edit]
To be able to start desktop environment, Whonix-Gateway virtual machine needs to be given at least 1 GB of RAM. Otherwise you will only be able to boot in CLI mode. To disable startup of the included Desktop Environment regardless of how much RAM is assigned to the VM, configure RAM Adjusted Desktop Starter package settings.
Graphical User Interface (GUI)[edit]
Start Virtual Machine Manager.
Start Menu
→ Applications
→ System
→ Virtual Machine Manager
Start Whonix-Gateway.
click on Whonix-Gateway
→ click open
→ click the play symbol
Repeat the steps for Whonix-Workstation.
Command Line Interface (CLI)[edit]
The following instructions have been re-tested in September 2024.
1. Open a terminal Inside the VM that should be accessed through CLI.
This is required for the setup of the serial console VM settings.
2. Install package.
Install package(s) serial-console-enable
following these instructions
1 Platform specific notice.
- Non-Qubes-Whonix: No special notice.
- Qubes-Whonix: In Template.
2 Update the package lists and upgrade the system .
sudo apt update && sudo apt full-upgrade
3 Install the serial-console-enable
package(s).
Using apt
command line
--no-install-recommends
option
is in most cases optional.
sudo apt install --no-install-recommends serial-console-enable
4 Platform specific notice.
- Non-Qubes-Whonix: No special notice.
- Qubes-Whonix: Shut down Template and restart App Qubes based on it as per Qubes Template Modification .
5 Done.
The procedure of installing package(s) serial-console-enable
is complete.
3. Shut down the VM.
3. Open a terminal on the host.
4. To start Whonix-Gateway, run.
sudo virsh start Whonix-Gateway
To start Whonix-Workstation, run.
sudo virsh start Whonix-Workstation
5. To interact with the Whonix-Workstation via serial console, run.
sudo virsh console Whonix-Workstation
6. To exit the console session Press Ctrl + ]
(Control and closing square bracket). This will take you back to your host terminal while leaving the VM running.
7. Done.
forum discussion: https://forums.whonix.org/t/how-do-i-enter-the-whonix-shell-from-cli/7271
Adjust Display Resolution[edit]
Whisker Menu
→ display
→ select resolution
[15]
Alternatively,
GUI Console
→ View
→ Scale Display
→ Check: Always + Auto resize VM with window
. Every new session, a reboot is needed while the VM's GUI console is open and maximized to activate display resize.
After Installing[edit]
Read and apply the Post Installation Security Advice.
Uninstall[edit]
If you want to remove Whonix KVM VMs, Whonix network and Whonix images, click on Expand on the right.
1. Power off the VM you want to shut down. [16]
sudo virsh -c qemu:///system destroy Whonix-Gateway
sudo virsh -c qemu:///system destroy Whonix-Workstation
2. Remove KVM VM settings.
sudo virsh -c qemu:///system undefine Whonix-Gateway
sudo virsh -c qemu:///system undefine Whonix-Workstation
3. Shut down KVM Network Whonix.
Warning: Whonix 14 and earlier versions used the network names "external" and "internal". This means the command must be changed accordingly. Try "virsh -c qemu:///system net-list" to list them all.
sudo virsh -c qemu:///system net-destroy Whonix-External sudo virsh -c qemu:///system net-destroy Whonix-Internal
4. Remove Network Whonix.
Warning: Whonix 14 and earlier versions used the network names "external" and "internal". This means the command must be changed accordingly. Try "sudo virsh -c qemu:///system net-list" to list them all.
sudo virsh -c qemu:///system net-undefine Whonix-External sudo virsh -c qemu:///system net-undefine Whonix-Internal
5. Delete the images.
Note: All data will be lost unless it is first backed up.
sudo rm /var/lib/libvirt/images/Whonix-Gateway.qcow2
sudo rm /var/lib/libvirt/images/Whonix-Workstation.qcow2
KVM Upgrade Instructions[edit]
It is strongly recommended to uninstall older Whonix versions and always run the stable release. Note that Whonix supports in-place APT upgrades too.
Optional[edit]
Fullscreen Mode[edit]
- To enter fullscreen mode press on:
- To exit fullscreen mode press on: (go with your mouse to the top middle of the screen)
Multiple Whonix-Gateway[edit]
See: Multiple Whonix-Gateway.
Testing Upcoming Versions[edit]
Download the test images from the latest folder listed here. Apply the Multiple Whonix-Gateway KVM steps for running Whonix versions side by side with some differences:
- Rename the test Whonix images to something unique, preferably by appending the version number to the name.
- Edit the XML templates and change the VM names.
- Import the images by following the Importing Whonix installation steps. Keep in mind the full name of the new images must be used and do not import the Network templates.
Convert Libvirt Templates to QEMU Commands[edit]
- First export the VM template as a file: sudo virsh dumpxml Whonix-Gateway > Whonix-Gateway.xml
- Convert it to the QEMU command: sudo virsh domxml-to-native qemu-argv Whonix-Gateway.xml > Whonix-Gateway.args
- Repeat for the Whonix-Workstation. Replace
Whonix-Gateway
withWhonix-Workstation
in above commands.
Magic SysRq Keys[edit]
Magic SysRq keys are useful when the guest is unresponsive, especially in cases where VMs are running headless and a GUI console is not available for forcing them to shut off on the host. [17]
Example command to shut down Whonix Workstation from a host console. The O at the end of KEY_O can be substituted with any other supported letter listed in the kernel documentation. See also SysRq.
sudo virsh send-key Whonix-Workstation KEY_LEFTALT KEY_SYSRQ KEY_O
DHCP[edit]
Libvirt provides built-in DHCP functionality via a custom install of the minimalist Dnsmasq DNS/DHCP daemon. [18] This is useful when running multiple Workstations concurrently that are attached to the same Gateway, and for custom Workstations running Android x86.
For privacy and traffic leak purposes Dnsmasq does not resolve DNS as implemented in Libvirt. [19] [20] DNS is not explicitly enabled for guests unless it is added to a network’s configuration. [21] [22] Even when DNS is enabled, the way Libvirt uses it does not increase the host's attack surface (by using raw sockets for example) nor does DHCP because it is bound to a specific NIC in this case. [23] Trying to edit the Dnsmasq configuration files directly will fail as settings are rewritten and are enforced through Libvirt by design. [24]
1. Edit the network configuration file.
sudo nano /etc/network/interfaces.d/30_non-qubes-whonix
2. Make the following comment changes.
Comment out.
auto eth0 iface eth0 inet static address 10.152.152.11 netmask 255.255.192.0 gateway 10.152.152.10
Comment in.
auto eth0 iface eth0 inet dhcp
Save the file.
3. Change the internal network setting.
sudo virsh net-edit Whonix-Internal
<ip address='10.152.152.0' netmask='255.255.192.0'> <dhcp> <range start='10.152.128.1' end='10.152.191.254'/> </dhcp> </ip>
4. Restart the internal network.
sudo virsh net-destroy Whonix-Internal
sudo virsh -c qemu:///system net-start Whonix-Internal
5. Use sudo ifconfig
to confirm if dynamic IP assignment is functional.
6. Optional: Construct a static IP address.
Libvirt also allows the pairing of a static IP from the DHCP server to a VM with a specific MAC address if services in the Workstation depend on predictable IPs. See the host attribute under the dhcp element.
7. Install a dhcp client on the Workstation and reboot. sudo apt install isc-dhcp-client
Snapshot Migration[edit]
If the VM has snapshots that you wish to preserve, the snapshot xml-files of the source VM should be dumped with the following commands. [25]
1. List snapshot names of the VM.
sudo virsh snapshot-list --name $dom
2. Dump each snapshot you want to back-up.
sudo virsh snapshot-dumpxml $dom $name > file.xml
3. Restore snapshots at the destination.
sudo virsh snapshot-create --redefine $dom file.xml
4. Optional: Identify which snapshot is the current one.
On the source VM, run.
sudo virsh snapshot-current --name $dom
On the destination, run.
sudo virsh snapshot-current $dom $name
Nested KVM Virtualization[edit]
It is possible to create nested KVM VMs on KVM hosts. As root...
Check the current setting on the host. If the result is [Y]
, then it is okay.
sudo cat /sys/module/kvm_intel/parameters/nested
For AMD systems use kvm_amd
instead.
sudo cat /sys/module/kvm_amd/parameters/nested
If the result is [N], run the following command and reboot the system.
For Intel systems:
echo 'options kvm_intel nested=1' | sudo tee -a /etc/modprobe.d/qemu-system-x86.conf
For AMD systems:
echo 'options kvm_amd nested=1' | sudo tee -a /etc/modprobe.d/qemu-system-x86.conf
Host CPU instructions that include the svm
and vmx
extensions are passed through to the Workstation by default.
Compressing Disk Images[edit]
Some users find it easier to move the sparse image files when they are compressed in a tarball.
To re-compress files, run.
tar -Sczvf whonix.tar.gz <multiple file names separated by spaces>
Adding vCPUs[edit]
The pinning parameter cpuset='1'
must be removed in the vcpu
tag in the XML settings to allow adding more cores to a VM, otherwise performance issues and lockups will occur. CPU pinning is done to safeguard processes in other VMs that run cryptographic operations from side-channel attacks in case of a vulnerability in a cryptographic library.
To add more vcpus, increase the number in between the opening and closing vcpu
tags. Alternatively, use the hardware 'Details' pane in virtual Machine Manager.
If preserving cpu pinning while increasing core count is desired, pin the vcpus to different numbered ones compared to other sensitive VMs. Map them in a 1:1 ratio to avoid over committing cores (which leads to performance problems).
3D Graphics Acceleration[edit]
Having video issues? See Videos instead.
Enabling 3D acceleration is discouraged because it increases the attack surface. This is a general KVM issue and is not specific to Whonix.
(Advanced users, see: Dev/KVM#Virgl3D)
1. Ensure that your host GPU drivers are installed and functional. If your host lacks a dedicated GPU and relies on software rendering (CPU), you should install libgl1-mesa-dri
and mesa-utils
on the host (if it’s Debian-based) to verify OpenGL functionality and enable software-based OpenGL rendering.
sudo apt install libgl1-mesa-dri mesa-utils
2. Modify the VM settings before or after installation, as required:
- Before Installation.
- After Installation:
sudo virsh edit Whonix-Workstation
3. Locate the following section and apply the necessary changes:
- <listen type='none'/> : SPICE doesn't support TLS + OpenGL with remote connections, so it must be enabled locally.
- <gl enable='yes'/> : Enable OpenGL.
- <acceleration accel3d='yes'/> : Enable 3D acceleration.
Here is a full example of the relevant sections.
<graphics type='spice'> <listen type='none'/> <clipboard copypaste='yes'/> <filetransfer enable='no'/> <gl enable='yes'/> </graphics> <audio id='1' type='spice'/> <video> <model type='virtio' heads='1' primary='yes'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video>
4. Restart your VMs if they are running.
5. Notes:
- Spice Listen Type: Setting <listen type="socket"/> can also be used.
6. Done.
3D Graphics Acceleration - Testing[edit]
3D Graphics Acceleration - Testing - drm[edit]
source: ArchLinux wiki QEMU, chapter virtio
sudo dmesg | grep -i drm
[drm] pci: virtio-vga detected [drm] virgl 3d acceleration enabled
Note: DRM is referring to Direct Rendering Manager. Unrelated to Digital Restrictions Management
3D Graphics Acceleration - Functionality Test[edit]
Install package(s) mesa-utils
following these instructions
1 Platform specific notice.
- Non-Qubes-Whonix: No special notice.
- Qubes-Whonix: In Template.
2 Update the package lists and upgrade the system .
sudo apt update && sudo apt full-upgrade
3 Install the mesa-utils
package(s).
Using apt
command line
--no-install-recommends
option
is in most cases optional.
sudo apt install --no-install-recommends mesa-utils
4 Platform specific notice.
- Non-Qubes-Whonix: No special notice.
- Qubes-Whonix: Shut down Template and restart App Qubes based on it as per Qubes Template Modification .
5 Done.
The procedure of installing package(s) mesa-utils
is complete.
Run:
glxinfo | grep rendering
The output should be [26]:
direct rendering: Yes
3D Graphics Acceleration - Troubleshooting[edit]
The errors below are common when dealing with 3D acceleration, especially in environments with older hardware or improper configurations. Use these error outputs as references when troubleshooting.
What if OpenGL is not found or installed on the host, especially when there is no dedicated graphics card (GPU)?
Error starting domain: internal error: QEMU unexpectedly closed the monitor (vm='Whonix-Workstation'): 2024-09-04T04:29:19.732050Z qemu-system-x86_64: -device {"driver":"virtio-vga-gl","id":"video0","max_outputs":1,"bus":"pcie.0","addr":"0x1"}: opengl is not available Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper callback(asyncjob, *args, **kwargs) File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb callback(*args, **kwargs) File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn ret = fn(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/virt-manager/virtManager/object/domain.py", line 1402, in startup self._backend.create() File "/usr/lib/python3/dist-packages/libvirt.py", line 1379, in create raise libvirtError('virDomainCreate() failed') libvirt.libvirtError: internal error: QEMU unexpectedly closed the monitor (vm='Whonix-Workstation'): 2024-09-04T04:29:19.732050Z qemu-system-x86_64: -device {"driver":"virtio-vga-gl","id":"video0","max_outputs":1,"bus":"pcie.0","addr":"0x1"}: opengl is not available
What if the host lacks a dedicated GPU and uses an outdated CPU?
Error starting domain: internal error: QEMU unexpectedly closed the monitor (vm='Whonix-Workstation'): qemu_gl_create_compile_shader: compile vertex error 0:1(10): error: GLSL ES 3.00 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES qemu_gl_create_compile_shader: compile fragment error 0:1(10): error: GLSL ES 3.00 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES qemu_gl_create_compile_shader: compile vertex error 0:1(10): error: GLSL ES 3.00 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES qemu_gl_create_compile_shader: compile fragment error 0:1(10): error: GLSL ES 3.00 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper callback(asyncjob, *args, **kwargs) File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb callback(*args, **kwargs) File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn ret = fn(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/virt-manager/virtManager/object/domain.py", line 1402, in startup self._backend.create() File "/usr/lib/python3/dist-packages/libvirt.py", line 1379, in create raise libvirtError('virDomainCreate() failed') libvirt.libvirtError: internal error: QEMU unexpectedly closed the monitor (vm='Whonix-Workstation'): qemu_gl_create_compile_shader: compile vertex error 0:1(10): error: GLSL ES 3.00 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES qemu_gl_create_compile_shader: compile fragment error 0:1(10): error: GLSL ES 3.00 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES qemu_gl_create_compile_shader: compile vertex error 0:1(10): error: GLSL ES 3.00 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES qemu_gl_create_compile_shader: compile fragment error 0:1(10): error: GLSL ES 3.00 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES
What if TLS is enabled for remote SPICE along with 3D acceleration/OpenGL?
Error starting domain: internal error: process exited while connecting to monitor: 2024-09-04T04:34:37.668627Z qemu-system-x86_64: SPICE GL support is local-only for now and incompatible with -spice port/tls-port Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper callback(asyncjob, *args, **kwargs) File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb callback(*args, **kwargs) File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn ret = fn(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/virt-manager/virtManager/object/domain.py", line 1402, in startup self._backend.create() File "/usr/lib/python3/dist-packages/libvirt.py", line 1379, in create raise libvirtError('virDomainCreate() failed') libvirt.libvirtError: internal error: process exited while connecting to monitor: 2024-09-04T04:34:37.668627Z qemu-system-x86_64: SPICE GL support is local-only for now and incompatible with -spice port/tls-port
Mouse Smoothness[edit]
For smoother mouse movement.
As per Domain XML format, Input devices.
1. VM Settings Modification required.
2. Look for <devices> .
3. Below it, append the following.
<input type='tablet' bus='virtio'/>
forum discussion: https://forums.whonix.org/t/p-s2-mouse-movement-in-cutom-debian-workstation/19985
[edit]
Follow these steps to move data between the guest and host. It is recommended to create/assign a unique directory per snapshot to keep shared content belonging to different security domains separate.
1. On the host run the following command in a terminal (Start Menu → Applications → System → Terminal).
Replace user name user
with your actual user name.
mkdir /home/user/shared
2. Adjust permissions on the host to allow read and write access to the folder with chmod.
Replace user name user
with your actual user name.
chmod 777 /home/user/shared
3. Enable shared folders in VirtManager.
VirtManager
→ Select VM
→ Edit
→ Virtual Machine Details
→ Details
→ Add Hardware
→ File System
4. Choose the following settings.
Replace user name user
with your actual user name.
- Mode: Mapped [27]
- Driver: Default
- Source Path:
/home/user/shared
- Target Path:
shared
5. Click finish.
6. Done.
Whonix-Workstation should automatically find and mount the shared folder under /mnt/shared
once it's created on the host and enabled in VirtManager.
Mandatory Access Control[edit]
Note: If your system is configured to use a Mandatory Access Control framework then it might be necessary to configure exceptions to allow the confined guests to communicate with the shared folder on the host.
Tests with Apparmor have shown it operates transparently with shared folders, without the need for a manual exception configuration.
On the host, chmod must be applied to the shared folder's contents to access the files.
Replace user name user
with your actual user name.
sudo chmod 777 -R /home/user/shared
If SELinux is disabled then everything should be functional. If SELinux is enabled, it is necessary to add a policy for files under the shared folder on the host. SELinux will not allow this folder to be shared until it is labeled svirt_image_t
. To achieve this add the following policy on the host using semanage. Note that these steps must be re-applied every time something is transferred. [28] [29]
sudo semanage fcontext -a -t svirt_image_t "/home/user/shared(/.*)?" restorecon -vR /home/user/shared
Setting execute permission on the user folder itself may be necessary for the guest to start up without a permission error.
sudo chmod 701 /home/user
Or, more safely, you can set it just for virt-manager. The name libvirt-qemu
can be different on your distribution.
sudo setfacl -m u:libvirt-qemu:x /home/user
If you are using the command line instead of virt-manager to edit the vm's device settings, add this next section to the xml.
<filesystem type='mount' accessmode='mapped'> <source dir='/home/user/shared'/> <target dir='shared'/> </filesystem>
USB Passthrough[edit]
Libvirt supports passing through a computer's integrated webcam or any other USB devices. [30] [31] Debian contributors have disabled USB auto-redirection by default to prevent the accidental passthrough of trusted USB devices to untrusted guests, [32] [33] so they must be reverted temporarily. Once finished, change them back to safe defaults by going through the steps in reverse order.
Limitations: These steps apply to USB storage devices only. Portable devices such as phones and tablets are problematic and may not be successfully auto-redirected.
The USB drive will only be isolated so long as the Whonix-Workstation is running. Do not close the VM GUI window or the device will be reassigned to the host. The VM window must be in focus (either mouse grabbed or in fullscreen mode just to be safe) when initially plugging in the device. The VM window can be minimized after it is detected in the guest. It is unnecessary to wait for the VM to completely boot.
1. Edit the libvirt glib-2.0 schema.
sudo nano /usr/share/glib-2.0/schemas/10_virt-manager.gschema.override
2. Change the default contents.
[org.virt-manager.virt-manager.console] auto-redirect=false
Should be changed to.
[org.virt-manager.virt-manager.console]
3. Recompile the schemas for changes to take effect. [34]
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/
4. Close all instances of Libvirt/Virtual Machine Manager and restart them so the new settings apply.
5.1. In the Details pane change the Controller USB device model.
Hypervisor Default
→ USB 2
2. While Whonix-Workstation is turned off, add four USB Redirection devices or as many as the number of USB ports the machine has to cover them all.
Whonix-Workstation viewer window
→ View
→ Details
→ Add Hardware
→ USB Redirection
3. Start Whonix-Workstation and select the device connected to the host that you want to passthrough.
Whonix-Workstation viewer window
→ File
→ Redirect USB
→ Choose: Webcam (or another USB Device)
Note this last step must be done on demand as the device passed through is not set permanently across reboots. This prevents mistakes like USB passthrough when the VM is in an untrusted state.
6. Boot Whonix-Workstation and connect the USB thumbdrive.
The thumbdrive should be automatically seen in the guest only.
Enable Microphone Input[edit]
Microphone input to guests is a nice feature for VoIP, but it is dangerous to have on by default. It is good practice to disable the microphone on your host system through sound settings when it is not in active use.
The shipped configuration only includes a speaker by default (without a microphone) to prevent malware in the VM from eavesdropping on the user. To enable microphone input for select guests, edit the configuration and change <codec type='output'/>
-> <codec type='micro'/>
.
Creating Multiple Internal Networks[edit]
Open the Whonix network XML file and change the name attribute to something different than the internal network that is currently running, for example Whonix-Internal2
, Whonix-Internal3
and so on. The default network name in use is Whonix-Internal
.
Alternative Configurations[edit]
Libvirt can support a variety of containment mechanisms. Currently supported mechanisms include KVM on the x86_64 platform and QEMU, but more configurations might be added at a later date. If hardware virtualization extensions are available, always use the KVM one.
To use another configuration, import its XML file with virsh.
How to Leave KVM when no X is Running[edit]
In the hypothetical situation whereby a user is "trapped" in a virtual console inside a VM without graphical desktop environment (X Window System) ("sudo service lightdm stop
"), it is still possible to switch back to the host.
In other words, should the graphical desktop environment crash or be terminated, the user may be "trapped" inside a black VM window. It is possible to exit this.
The emulated tablet device handles this by not allowing the mouse to be captured by the guest, however this is still possible:
Press Ctrl_L & Alt_L
Setting up gdb to work with qemu-kvm via libvirt[edit]
In order to debug a Linux kernel that is running as a KVM guest, the -s
parameter must be specified for the command line of qemu-kvm. Unfortunately there is no (easy) way to do this when libvirt and virt-manager are used to manage your virtual machines (instead of using KVM directly). In this case it is necessary to change the XML configuration of the virtual machine so that the -s
parameter is passed on to qemu-kvm.
1. Open the XML configuration.
sudo virsh edit $guestvm
Here, $guestvm
is the name of the VM that is managed via virt-manager. This will bring up the XML configuration of the VM in your editor.
2. Edit the XML configuration.
Change the first line of the XML file from.
<domain type='kvm'>
To.
<domain type='kvm' xmlns:qemu='https://libvirt.org/schemas/domain/qemu/1.0'>
It is also necessary to add this setting.
<qemu:commandline> <qemu:arg value='-s'/> </qemu:commandline>
Under the <domain>
level of the XML.
3. Save the XML configuration.
After saving and quitting the editor, the new configuration will come into effect. When the virtual machine is started, there will be a local TCP port (1234
by default) that can be used as a remote debugging port from gdb.
4. Connect to the local TCP port.
Use the following command from gdb running on the host machine.
target remote localhost:1234
Source: [35]
Unsafe Features[edit]
The features below have serious security implications and should not be used. This applies to all hypervisors in general.
LVM Storage[edit]
QCOW2 virtual disk images are the recommended and default storage format for KVM. LVM or any other storage mechanism must be avoided for security and privacy. LVM misconfiguration has serious security consequences and exposes the host filesystem to the processes running on the guest. [36]
In the event a virtual disk is no longer used -- where the low-level view of the storage can be controlled -- data created by VMs can easily be recovered and exfiltrated by malicious forensics tools run in a VM at a later time. This is extremely dangerous and can expose all kinds of information originally created in a VM of higher trust level. This leads to deanonymization, past session linking and theft of sensitive information and keys. [37] [38] This setting is disabled in cloud tenancy environments.
HugePages[edit]
THP/Hugepages aid rowhammer attacks [39] and memory de-duplication attacks (see KSM below) and therefore must be disabled for the guest and on the host. Research suggests that Debian hosts do not enable this feature and it is also disabled in cloud tenancy environments.
Memory Ballooning[edit]
Memory ballooning can potentially be abused by malicious guests to mount rowhammer attacks on the host. [40]
Clipboard Sharing[edit]
SPICE allows accelerated graphics and clipboard sharing. The clipboard is disabled by default for security reasons:
- To prevent the accidental copying of a link to a website that was visited anonymously to the non-anonymous host browser (or vice versa).
- To stop malware in Whonix Workstation from pilfering sensitive info from the clipboard.
If you still want to enable it, edit the VM config file and then change <clipboard copypaste='no'/>
to 'yes', then save and restart.
KSM[edit]
KSM is a memory de-deuplication feature that conserves memory by combining identical pages across VM RAM, but it is not enabled by default. Enabling this feature is dangerous because it allows cross-VM snooping by a malicious process. [41] It is capable of inferring what programs/pages are being visited outside the VM. [42] This feature is disabled in cloud tenancy environments and can also allow attackers to modify/steal APT keys and source lists of the host. [43] [44]
File-system Dedupe[edit]
Similar to KSM memory dedupe, filesystem dedupe introduces data leaks that violate hypervisor boundaries. The presence of certain files can be confirmed. These may develop into more advanced attacks on security in the future just like KSM related attacks have. ZFS and Btrfs have dedupe features but they are not enabled by default and should be avoided for high security environments. [45]
Device Passthrough[edit]
Both USB and PCI device passthrough permit advanced attackers to flash the firmware of those devices and infect the host or other VMs. [46]
XML Settings[edit]
For more information on settings, please refer to the Libvirt manual.
Troubleshooting[edit]
Videos[edit]
Enabling 3D Graphics Acceleration might not be required for watching (YouTube) videos.
By Adding vCPUs VM can plays videos without having to resort to 3D acceleration. [47]
Request operation not valid: blkio device weight is valid only for bfq or cfq scheduler[edit]
Error starting domain: Request operation not valid: blkio device weight is valid only for bfq or cfq scheduler
As of March 2019, it has been reported that the blkio throttling feature appears to be missing/unsupported on some Linux distributions. Among them is the latest Arch version. This causes a failure during VM start up. [48] The VM also fails to start up on Ubuntu 20.04 with a "blkio" error. The current work around is to remove the feature for now.
1. Edit the configuration file.
sudo virsh edit Whonix-Gateway
2. Strip out the following setting.
<blkiotune> <weight>250</weight> </blkiotune>
3. Save and repeat steps 1-2 for Whonix-Workstation.
4. Start the VMs.
- The pvspinlock feature is reported to not be supported and the issue was resolved when edited out of the VM config.
forum discussion: Issues starting VM's in KVM. - blkio device weight is valid only for bfq or cfq scheduler
Arch/Ubuntu Users[edit]
See Request operation not valid: blkio device weight is valid only for bfq or cfq scheduler.
Reboot?[edit]
- Did you reboot after installing KVM?
- Did you reboot after adding users to groups?
Please add this information if making a support request.
Unable to connect to libvirt[edit]
If the following error appears.
Unable to connect to libvirt. Verify that the 'libvirtd' daemon is running. Libvirt URI is: qemu:///system
Make sure you added groups and rebooted.
Unable to open a connection to the libvirt management daemon[edit]
If the following error appears.
Unable to open a connection to the libvirt management daemon. Libvirt URI is: qemu:///system Verify that: - The 'libvirtd' daemon has been started
Check the KVM installation.
sudo service qemu-system-x86 restart ; echo $? ; sudo service libvirt-bin restart ; echo $? ; sudo service libvirt-guests restart ; echo $?
The output should show.
0 [ ok ] Restarting libvirt management daemon: /usr/sbin/libvirtd. 0 Running guests on default URI: no running guests. 0
In this case, it could be a permissions problem.
hda-duplex not supported in this QEMU binary[edit]
If this error appears you might be a member of the libvirt group, but lack membership of the kvm group.
In this case, it helps to change.
<sound model='ich6'>
To.
<sound model='ac97'>
process exited while connecting to monitor: ioctl(KVM_CREATE_VM) failed[edit]
If the following error appears.
Error starting domain: internal error: process exited while connecting to monitor: ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy failed to initialize KVM: Device or resource busy
Then it is not possible other non-KVM VMs (such as VirtualBox VMs) might already be running, since two concurrent hypervisor instances is not supported by KVM / VirtualBox.
error: unsupported configuration: spice graphics are not supported with this QEMU[edit]
https://forums.whonix.org/t/error-s-when-importing-vm-templates-kvm/19464
Permissions[edit]
ls -la /var/run/libvirt/libvirt-sock
VT-x / SVM Errors[edit]
*invalid argument: could not find capabilities for domaintype=kvm
*invalid argument: could not get preferred machine for /usr/bin/qemu-system-x86_64 type=kvm
These errors arise when the host's hardware virtualization extension is not available for KVM to use. The reasons are either/and/or:
- A) it is controlled by another hypervisor running on the system,
- B) an anti-virus suite or
- C) it is not present/enabled by the machine BIOS.
To check, go to your BIOS settings. For basic instructions, see: How to Change Computer BIOS Settings.
Then enable VT-x
. This is sometimes also called AMD-V
, virtualization
, SVM mode
or MIT
perhaps under Advanced Core
settings.
VT-x vs VT-d[edit]
VT-x
/AMD-V
: Is required, see above chapter.VT-d
/IOMMU
/AMD-Vi
: Whonix KVM does not require VT-d.
Add Version Numbers to Support Request[edit]
If problems are experienced, be sure to note what versions of libvirt-bin, qemu-kvm and virt-manager are in use as part of the support request. If you are using Debian, the following command will determine the software versions.
dpkg-query --show --showformat='${Package} ${Version} \n' libvirt-bin qemu-kvm virt-manager
Check Groups[edit]
Check the output of following command.
whoami
The output of the previous command is expected to be something like user
or your linux user account name. Should not be root
.
groups
The output of the previous command is expected to include the groups libvirt
and kvm
. [49] If that is not the case, make sure you added groups and rebooted.
Sound[edit]
No audio inside VM? Try unmute and increase volume.
https://forums.whonix.org/t/no-audio-in-whonix-kvm/17642
Support[edit]
Whonix KVM maintainer availability is mostly limited to User Help Forum.
Questions on telegram, matrix, IRC, reddit, incomplete list will most likely not get attention by Whonix KVM maintainer.
See also Support.
User Help Forum[edit]
Alternative Guides[edit]
For alternative installation guides contributed by community members, see: Minimalized Installation.
Known Issues[edit]
Host VPNs[edit]
- No Internet Connection inside Whonix-Workstation KVM with NordVPN with Kill-Switch on Host
- Failure to connect when VPN on host
Potential solution: -> #Development Help Wanted
- https://forums.whonix.org/t/help-welcome-kvm-development-staying-the-course/166/546
- KVM static internal networking without host bridge interface (virbr)
- QEMU/KVM feature request: Isolated network between VMs not visible to the host
Intel 3rd Gen CPUs[edit]
Performance is markedly degraded on 3rd generation Intel CPUs as reported by a user on the forums and confirmed and therefore should be avoided. [50]
Development[edit]
Development Help Wanted[edit]
- Using
hubport
to avoid KVM network interfaces being visible on the host operating system which would probably fix some Whonix KVM issues with host operating system firewalls and VPNs
Footnotes[edit]
- ↑ re-creation
- ↑ There are also Download other platforms.
- ↑ What is "security through obscurity":
The basis of STO has always been to run your system on a "need to know" basis. If a person doesn't know how to do something which could impact system security, then s/he isn't dangerous. ... Nowadays there is also a greater need for the ordinary user to know details of how your system works than ever before, and STO falls down a as a result. Many users today have advanced knowledge of how their operating system works, and because of their experience will be able to guess at the bits of knowledge that they didn't "need to know". This bypasses the whole basis of STO, and makes your security useless.
- ↑ https://forums.virtualbox.org/viewtopic.php?f=7&t=89395
- ↑ Rationale for Change from Default Password changeme to Empty Default Password
- ↑ Otherwise the sudo password is required every time virtual-manager is started.
- ↑
By default Debian does not use
sudo
, so groups can be added withusermod
. If your user isfoo
the following commands will work. usermod -a -G libvirt foo And. usermod -a -G kvm foo - ↑ https://forums.whonix.org/t/kvm-networking-broken/644
- ↑ https://wiki.debian.org/KVM#Troubleshooting
- ↑ Manually converting images from .ova to .qcow2 is no longer recommended, since .qcow images can be downloaded from the Whonix project.
- ↑ As per build-steps.d/4400_convert-raw-to-qcow2 , these are "-o cluster_size=2M" and "-o preallocation=metadata".
- ↑ Because the same performance optimizations are present.
- ↑ https://forums.whonix.org/t/tar-child-xz-cannot-exec-no-such-file-or-directory-install-xz-utils-package/16708/7
- ↑ https://forums.whonix.org/t/cant-use-var-lib-libvirt-images-for-whonix-images-what-to-do-about-apparmor/7192/3
- ↑ https://forums.whonix.org/t/no-auto-resize-with-qxl-driver/7145/3
- ↑ The command line can also be used to make sure the VM has been shut down.
- ↑ https://dustymabe.com/2012/04/21/send-magic-sysrq-to-a-kvm-guest-using-virsh/
- ↑ https://forums.whonix.org/t/safer-dhcp-implementation-resolved/7499/7
- ↑
https://wiki.libvirt.org/page/Libvirtd_and_dnsmasq:
On linux host servers, libvirtd uses dnsmasq to service the virtual networks, such as the default network. A new instance of dnsmasq is started for each virtual network, only accessible to guests in that specific network.
- ↑
Dnsmasq is visible to a nmap scan from the Workstation but not much else. Manual test: sent a DNS request with this result:
dig microsoft.com @10.152.152.0 ; <<>> DiG 9.11.5-P4-3-Debian <<>> microsoft.com @10.152.152.0 ;; global options: +cmd ;; connection timed out; no servers could be reached
- ↑ https://fabianlee.org/2018/10/22/kvm-using-dnsmasq-for-libvirt-dns-resolution/
- ↑ https://www.cyberciti.biz/faq/linux-kvm-libvirt-dnsmasq-dhcp-static-ip-address-configuration-for-guest-os/
- ↑
https://unix.stackexchange.com/questions/256061/is-libvirt-dnsmasq-exposed-to-the-network-if-i-run-fedora-without-a-firewall:
So I can see an open TCP port. However it responds as if it’s “tcpwrapped”. That implies if you connect over a different interface from virbr0 , dnsmasq closes the connection without reading any data. So data you send to it doesn’t matter; it can’t e.g. exploit a classic buffer overflow.
- ↑ https://serverfault.com/questions/840163/custom-dnsmasq-or-custom-options-with-libvrt
- ↑ https://serverfault.com/questions/434064/correct-way-to-move-kvm-vm/648871#648871
- ↑ https://wiki.debian.org/Mesa#A3D_acceleration
- ↑ The file sharing mode mapped is just an example, using squash or passthrough is possible by selecting them from the drop down menu. Mapped is recommended for security.
- ↑ https://nts.strzibny.name/how-to-set-up-shared-folders-in-virt-manager/
- ↑ https://unix.stackexchange.com/questions/60799/selinux-interfering-with-host-guest-file-sharing-using-kvm
- ↑ https://bugzilla.redhat.com/show_bug.cgi?id=1135488
- ↑ https://askubuntu.com/questions/564708/qemu-kvm-virt-manager-passthrough-of-usb-webcam-to-windows-7-enterprise-creates
- ↑ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765016
- ↑ https://salsa.debian.org/libvirt-team/virt-manager/-/commit/d81fd3c3af1abde1fa0e2bf3b79643f36836f45b
- ↑ https://docs.gtk.org/gio/
- ↑ https://gymnasmata.wordpress.com/2010/12/02/setting-up-gdb-to-work-with-qemu-kvm-via-libvirt/
- ↑ https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/virtualization_administration_guide/sect-virtualization-adding_storage_devices_to_guests-adding_hard_drives_and_other_block_devices_to_a_guest
- ↑ https://github.com/fog/fog/issues/2525
- ↑ https://news.ycombinator.com/item?id=6983097
- ↑ https://arxiv.org/pdf/1507.06955v1.pdf
- ↑ https://www.whonix.org/pipermail/whonix-devel/2016-September/000746.html
- ↑ Dedup Est Machina: Memory Deduplication as an Advanced Exploitation Vector
- ↑ https://web.archive.org/web/20130210040731/https://staff.aist.go.jp/c.artho/papers/EuroSec2011-suzaki.pdf
- ↑ Flip Feng Shui: Hammering a Needle in the Software Stack
- ↑ https://archive.ph/aB7Kg
- ↑ https://mjg59.dreamwidth.org/55638.html
- ↑ https://docs.openstack.org/security-guide/compute/hardening-the-virtualization-layers.html#physical-hardware-pci-passthrough
- ↑ https://forums.whonix.org/t/desktop-renders-slowly-despite-high-resource-spec/19727/18
- ↑ https://forums.whonix.org/t/problem-starting-whonix-14-after-upgrade-unable-to-write-to-sys-fs-cgroup-blkio-machine-slice-machine-qemu/6999/5
- ↑
For example, if one was to use
su
orsudo su
(i.e. doing it asroot
) before runningsudo addgroup "$(whoami)" libvirt
andsudo addgroup "$(whoami)" kvm
that would not work. That is because when executing commands under userroot
,$(whoami)
will outputroot
, notuser
. Hence not add the user to the required groups. - ↑ https://forums.whonix.org/t/poor-performance/13385/6
We believe security software like Whonix needs to remain open source and independent. Would you help sustain and grow the project? Learn more about our 12 year success story and maybe DONATE!