How do I remove my old Whonix install?

trying to install whonix KVM fresh, when I had one already.

when I do:
sudo virsh -c qemu:///system net-define Whonix_external_network-17.0.3.0.xml

I get:
error: operation failed: network ‘Whonix-External’ already exists with uuid [then #s]

How do I remove my old Whonix install?

In VMM you can go to Edit → Connection Details → Virtual Networks, stop, and remove the network(s).

Through CLI:

sudo virsh net-destroy Whonix-Internal
sudo virsh net-destroy Whonix-External

To remove everything else (if not doing it in VMM) you can do:

sudo virsh undefine Whonix-Workstation --remove-all-storage
sudo virsh undefine Whonix-Gateway --remove-all-storage
1 Like

thanks for your time. however, doing:

sudo virsh undefine Whonix-Workstation --remove-all-storage

gets:

error: failed to get domain 'Whonix-Workstation'

I removed it from the VMM GUI.

& even did:

sudo virsh net-destroy Whonix-Internal

which removed it.

yet:

sudo virsh -c qemu:///system net-define Whonix_external_network-17.0.3.0.xml

still gets:

error: operation failed: network 'Whonix-External' already exists with

Is the network still in the VMM GUI (top menu, Edit, Connection Details)? And did you try with sudo virsh net-destroy Whonix-External? (Emphasis on External)

1 Like

Ok from playing around in GUI, I realized it was like cancelled or inactivated and not actually deleted.

Now its fully deleted and I ran all the virsh commands, and it linked all the xml files without errors.

It appears in the KVM GUI, but when launched says this, even though the qcow2 files are there.

Error starting domain: Cannot access storage file '/var/lib/libvirt/images/Whonix-Gateway.qcow2' (as uid:[number], gid:[number]): No such file or directory

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1279, in startup
    self._backend.create()
  File "/usr/lib/python3/dist-packages/libvirt.py", line 1234, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: Cannot access storage file '/var/lib/libvirt/images/Whonix-Gateway.qcow2' (as uid:[number], gid:[number]): No such file or directory

When you download the .qcow2 images, their full names will include the version.

Do sudo ls -la /var/lib/libvirt/images | grep 'Whonix' to confirm.

If the names do include the versions, rename them by:
cd /var/lib/libvirt/images
sudo mv Whonix-Gateway*.qcow2 Whonix-Gateway.qcow2
sudo mv Whonix-Workstation*.qcow2 Whonix-Workstation.qcow2

If the filenames are already in the proper format, could you post the output of the ls -la command? Mainly who is the owner.

1 Like

It was missing the name before:

drwx--x--x 2 root         root         4096 Apr 21 00:19 .
drwxr-xr-x 7 root         root         4096 Apr 21 00:39 ..
-rwxrwxrwx 1 n            n             172 Oct 20  2015 Whonix_external_network-17.0.3.0.xml
-rwxrwxrwx 1 n            n    107389386752 Oct 20  2015 Whonix-Gateway-Xfce-17.0.3.0.Intel_AMD64.qcow2
-rwxrwxrwx 1 n            n            2346 Oct 20  2015 Whonix-Gateway-Xfce-17.0.3.0.xml
-rwxrwxrwx 1 n            n              97 Oct 20  2015 Whonix_internal_network-17.0.3.0.xml
-rwxrwxrwx 1 n            n    107389386752 Oct 20  2015 Whonix-Workstation-Xfce-17.0.3.0.Intel_AMD64.qcow2
-rwxrwxrwx 1 n            n            2332 Oct 20  2015 Whonix-Workstation-Xfce-17.0.3.0.xml
-rw-rw-r-- 1 n            n      1335206288 Apr 20 10:17 Whonix-Xfce-17.0.3.0.Intel_AMD64.qcow2.libvirt.xz

When I do the move command, it can’t find it.
sudo mv Whonix-Gateway*.qcow2 Whonix-Gateway.qcow2

Gets:

mv: cannot stat 'Whonix-Gateway*.qcow2': No such file or directory

So I manually renamed it in the GUI file manager,

-rwxrwxrwx 1 n            n             172 Oct 20  2015 Whonix_external_network-17.0.3.0.xml
-rwxrwxrwx 1 n            n    107389386752 Oct 20  2015 Whonix-Gateway.qcow2
-rwxrwxrwx 1 n            n            2346 Oct 20  2015 Whonix-Gateway-Xfce-17.0.3.0.xml
-rwxrwxrwx 1 n            n              97 Oct 20  2015 Whonix_internal_network-17.0.3.0.xml
-rwxrwxrwx 1 n            n    107389386752 Oct 20  2015 Whonix-Workstation.qcow2
-rwxrwxrwx 1 n            n            2332 Oct 20  2015 Whonix-Workstation-Xfce-17.0.3.0.xml
-rw-rw-r-- 1 n            n      1335206288 Apr 20 10:17 Whonix-Xfce-17.0.3.0.Intel_AMD64.qcow2.libvirt.xz

Then when I try to start it in the GUI,

Error starting domain: Requested operation is not valid: blkio device weight is valid only for bfq or cfq scheduler

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1279, in startup
    self._backend.create()
  File "/usr/lib/python3/dist-packages/libvirt.py", line 1234, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: Requested operation is not valid: blkio device weight is valid only for bfq or cfq scheduler

Maybe different issue, see wiki: Request operation not valid: blkio device weight is valid only for bfq or cfq scheduler

Note: I am not a maintainer of Whonix KVM.

1 Like

Thanks so much! That worked! You guys are my heroes.
Last time USB passthrough worked, but this time I can’t find step 1 here:

“Controller USB device model”?

  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)