How to Mine Monero/BTC?

Is there any documentation on how to link the existing wallets in Whonix to enable mining for Monero/BTC? If it works, would increasing the number of CPU’s in the VM running the mining software help?

I found this guide, but it fails on the first step when I try entering the comand in the Fedora-32 template I am using.

Mining Monero on Fedora 24 and above
Remember to replace WALLET_ADDRESS_HERE with your own Monero wallet's public address. The "-t 3" option determines how many of your CPU threads will be used for mining.

yum -y install git curl-devel libcurl glib-devel libtool
git clone
cd cpuminer-multi
CFLAGS="-march=native" ./configure
sudo ./minerd -a cryptonight -o stratum+tcp:// -u WALLET_ADDRESS_HERE -p x -t 3

Adding virtual cpus is unlikely to help much as you just get more context switching between vcpus. What matters is how many physical cores are dedicated to the miner application. In fact you are likely going to burn more electricity by mining with a generic cpu than you will ever gain in currency.

The best way to mine btc would be to use a GPU pass through thus dedicating that gpu hardware to the miner app. At that point you may or may not even break even. Most modern miners use very specialized hardware because the process has become much more inefficient. That inefficiency is by design. There is only a fixed number coins to mine, and the more that have already been mined the harder it becomes to generate even more.

If you just want to see how it all works then using a VPU is fine, but don’t expect to get rich doing it. Best of luck!

Fair enough, I will leave mining to the pros. I just thought it would be nice to have a VM mining on the side because my computer is always running.


Actually, Monero implemented RandomX specifically to avoid specialized hardware (ASICs). The best mining hardware available for it is current gen AMD CPUs. GPUs do not mine Monero.

If you want to solo mine (without a pool) you can definitely play around with it within the basic wallet software. The likelihood of mining a block solo will be low, but you might get lucky, and it’s fun to support the network anyway

I wonder what if qubes user can have it’s own pool of monero mining for supporting this project? so donating cpu idle time for 40% of computing power is not much…

The advice I have does not solve your problem, but is rather security advice for your Qubes usage:

Have you connected your template to the internet? That’s generally not advised.

Quoting from How to install software | Qubes OS :

Why don’t templates have network access?

In order to protect you from performing risky activites in templates, they do not have normal network access. Instead, templates use an updates proxy that allows you to install and update software without giving the template direct network access.

The updates proxy is what you use to proxy commands like git clone on a template instead of giving the full template network access.

Another point is that you are installing software directly from github without verifying it’s integrity. You should clone a template and use it exclusively for this job to avoid it possibly infecting other AppVMs based on it.

Yet another point is that general issues with installing software in a template are probably issues with the template distribution (fedora-33) and not with Qubes itself. So a fedora forum may be more adequate in those cases.