XMRig on Ubuntu 18.04

Tomas Savenas
2 min readMar 3, 2019

--

I wanted to show how I build XMRrig mining software from source code on Ubuntu 18.0.4 operating system. I assume that the first step is done [1]. To build and compile XMRig software I need to install dependencies below:

sudo apt install -y build-essential cmake libuv1-dev libmicrohttpd-dev libssl-dev libhwloc-dev

Then I need to download XMRig source code from Github repository [2]. If nothing else is needed then I can build and compile it.

git clone https://github.com/xmrig/xmrig.git
cd xmrig
mkdir build
cd build
cmake ..
make -j $(nproc)

If you would like to know how to increase mining by 30%, please check my other post [7]

The latest version of “Xmrig” file is ready, and it should be working with the most recent hard fork upgrade.
Configuration file config.json is on their github repo [3]. Just need to change wallet and pool addresses.

To remove everything I can delete xmrig folder with source code.

rm -fR xmrig/

Also, you may be interested in my recent posts: Monero full node upgrade [4] or how I build and compiled XMRig on Windows 10 [5]
Additionally, for GPU (“Xmrig-AMD” or “Xmrig-Nvidia”) versions the build instruction is the same. You may be interested in how to install drivers for AMD or NVIDIA on Ubuntu [6]
One more thing, If you have strict firewall rules, for instance, blocking all domains with xmr like donate.ssl.xmrig.com.

Then need to change values in file xmrig/src/donate.h before compiling the source code:

From:

constexpr const int kDefaultDonateLevel = 5;
constexpr const int kMinimumDonateLevel = 1;

To:

constexpr const int kDefaultDonateLevel = 0;
constexpr const int kMinimumDonateLevel = 0;

I encourage to donate xmrig developers by sending a transaction them directly:

XMR: 48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoDBTC: 1P7ujsXeX7GxQwHNnJsRMgAdNkFZmNVqJT
Photo by Shane McLendon on Unsplash

Reference

#1 https://medium.com/@tomas_savenas/all-great-things-start-from-installing-ubuntu-9500873fec82
#2 https://github.com/xmrig/
#3 https://raw.githubusercontent.com/xmrig/xmrig/master/src/config.json
#4 https://medium.com/@tomas_savenas/monero-software-upgrade-boron-butterfly-9b33c96df8a3
#5 https://medium.com/@tomas_savenas/its-time-to-upgrade-my-monero-miners-eb6acdc04f1a
#6 https://medium.com/@tomas_savenas/installing-nvidia-and-amd-gpu-driver-on-linux-server-4f1f1d4360d
#7 https://medium.com/@tomas_savenas/30-increase-in-cpu-mining-hash-rate-by-enabling-huge-pages-8af5eedb7d62

--

--

Tomas Savenas
Tomas Savenas

Written by Tomas Savenas

Kibernetinio saugumo entuziastas; Aktyviausias Lietuvis TryHackMe platformoje; Inovacijų valdymo ir Antreprenerystės Magistrantas @ KTU