How to mine on Linux

Navigation

This guide is adapted from /u/CryptoBadger ‘s guide. I will spin up a VM and verify all instructions instead of judging this with memory and theory. If the guide needs to be adapted, I will change it in the upcoming few days.

Prerequisites

  1. You have chosen a pool
  2. You have chosen a mining application (Claymore/Ethminer Ethminer support later, see below)
  3. You have an ethereum wallet
  4. You are using Ubuntu 16.04 LTS (Desktop or Server)
  5. Your OS sees all of your video cars

Setting up

  1. Install and Enable SSH by opening terminal and typing the following:
    • sudo apt-get update
    • sudo apt-get install openssh-server
    • From this point you can choose to either proceed on the local machine, or remotely on a Windows machine using PuTTY
  2. Create a new usergroup called video and append the current user to it by typing the following:
    • sudo usermod -a -G video $LOGNAME
    • sudo reboot

Installing AMD Drivers

If you plan to use an AMD card in your rig, you will need to install the AMD drivers

  1. Install the AMD drivers by typing the following:
    cd ~/Downloads
    wget --referer=http://support.amd.com https://www2.ati.com/drivers/linux/ubuntu/amdgpu-pro-17.10-414273.tar.xz
    tar -Jxvf amdgpu-pro-17.10-414273.tar.xz
    cd amdgpu-pro-17.10-414273
    ./amdgpu-pro-install -y
    

Installing Nvidia Drivers

If you plan to use an Nvidia card in your rig, you will need to install the Nvidia drivers

  1. Install the Nvidia drivers by typing the following:
    wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb
    sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
    sudo apt-get -y install software-properties-common
    sudo apt-get update
    sudo apt-get install git cmake libcrypto++-dev libleveldb-dev libjsoncpp-dev libjsonrpccpp-dev libboost-all-dev libgmp-dev libreadline-dev libcurl4-gnutls-dev ocl-icd-libopencl1 opencl-headers mesa-common-dev libmicrohttpd-dev build-essential cuda -y
    

Installing Ethminer

Ethminer requires compiling the executable. I will elaborate on this in a future change, for now, please use Claymore.

Installing Claymore

  1. Download v9.5 of Claymore and unpack it by typing the following
    • cd ~/Downloads
    • wget https://github.com/nanopool/Claymore-Dual-Miner/releases/download/v9.5/Claymore.s.Dual.Ethereum.Decred_Siacoin_Lbry_Pascal.AMD.NVIDIA.GPU.Miner.v9.5.-.LINUX.tar.gz
    • sudo mkdir /usr/local/claymore95
    • sudo tar -xvf Claymore.s.Dual.Ethereum.Decred_Siacoin_Lbry_Pascal.AMD.NVIDIA.GPU.Miner.v9.5.-.LINUX.tar.gz -C /usr/local/claymore95
  2. Create mining script
    • cd /usr/local/claymore95
    • sudo chmod u+s ethdcrminer64
    • sudo nano mine.sh
      • Nano (a text editor) will open a blank file, you can configure it by following the next step.

Configuring Claymore

  1. Paste the following into the new text file:#!/bin/shexport GPU_FORCE_64BIT_PTR=0export GPU_MAX_HEAP_SIZE=100export GPU_USE_SYNC_OBJECTS=1

    export GPU_MAX_ALLOC_PERCENT=100

    export GPU_SINGLE_ALLOC_PERCENT=100

    ./ethdcrminer64 -epool <Mining_Pool_Address> -ewal <Your_Ethereum_Wallet_Address>.<Friendly_Name_For_Computer> -epsw x -mode 1 -tt 68 -allpools 1

  2. Replace <Mining_Pool_Address> with the address of your mining pool
  3. Replace <Your_Ethereum_Wallet_Address> with your Ethereum wallet address
  4. Replace <Friendly_Name_For_Computer> with a name for your rig (e.g.: UbuntuMiner01)
  5. You will now need to exit out of Nano
    • Press CTRL+X
    • Type Y
    • Press Enter until you return to the bash promp
  6. Add executable permissions to the file
    • sudo chmod +x mine.sh

 

Configure auto-mine on startup

  1. Install Screen
    • sudo apt install screen
  2. Create a launcher script
    • cd ~
    • sudo nano minestart.sh
  3. In nano, you will need to paste the following (replace USERNAME with your Ubuntu username)#!/bin/bashDEFAULT_DELAY=0if [ "x$1" = "x" -o "x$1" = "xnone" ]; thenDELAY=$DEFAULT_DELAY

    else

    DELAY=$1

    fi

    sleep $DELAY

    cd /usr/local/claymore95

    su USERNAME -c "screen -dmS ethm ./mine.sh"

  4. You will now need to exit out of Nano
    • Press CTRL+X
    • Type Y
    • Press Enter until you return to the bash promp
  5. Add executable permissions to the file by typing the following:
    • sudo chmod +x minestart.sh
  6. Add minestart.sh to startup
    • Type the following:
      • sudo nano /etc/rc.localv
    • Find the line which reads exit 0 and type the following above that line (replace USERNAME with your Ubuntu username):
      • /home/USERNAME/minestart.sh 15 &

This is it! Try it out by navigating to cd cd /usr/local/claymore95 and running ./mine.sh

Navigation