November 11, 2017

1519 words 8 mins read

How to mine Ether in Linux Ubuntu Server 16.04

The following instructions assumes that you already have a ETH Wallet ID and that your GPU card’s model is AMD RX580, if you use other OS or GPU then you need to adjust that properly by verifying package names and the correct drivers for the graphics card.

1. Get the system ready

Update the system to make sure we run the latest stable kernel, and in general is a good practice to have our system packages up to date. We also install the byobu session manager so we can keep running our miner even when we’re not connected to the server, you could also use screen but I like the additional info that byobu gives in the status line.

$ sudo apt-get update && sudo apt-get -y upgrade
$ sudo apt-get install byobu && byobu-enable
$ sudo reboot

2. Download required software

Is better to download this files directly to the miner machine but doing that with the command line is not so easy, you’ll need megatools to make that happen. I think is easier to download these files to your computer and then copying them over ssh to the miner PC.

How to copy the files to the miner machine?

Option A - Copy them with a USB Flash Drive

Of course for this option you actually need physical access to the miner machine, once you have the USB flash drive connected to the miner machine you look for the files either in /mnt or /media directories and from them you just copy them over with the cp command.

If in the case the USB contents doesn’t show up in the given routes then you need to mount the flash drive, for this we need to know the device pointing to the USB.

$ lsblk

This will list the available devices, look for your USB drive I usually identify it by the size column. In my case the device is /dev/sdb1 (you want to use the one with the number in the name), we mount it like this:

$ sudo mount /dev/sdb1 /mnt

Now you should be able to see the USB flash drive contents in the /mnt folder and copy them to the miner machine. When you’re finished you unmount the flash drive like this:

$ sudo umount /mnt

Then you can unplug the flash drive safely.

Option B - Copy them with SCP Secure Copy utility

In the PC where you downloaded the files open up a bash terminal (on windows I suppose you can use the git shell) and use the scp command to copy them from your PC to the miner PC. The basic usage is like this:

$ scp <file to copy> <remote user>@<remote host>:<remote destination path>

Example:

$ scp amdgpu-pro-17.40-492261.tar.xz [email protected]:/home/mrminer/

Note the last / in the destination path, this is to indicate that we want to save the file in that folder.

3. Install the AMD GPU Pro Linux Driver

This is one of the files you downloaded in the previous steep. First extract the contents and then install:

$ tar xvJf amdgpu-pro-17.40-492261.tar.xz
$ cd amdgpu-pro-17.40-492261
$ ./amdgpu-pro-install

You will be asked for your password, after the installation finishes reboot the computer.

$ sudo reboot

4. Generate your mining configuration

Every mining pool has a guide in how to set up mining with them, I’m using nanopool.org, go to their site and in the Ethereum box click on Quick Start and then click on Generate your config, a form will appear and you must fill it according to your setup, here is mine as an example:

  • OS: Linux
  • GPU Vendor: AMD
  • Worker name: rig1
  • Email: [email protected]
  • Main server: US West
  • First algorithm: Ethereum
  • First algorithm address: 0x05a2c8a8cfcfb2b7d9bcae5f5024b294f1bd0061
  • Second algorithm: None

You want to select the nearest server to your location, to see what is the nearest server simply ping them from the miner, one by one and see which one gives the lowest latency in ms. The addresses to these pool servers are in the epools.txt file that you will download next.

When ready click on Generate your configuration will be contained in a .zip file. Extract this and then copy the contents to the miner PC (refer to the 2nd steep) or if you copied the claymore_config_nanopool.zip then you can extract it with the unzip utility like this:

$ sudo apt-get install unzip
$ unzip <.zip file path> -d <destination path>

Example:

$ unzip claymore_config_nanopool.zip -d .

The . (dot) makes reference to the current folder.

5. Decompress Claymore Dual Miner

In the second step you downloaded the file Claymore's Dual Ethereum+Decred_Siacoin_Lbry_Pascal AMD+NVIDIA GPU Miner v10.1 - LINUX.tar.gz and you have already copied it to the miner machine, now we must decompress this .tar.gz file.

The name of the file contains spaces, when refering to the file name this can give trouble, you’ll need to precede all spaces with \, you can use TAB when typing the filename to complete it automatically.

$ tar xvzf Claymore\'s\ Dual\ Ethereum+Decred_Siacoin_Lbry_Pascal\ AMD+NVIDIA\ GPU\ Miner\ v10.1\ -\ LINUX.tar.gz

This generates a folder called Claymore\'s\ Dual\ Ethereum+Decred_Siacoin_Lbry_Pascal\ AMD+NVIDIA\ GPU\ Miner\ v10.1\ -\ LINUX, to avoid the spaces let’s rename this folder to remove this inconvenience:

mv Claymore\'s\ Dual\ Ethereum+Decred_Siacoin_Lbry_Pascal\ AMD+NVIDIA\ GPU\ Miner\ v10.1\ -\ LINUX/ ClaymoreDualEthereum-GPU-Miner-v10.1-LINUX

Now the folder is called ClaymoreDualEthereum-GPU-Miner-v10.1-LINUX, we need to copy the two files we extracted earlier in step 4 and put them inside this Claymore folder.

$ cp epools.txt ClaymoreDualEthereum-GPU-Miner-v10.1-LINUX/
$ cp start.bash ClaymoreDualEthereum-GPU-Miner-v10.1-LINUX/

6. Verify miner configuration

We need to see the contents of start.bash file:

$ cat ClaymoreDualEthereum-GPU-Miner-v10.1-LINUX/start.bash

We need to check that the last line in the file contains the flag -ewal and has our ETH Wallet ID correctly set: 0x05a2c8a8cfcfb2b7d9bcae5f5024b294f1bd0061 because if this isn’t our wallet then we’ll be mining for someone else. We should also see our email [email protected] and the name rig1 in there.

Example:

-ewal 0x05a2c8a8cfcfb2b7d9bcae5f5024b294f1bd0061.rig1/[email protected]

7. Start mining

Enter to claymore folder, give execution permissions and start mining like this:

$ cd ClaymoreDualEthereum-GPU-Miner-v10.1-LINUX/
$ chmod +x start.bash
$ ./start.bash

That’s if, if all went well you’ll start to see the magic happen.

FAQ

I got an error about libcurl

Not a question but, probably you need to install libcurl3:

$ sudo apt-get install libcurl3

After this if you run the miner again everything should work fine.

I see “GPU not found” on claymore’s output

If you get an error about no GPU found, most likely you’re missing your graphics card drivers, or you did not install them correctly, make sure you did step 3 correctly and you didn’t forgot to reboot the computer.

But how do I get a ETH Wallet ID?

The easiest way is to go to myetherwallet.com and follow the wizard to create your ETH Wallet, you will need to chose a password and download the key store file, then you will be given a private key and a PDF file with your wallet ID in it. Just remember the ETH Wallet ID always starts with 0x that is the one you want. Needless to say, keep the private key secure and never share it, same with the key store file, if someone sees them you’ll be robbed and if you lose them you won’t be able to claim your ETH.

How can I see stats about my mining progress?

Typically your mining pool will give you instructions on how to do this, in the terminal you can get simple statistics by pressing s or for example in nanopool.org you click in Overview then use the search box to look for your ETH Wallet ID, you’ll be shown a page containing your stats.

I’ve been mining for some hours but I haven’t received any ETH

Every mining pool has its rules, in the case of nanopool.org the payout will happen when your shares account for 0.2 ETH, you can increase the payout frequency if you change the threshold to 0.05 ETH this can be done by clicking on Settings in your stats page but only after you have at least 10 shares. If want to change the payout do it as soon as possible because changing this setting will reset your score and shares to 0. Another note is that if your miner stops for more than 48 hours then your accumulated balance will be lost, so if you want to stop mining is better to wait until the payout happens. You can see if you’ve been paid by looking for transactions to your wallet in Etherscan.io.

How to monitor the mining process?

You’ll receive an email to the address you used when the miner disconnects, so you can configure a filter in your inbox so you get notified as top priority when these messages arrive. Otherwise I suggest login frequently to the mining to check it keeps working.