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.

https://www.monero.how/tutorial-how-to-mine-monero

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 https://github.com/hyc/cpuminer-multi
cd cpuminer-multi
./autogen.sh
CFLAGS="-march=native" ./configure
make
sudo ./minerd -a cryptonight -o stratum+tcp://pool.minexmr.com:4444 -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.

THANKS

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

1 Like

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…

1 Like

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.

That’s a quite innovative idea!

The way this can be done is rougly as follows:

  1. QubesOS would have a public XMR donation address (something like, 4afjLKJA18941…)
  2. Users would install xmrig on one of their AppVMs (they can build from source)
  3. Users would install pinodeXMR software solution for running a Monero-node in one of single board computers at home (like raspberry pi)
  4. Users, within QubesOS XMRig AppVM, would point their xmrig miners to their monero-node p2pool, and provide the miner payout address as the QubesOS project monero donation address!

@qubesuser69 nowadays, you can easily mine using MoneroGUI Wallet. Moreover, they recently included the option to mine on MoneroGUI Wallet using p2pool, which is a decentralized mining pool within monero network, that really helps with hashrate decentralization.

So, I would encourage you to try to install the MoneroGUI Wallet and give p2pool a spin!

1 Like