Linux Litecoin Mining Set-up So you’ve decided to use Linux to run your mining rig—a fine choice! If you’re still a bit nervous because you’ve a complete Linux newbie, don’t be. Simply follow the step-by-step instructions exactly as they’re written, and you’ll be fine. Even if you’ve never done anything like this before, you should be up and running in about an hour. Step 1: Configure BIOS settings Before we even get to Linux, make sure your mining computer’s BIOS settings are in order. Power on your computer, and press the “delete” key a few times immediately after power on. You should end up in the BIOS configuration area. Do the following, then save & exit: Change power options so that the computer automatically turns itself on whenever power is restored. The reason for this is two-fold: first, it’ll make sure that your miner automatically starts up after a power outage. Second, it makes powering the computer on much easier if you don’t happen to have a power switch connected to the motherboard. Make sure that your USB stick is first in the boot-up order (you may need to have a USB stick attached). Disable all components that you don’t plan to use. This will save a little bit of power, and since your miner will likely be running 24/7, it’ll add up. For me, that meant disabling onboard audio, the SATA controller, the USB 3.0 ports (I only had a 2.0 USB stick), the Firewire port, and the serial port. Step 2: Install Xubuntu Desktop to your USB stick Xubuntu is a lightweight version of Ubuntu, a popular Linux distribution. Most other distros should work just fine, but be aware that the GPU drivers require the presence of Xorg, which means server distros that don’t have a GUI will not work properly. Download the Xubuntu Desktop x64 v12.10 installation image. You’ll need to either burn the installation image onto a CD, or write the image to a second USB stick. If you use a CD, you’ll need to temporarily hook up a CD-ROM drive to your mining rig for the installation (make sure you temporarily enable your SATA controller if you disabled it in step 1!). Once you have the installation media prepared, you’re ready to install Xubuntu to the blank USB stick on your miner. Make sure your blank USB stick is inserted into a USB port on your mining, and then boot into your installation media. The Xubuntu installer should appear. Make sure to click the “auto-login” box towards the end of the installer; otherwise take all of the default installation options. If you’re using a USB stick that is exactly 8GB, the installer may complain about the default partition sizes being too small. Create a new partition table with these settings: 5500mb for root (/), 315mb for swap, and the remaining amount for home (/home). If you’re using a USB stick larger than 8GB, you will not have to do this. When the installation is complete, you should automatically boot into the Xubuntu desktop. Make sure to remove your installation media. Step 3: Install AMD Catalyst drivers Open a terminal session by mousing over the bottom center of the screen so that a list of icons appears. Click on “terminal” (it looks like a black box). Type the following commands (press “enter” at the end of each line and wait for Linux to finish doing it’s thing): sudo apt-get install fglrx-updates fglrx-amdcccle-updates fglrx-updates-dev sudo aticonfig --lsa sudo aticonfig --adapter=all --initial sudo reboot After your computer reboots, you can verify that everything worked by typing: sudo aticonfig --adapter=all --odgt If you see all of your GPUs listed, with “hardware monitoring enabled” next to each, you’re good to go. Important: you may need to have something plugged into each GPU to prevent the OS from idling it. You can plug 3 monitors into your 3 GPUs, but that isn’t very practical. The easiest option is to create 3 dummy plugs, and leave them attached to your GPUs. They’ll “trick” the OS into believing that a monitor is attached, which will prevent the hardware from being idled. Check out how to create your own dummy plugs. If you ever add or remove GPUs to your rig later, you’ll need to re-run this command: sudo aticonfig --adapter=all --initial Step 4: Install SSH, Curl, and package updates Install SSH by typing: sudo apt-get install openssh-server byobu With SSH installed, you can unplug the keyboard/mouse/monitor (put dummy plugs into all GPUs, though) from your miner, and complete the rest of the installation from your desktop computer. Simply download Putty onto your desktop, run it, and enter the IP address of your mining rig. That should bring up a remote terminal session to your miner, which is more or less just like sitting at the keyboard in front of it. If you plan to manage your mining rig remotely over the internet, you’ll need to forward port 22 on your router to your miner. Make sure that you use a strong Xubuntu password! Setup should be quicker from this point, as now you can simply copy text from this webpage (highlight it and press control-C) and then paste it into your Putty session by simply right-clicking anywhere inside the Putty window. Neat, eh? Install Curl and package updates by typing (or copying & pasting into Putty) the following commands: sudo apt-get install curl sudo apt-get update sudo apt-get upgrade Step 5: Install cgminer Cgminer is the mining software we’ll be using. If the first command doesn’t work, you’ll need to check out the cgminer website and make a note of the current release version. Substitute that in the commands below. Update: Cgminer 3.7.2 is the last version to support scrypt—do not use any version after that! In addition, depending on which version you choose to use, you may receive an error complaining about libudev.so.1 when you try to run cgminer—you can find the fix for that here. Type the following: wget http://ck.kolivas.org/apps/cgminer/2.11/cgminer-2.11.4-x86_64-built.tar.bz2 tar jxvf cgminer-2.11.4-x86_64-built.tar.bz2 If everything was uncompressed successfully, we can delete the downloaded archive; we don’t need it anymore: rm *.bz2 Now check if cgminer detects all of your GPUs properly: cd cgminer-2.11.4-x86_64-built export DISPLAY=:0 export GPU_USE_SYNC_OBJECTS=1 ./cgminer -n Step 6: Create cgminer startup script We’re almost done—now we just need to create a few simple scripts to control cgminer. If you’re still in the cgminer directory from the previous step, first return to your home directory: cd .. Type the following to create a new file with nano, a Linux text editor: sudo nano mine_litecoins.sh Type the following into nano (note where the places you need to substitute your own usernames!) : #!/bin/sh export DISPLAY=:0 export GPU_MAX_ALLOC_PERCENT=100 export GPU_USE_SYNC_OBJECTS=1 cd /home/YOUR_XUBUNTU_USERNAME/cgminer-2.11.4-x86_64-built ./cgminer --scrypt -I 19 --thread-concurrency 21712 -o stratum+tcp://coinotron.com:3334 -u USERNAME -p PASSWORD Save the file and quit nano, then enter the following: sudo chmod +x mine_litecoins.sh Note that the cgminer settings we’re using in our mine_litecoins.sh script correspond to a good starting point for Radeon 7950 series GPUs. If you followed our hardware guide, these settings will give you good hashrates. If you’re using another type of GPU, you’ll want to use Google to find optimal cgminer settings for it. Also note that you’ll need to create an account at one of the litecoin mining pools, and plug your username and password into the script (the -u and -p parameters). I have Coinotron in there as an example, but there are quite a few to choose from.