This blog is NOT OFFICIAL website of Kali Linux. We just share Tutorials to learn Cybersecurity.

How to Mine Monero on Linux Easily in 5 Minutes

Home

Cryptocurrencies are rising in reputation. These are digital or digital currencies which are decentralized and can be utilized to commerce or spend utilizing blockchain expertise. Lots of them are aimed to boost privateness and anonymity, though their success different. A couple of of those currencies permit public viewing of all transactions, whereas others make privateness non-obligatory. And nonetheless, others maintain the privateness characteristic strictly implicit.

When most of us consider cryptocurrencies, Bitcoin is often the primary one which involves thoughts. It was one of many first of its form, utilizing peer-to-peer expertise to permit customers to make funds with their cash. However there's one other foreign money that has achieved a excessive stage of recognition and acceptance, primarily for its privacy-oriented options. This one is named Monero. This text explains the important thing ideas, options, and challenges of Monero or XMR.

Mining Monero on Linux very easily in 5 minutes

In short, Monero is more privacy-oriented crypto than Bitcoin, so it has very bright future. We are going to mine Monero (XMR) from our Linux system. In this article we are going to use Kali Linux but our this method will work on any Debian based Linux distributions like Ubuntu, Linux Mint, ElementaryOS etc.

We know to mine Cryptocurrencies we need have a mining rig that contains lots of GPU's. But in the case of mining Monero we can mine it from our daily using computers or even from laptops. Yes Monero can be mined from CPU. Obviously one or more GPU will give us more mining hash speed but we can easily do it from CPU.

Let we start mining Monero on our Linux system, First of all we need to update our system by using following command:

sudo apt update

After the updating process is complete, we need to install Monero wallet on our Linux system.

Installing Monero Wallet

Before starting mining Monero we need to have a wallet for Monero. Wallet will save our mined Monero by using our Monero address. We don't need to follow this steps if we already have a Monero address (Almost every exchanges will provide a address). We can also skip this step if we have Monero wallets on our mobile. MyMonero wallet app is available on Web, Linux, Google Play Store.

First of all we need to go to the website where Monero developers provide us easy graphical based XMR (Monero) based wallet. First we need to go here. Then we need to download the Linux 64bit package by clicking there. Shown in the following screenshot:

Monero wallet download

A compressed file with almost 120MB size will be download in our Downloads folder. Then we need to open our terminal window and type following command to change our directory to Downloads directory.

cd Downloads

Now we need to type following command to extract downloaded compressed file:

tar -xvf monero-gui-linux*.tar.bz2

Now we need to go inside our extracted folder by using following command:

cd monero-gui-v*

We entered on the folder here we can see the list of files by using ls command, as shown in the following screenshot:

monero wallet downloaded

On the above screenshot we can see monero-wallet-gui.AppImage file. We need to execute this file by using following command:

./monero-wallet-gui.AppImage

Then the GUI of the wallet app will come in front of us as shown in the following screenshot:

monero wallet setup on Linux

Here it asks do we want to register, we click on 'Yes'. Then It will ask for choosing the language.

choosing language on monero wallet

After choosing the language we need to choose the installation type. For being a easy method we are going with easy mode, by clicking on 'Simple Mode'.

monero wallet simple mode
After choosing 'Simple mode' we need to tick ✅ on 'Privacy implications' then click on 'Next'. Shown on screenshot below.
monero wallet privacy policy understanding
After that we got the Welcome menu. From here we can create a new Monero wallet, by clicking on 'Create a new wallet'.
monero create new wallet

After clicking the new wallet. We a window as shown in the following screenshot:

Monero wallet creation

Here we need to set our wallet name and wallet location. After that we get a 'Mnemonic seed'. This mnemonic seed is nothing but some random words, but we need this if we want to backup or restore our wallet. This will be treated as password recovery. We need to note down it (digitally or in a physical notepad) and keep it secret.

Then we need to click on 'Next'.

Monero wallet choose password

Here we need to choose a strong password for our wallet. Then we need to click on 'Next'.

monero wallet finishing setup

Here we can check and finish our setup by clicking on 'Create wallet'. After that we need to provide our password for wallet and our Monero or XMR wallet will open in front of us, as shown in the following screenshot:

XMR monero wallet

Here we need to go to the 'Receive' option. After we in the receive we can see the QR code for our wallet. We can also see some options to copy our Monero XMR address. On the following screenshot we have highlighted the points from where we can copy our address.

copy monero wallet address

So, we got our Monero (XMR) wallet and a receiving address for XMR. Now if we already have an wallet address (Some wallets like this are available on mobile application stores like MyMonero or exchanges provide us receiving address) then we can skip the above steps.

Installing XMR Mining Tool on Linux

Mining from a mining poll is the easiest way for beginners. Pools charges 1% or 2% as fee but it is completely fine because it becomes so easier than solo mining. Let we first download the mining tool then we learn about the pool.

For pool mining there is awesome tool called xmr-stak. Before download and set this up we install all the requirements for it by applying following command:

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

After installing these packages we need to go to the release page of xmr-stak.

After a little bit of scrolling we got the download options for Linux as shown in the following screenshot:

monero mine xmr-stak download page

By clicking on above highlighted area we can download the compressed file on our Downloads directory.

After downloading we need to compress the file from command line or we just right click and choose 'Extarct Here'.

extarcting xmr-stak for monero mining

After clicking on it it will be uncompressed and a folder will appear on our this directory.

After extracting that we can see a new extracted folder on the directory as shown in the following screenshot:

xmr-stack download and extract folder

Inside the folder we can see a file an executable file. To execute this file we need to open our terminal here by right clicking on blank space, as we can see in the following screenshot:

opening terminal on inside a directory

After that a terminal window will open in front of us.

opened terminal on xmr-stak

We are done here. Now we need to start the mining here. As we told previously that we need a mining pool. Let we find a mining pool then we can start mining by using a single command.

Finding Monero Mining Pool

This is going to be very easy. First of all we need to search for mining pools for XMR or Monero on Google. There are some top XMR mining pools like nanopool minexmr supportxmr etc.

We are not promoting any of these services, for an example we choose minexmr. We can choose any other mining pools. We should check the hash rate of the server and the minimum payout (MineXMR will pay us when we reach on 0.0004 XMR).

On the mining guide of MineXMR pool we can find a list of mining pool servers and port numbers as we can see in the following screenshot:

MineXMR mining pools

We need to choose a server that is close to our location. If we are in Canada then we should Canada (East Coast) server. We can choose any server but closer server will provide us a very good hash rate. For our current location we are choosing Singapore server that will be closest to us and we should choose the standard port i.e. 4444 for every server.

Mine Monero (XMR) on Linux

After selecting the server we can get back to our terminal window where we left, and to start the Monero mine we just need to run following command on our terminal.

./xmr-stak-rx --currency monero -o <pool-server>:4444 -u <our wallet addres>

By the above command we just need to put our mining pool server and our wallet address. So in our case our command will be as following:

./xmr-stak-rx --currency monero -o sg.minexmr.com:4444 -u 41kyXcRHG7QUK9qdfszY5sXNVXLS2TGcXZzdpdz8FFpc5SXhG1oNaYXJi9jdHtqKcX1uXz7GdfF6XT7UYXriTf2m4K7PtR9

After applying the above command xmr-stak will ask if we want to use simple setup we need to press Y for yes. Then it prompt for configuration txt file and we need to just press the Enter ⤶ key. Then it also prompt for password we must leave the password blank and press Enter ⤶ key.

Then our mining process will be start as we can see in the following screenshot. But it may take a minute to start the mining process. New blocks and difficulty will detect. We may get outputs like "MEMORY ALLOC FAILED: mmap with HUGETLB failed, attempting without it (you should fix your kernel)", but that is completely fine we need wait some time.

Monero XMR mining started form Kali Linux

After the mining starts we can see output like following screenshot:

Monero mining staretd on Kali Linux
Here we can press 'H' on keyboard to see the hash rate and we can press 'R' for reports, also 'C' to check the connection.

xmr-stak hash rate and report of monero mining

CPU and GPU Uses and Changing

xmr-stak automatically detect cores of our processor and our GPU and use them. If we need any modification like we don't want to use all the cores of our processor or if we we don't want to our CPU and use our GPU only.

In such cases we need to go the extracted xmr-stak directory. Now we can see some files here, as we can see in the following screenshot:

xmr-stak configuration files

We can check how we can modify these configurations here.

Now on MineXMR website we can check our mining job's progress and withdraw our cryptocurrency.

On the MineXMR Dashboard we need to paste our Monero wallet address to see our mining status.

MineXMR monero mining dashboard
On the above screenshot we can see our statistics of mining. We can see our hashrate, balance and pool hashrate here. Many more data will show here.

On the payment section we can see that we have 0.000237 XMR we can set a threshold when the threshold completed Monero will be sent on our wallet address or we can manually Payout it on our provided address after reaching 0.004 XMR.

Extra Tip

Sometimes we need to mine for a long time. That time our system might got very hot. Hot means not sexy here. High temperature might damage our system. We need to monitor our system's temperature always. T do that we open another terminal alongside the mining terminal and type following command to download packages for temperature:

sudo apt install hddtemp lm-sensors

Then we need to type following command to check our system temperature in every 2 seconds:

watch -n 2 sensors

We can place this terminal on a side of mining terminal tht we can check both terminals same time.

Mining Monero with temperature

On the smaller terminal we can see the temperatures of our every processors (Core 0 is first core and Core 3 is the fourth core). We can also see high and critical temperatures also here.

Conclusion

This is how we can mine Monero or XMR on our Linux system. We have checked this also on a low processor (i5 3rd Gen) Dual-Core CPU without GPU it is working perfectly, but hash rate is low. High hash rate will increase our mining speed.

Love our articles ?

Make sure to follow our free email subscription to get all our articles directly on inbox. We are also available on Twitter and GitHub, we post article updates there.

To join our family, join our Telegram Group. We are trying to build a community for Linux and Cybersecurity.

For anything we always happy to help everyone on the comment section. As we know our comment section is always open to everyone. We read each and every comment and we always reply.

author-img
Kali Linux

Comments

9 comments
Post a Comment
  • Palgaurav photo
    PalgauravMay 2, 2021 at 4:11 PM

    bro i want to a extend version of this thing like i have 1 pc only for mining but if i can send someone a torojan or somthing like that to some victims so if they download that torojan their pc will start mining for me is their any way to do such thing i think its possible can you research on it if you know then make a tutorial

    Delete Comment
    • Kali Linux photo
      Kali LinuxMay 3, 2021 at 11:29 AM

      Yes, this is possible and already present in the world. This is called "Cryptojacking", search about it on internet. This is totally illegal, that's why we are avoiding this topic. But for sure we will write an article for awareness.

      Delete Comment
    • Young Dylan photo
      Young DylanOctober 12, 2021 at 8:30 AM

      mine is not working
      it wrote this........
      2021-10-12 03:50:55] : Your CPU doesn't support hardware AES. Don't expect high hashrates.
      [2021-10-12 03:50:55] : MEMORY ALLOC FAILED: mmap with HUGETLB failed, attempting without it (you should fix your kernel)
      [2021-10-12 03:50:55] : MEMORY ALLOC FAILED: mmap with HUGETLB failed, attempting without it (you should fix your kernel)
      [2021-10-12 03:50:55] : MEMORY ALLOC FAILED: mmap with HUGETLB failed, attempting without it (you should fix your kernel)
      [2021-10-12 03:50:55] : MEMORY ALLOC FAILED: mmap with HUGETLB failed, attempting without it (you should fix your kernel)
      [2021-10-12 03:50:55] : MEMORY ALLOC FAILED: mmap with HUGETLB failed, attempting without it (you should fix your kernel)
      [2021-10-12 03:50:55] : start self test for 'randomx' (can be disabled with the command line option '--noTest')
      Segmentation fault

      Delete Comment
      • Kali Linux photo
        Kali LinuxOctober 12, 2021 at 6:56 PM

        sudo nano /etc/sysctl.conf
        and then add
        vm.nr_hugepages=128
        to the bottom of the file. Your problem should solve. If not then please let us know. Thanks.

        Delete Comment
      • Young Dylan photo
        Young DylanOctober 17, 2021 at 8:33 PM

        Sudo nano /etc/sysctl.conf
        and then add
        vm.nr_hugepages=128
        to the bottom of the file. Your problem should solve. If not then please let us know. Thanks.




        How am I going to do this sir?
        Post a Comment

        Delete Comment
        • Kali Linux photo
          Kali LinuxOctober 18, 2021 at 12:20 PM

          First open your terminal on your Linux system then apply the fist command (sudo nano /etc/sysctl.conf) then press enter, it will prompt for your system root password. After then go to the bottom of the file paste the give line (vm.nr_hugepages=128) last of every line.

          Then save and close it by pressing CTRL+X > Y > Enter.

          Then restart your system it may work. I am not sure because in my system this error didn't came. But if you are not expert on Linux then you can mine XMR from your Windows system also. You can search on YouTube for that. Thanks

          Delete Comment
        • Young Dylan photo
          Young DylanOctober 20, 2021 at 6:17 AM

          still writing this..............


          2021-10-12 03:50:55] : Your CPU doesn't support hardware AES. Don't expect high hashrates.
          [2021-10-12 03:50:55] : MEMORY ALLOC FAILED: mmap with HUGETLB failed, attempting without it (you should fix your kernel)
          [2021-10-12 03:50:55] : MEMORY ALLOC FAILED: mmap with HUGETLB failed, attempting without it (you should fix your kernel)
          [2021-10-12 03:50:55] : MEMORY ALLOC FAILED: mmap with HUGETLB failed, attempting without it (you should fix your kernel)
          [2021-10-12 03:50:55] : MEMORY ALLOC FAILED: mmap with HUGETLB failed, attempting without it (you should fix your kernel)
          [2021-10-12 03:50:55] : MEMORY ALLOC FAILED: mmap with HUGETLB failed, attempting without it (you should fix your kernel)
          [2021-10-12 03:50:55] : start self test for 'randomx' (can be disabled with the command line option '--noTest')
          Segmentation fault




          Delete Comment
          • Kali Linux photo
            Kali LinuxOctober 20, 2021 at 11:36 AM

            I think that you need to tell your problem to the developer of XMR-stak, on there GitHub repository. You need to follow this link. Thanks. They may help in your problem.

            Delete Comment
          • AnonymousApril 1, 2024 at 10:29 AM

            it shows zsh: no such file or directory: /xmr-stak-rx broo after i run /xmr-stak-rx --currency monero -o :4444 -u i replaced evrything correctly

            Delete Comment
            google-playkhamsatmostaqltradent