Bitcoin Forum
June 15, 2024, 01:48:22 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: - GUIDE - Minimalist Ubuntu Headless Mining Server - NVidia  (Read 2777 times)
Cfox (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
June 08, 2013, 08:02:08 PM
 #1

Im using:

Ubuntu Server 12.04 - Raring Ringtail - 64 bits
NVidia GTX 460

This step by step tutorial will help you to setup a dedicated miner for any crypto currency you want, including bitcoin, litecoin, etc.
I will help you installing and configuring a automated, secure, stable and minimalist rig.
I have only an old NVidia card on my homeserver, but this can easily adapted for an AMD/ATI card.
I assume you are able to install a basic Ubuntu Server and understand basic linux commands.
You can use any Ubuntu flavor you want, including Lubuntu, Kubuntu and Ubuntu Desktop. I choose Ubuntu Server to keep things simple and save machine resources.

1. Setting up CGMiner (believe me, easiest to install/use and most powerfull so far):

1.1 Solving Dependencies:
Code:
$ sudo aptitude install libopencl1 nvidia-current-updates

1.2 Fix a broken dependency. Will become obsolete on next CGMiner stable release.
Code:
$ wget https://launchpad.net/ubuntu/+source/udev/175-0ubuntu19/+build/4325788/+files/libudev0_175-0ubuntu19_amd64.deb
$ sudo dpkg -i libudev0_175-0ubuntu19_amd64.deb

1.3 Preparing your home directory:
Code:
$ cd ~
$ mkdir cgminer
$ cd cgminer

1.4 Downloading and uncompressing it (precompiled latest stable version):
Code:
$ wget http://ck.kolivas.org/apps/cgminer/3.1/cgminer-3.1.1-x86_64-built.tar.bz2

1.5 Uncompressing file:
Code:
$ tar -vxjf cgminer-3.1.1-x86_64-built.tar.bz2

1.6 Entering its directory:
Code:
$ cd cgminer-3.1.1-x86_64-built/

1.7 Open your browser an choose a pool, like bitcoin.cz or deepbit.net, and create and account, with login and password.

2 Running CGMiner:
-> Tricky stuff:
Nvidia card needs to be "initialized" in order to be detected by OpenCL and CGMiner. Do this by running $ nvidia-smi once  per restart.
Code:
$ nvidia-smi
$ ./cgminer -o SERVER.ADDRESS:SERVER.PORT -u USERNAME -p USERPASS

Happy mining!

3 Advanced Stuff:
For those who want an automated mining rig, lets start to flourish things a little.

3.1 Editing /etc/rc.local
Change and paste this lines accordingly:
Code:
$ sudo nano /etc/rc.local
# By default this script does nothing.

# Activating video card
nvidia-smi &

# Starting mining script
sudo -u USERNAME /home/USERNAME/cgminer/miner.sh &

exit 0

3.2 And make it executable:
Code:
$ sudo chmod +x /etc/rc.local

3.3 Now lets go back to your homedir and create a mining script:
Code:
$ cd ~/cgminer
$ nano miner.sh
#!/bin/bash
# Mining script
cd /home/USERNAME/cgminer/cgminer-3.1.1-x86_64-built/
screen -dm /home/USERNAME/cgminer/cgminer-3.1.1-x86_64-built/cgminer -o SERVER.ADDRESS:SERVER.PORT -u USERNAME -p USERPASS

# EOF

3.4 And make it executable:
Code:
$ sudo chmod +x miner.sh

Done!

Final Instructions - How to manage it:

Now, everytime you want to check out mining status, login on your box and do a:
Code:
$ screen -r
and you are able to keep it running smoothly.

Use CTRL + A and them D to detach from screen program, and keep it running undisturbed.

Check status of your video board by doing an
Code:
$ nvidia-smi
sometimes.

Now you have an simple, linux-based, robust, stable and reliable mining.

4 Bonus Stuff:

Setting up OpenSSH (Optional, you can login locally text-mode).
If you didnt choose SSH Server on setup, this is how you do it:

4.1 Installing OpenSSH:
Code:
$ sudo aptitude install openssh-server

4.2 Configuring OpenSSH Server, if needed. Standalone servers dont need this:
Code:
$ sudo nano /etc/ssh/sshd_config

4.3 Allow SSH Server and enable firewall:
Code:
$ sudo ufw allow OpenSSH
$ sudo ufw enable

I hope you find this useful.

If you found this guide useful, please, send me a little tip. Any small amounts helps Smiley
Bitcoin: 1BCRTbSPGsMSEWjDK7EoU1gjtq7WXqACGP
Litecoin: Lez82VVBSnDGNasQnJtuPxG7koyMi3kiJ3

Thank you.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!