[HOME] [DOWNLOAD] [DOCS] [BLOG] [SUPPORT] [TIPS] [ISSUES] [Priority Support]

KVM configuring


#1

Hello there I’am having difficulties with KVM.

Virtualbox is easy but according to Whonix KVM should be used, so I’am trying but read the below.

I was getting the error “virbr0” already existed, then I deleted it via the GUI.

Now when I want to start the following things:

virsh -c qemu:///system net-autostart default
virsh -c qemu:///system net-start default
virsh -c qemu:///system net-autostart Whonix
virsh -c qemu:///system net-start Whoni

I get errors like this:

“error: failed to get network 'default”
"error: Network not found: no network with matching name ‘default’

The only that changes in the error is the matching name.

What might the solution be?


#2

For some reason your distro does not ship the default network with the libvirt package.

<network>
  <name>default</name>
  <bridge name="virbr0"/>
  <forward mode="nat"/>
  <ip address="192.168.122.1" netmask="255.255.255.0">
    <dhcp>
      <range start="192.168.122.2" end="192.168.122.254"/>
    </dhcp>
  </ip>
</network>

Save above codeblock as default.xml in home directory.

sudo virsh net-define default.xml
sudo virsh net-start default
sudo virsh net-autostart default


#3

I have made the default.xml.

I’m using LDME as OS.

Executing sudo virsh net-define default.xml gives:

error: Failed to define network from default.xml
error: operation failed: network ‘default’ already exists with uuid 72c1159a-727c-41e6-9c1d-d165b8240821

Executing sudo virsh net-start default gives:

error: Failed to start network default
error: Unable to create bridge virbr0: File exists

Executing sudo virsh net-autostart default gives:

Network default marked as autostarted

KVM is hard to configure, would like it to run the correct way.

Can it be done?

Thanks.


#4

Looking around I found this is likely a bug in the libvirt package (you have). There is nothing on a simple level you can do to fix this besides updating and hoping this fixes it.

On another note I recommend running Debian instead of a derivative because its tested and working for me and many others. Linux Mint is notorious for its very poor security practices (they don’t believe in security advisories) and very delayed patching cycle.


#5

Installed Debian again and followed your advise. Everything almost went smooth.

Downloaded current version of Whonix and went on with the online KVM manual.

Then I want to start the VM’s in the VMM but it says that the guest is not running. This I don’t understand. All other steps provided were OK.

Below is the error I get when trying to run the Whonix VM with the VMM after following the correct procedure.

Error starting domain: Requested operation is not valid: network ‘Whonix’ is not active

Traceback (most recent call last):
File “/usr/share/virt-manager/virtManager/asyncjob.py”, line 91, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File “/usr/share/virt-manager/virtManager/asyncjob.py”, line 127, in tmpcb
callback(*args, **kwargs)
File “/usr/share/virt-manager/virtManager/domain.py”, line 1355, in startup
self._backend.create()
File “/usr/lib/python2.7/dist-packages/libvirt.py”, line 999, in create
if ret == -1: raise libvirtError (‘virDomainCreate() failed’, dom=self)
libvirtError: Requested operation is not valid: network ‘Whonix’ is not active


#6

virtual Machine manager program then go to Edit -> Connection Details -> Virtual Networks. Then check to see what the network ‘Whonix’ is up to. Its probably not enabled so select it and press the play button at the bootom left and tell me what you see. Also mark it to autostart so you don’t repeat this every startup.


#7

I got the VM’s running with help of the GUI. The problem now is that Tor wont run in WhonixGateway. It says that I have to report this as a bug.

As virtual network interface I have chosen the Whonix isolated network.
The virtual machines have 1GB memory and 2 processors each.
All files were checked for integrity and authenticity.

Workstation says that I have to run Whonixcheck on Gateway.
Everytime when I start Gateway it says “A start job is running for LSB: basic network interfaces” This takes about 1 minute. (When I use ‘Nat’ as network then I don’t get this)
When I go to Gateway it says that I have to run Whonixsetup.
When I run Whonixsetup in Gateway it says that I have to enable Tor.

I go to Torrc and remove the ‘#’ it, I enter also the command sudo service tor@default restart but still Tor wont turn on.

I go to Arm Tor and it says “Tor disconnected, press r to reconnect”. Pressing ‘r’ of course doesn’t work.

Somehow in the Torrc file the Disablenetwork gets the ‘#’ reassigned the whole time?

I made a file etc/whonix.d/50_whonixcheck_user.conf containing “whonixcheck_skip_functions+=” check_network_interfaces " because eth0 wasnt working.

Then I tried whonixcheck, now it says "Tor Pid Check Result: Tor not running. (tor_pid_messages: Pid file /var/run/tor/tor.pid does not exist.)
I go to terminal and enter ‘Whonicheck’ it says I have to “restart Tor”.
So I enter once again ‘sudo service tor@default restart’
Then I get the error Job for tor@default.service failed See ‘Systemctl status tor@default.service’ and journalctl -xn’ for details.
Looking in the journalctl gives no results.
Looking in the systemctl it gives the result: 'tor@default.service - Anonymizing overlay network for TCP: failed.

KVM seems to be not working optimal in comparison to VB. It freezes a lot and when something goes wrong it also eats the qcow2 files.

Any tips?


#8

Ok I’ll assume you didn’t switch or add any new interfaces? (Spoiler: you shouldn’t) :slight_smile:

Right. Please do these steps to complete initializing Whonix.

This tells me you messed with the networks connected to each VM which is not recommended. All I told you to do is to flip the Whonix network on. Without the default nat network attached to the Whonix Gateway you have no connection to the internet.

Been using it for years and never experienced what you describe. Nonetheless you should use what works for you.


#9

Clean installed Debian Jessie, verified all files everything OK and searched for updates.

Configured nothing else but the steps provided by Whonix online.

Started Whonix Gateway and Workstation got following errors:

Error starting domain: Cannot access storage file ‘/var/lib/libvirt/images/Whonix-Gateway.qcow2’ (as uid:117, gid:127): No such file or directory

Error starting domain: Cannot access storage file ‘/var/lib/libvirt/images/Whonix-Workstation.qcow2’ (as uid:117, gid:127): No such file or directory

These files are where they belong so I actually don’t understand the error?

I again imported the VM’s and started them and got the same error as last time. Tor isn’t started.

Can someone give any tips on this issue?

HulaHoop can you give specifications of your distro and which versions of the required programs you use? Maybe your setup is better.


#10

Debian testing latest packages


#11

Are you running a non standard setup that involves encrypted volumes? (why did you leave this out?) Because looking up the errors you mention I found a support thread with identical ones. Try this fix by the user here:

If that doesn’t work, I won’t be able to help becuase its not a setup I plan on doing.

I recommend enabling LINUX’S LUKS FDE solution instead of going thru the pain of something like this.


#12

Don’t use encryted volumes. Don’t use Veracrypt.


#13

Unfortunately I have no solutions to suggest.


#14

I use stable version. Will test KVM with the testing.