Complete Guide To Mine Bitcoin on Xubuntu 12.04
-- by Leonard Huang (lueotw@gmail.com)
-- Latest version could be found on http://goo.gl/vP3G9
-- If you think this article is useful to you, please make a donation to:
1M1mB5BQX5QthTojfHxXxJQJr8ro5xLcKR
Firstly, I’d like to thank Kanoi, who wrote an excellent howto guide on “How to setup a cgminer using xubuntu 11.04 live on a USB”. However, I don’t need to mine on a USB (it’s slow compared to a HDD). Also, his guide didn’t update with the latest version of Xubuntu (12.04), which in my opinion is the easiest version of Xubuntu ever to mine bitcoin with. Although it’s relatively easy, there are still some pitfalls I want to you to avoid, so I wrote this guide.
I had been mining Bitcoin since July, 2011. I had used Windows 7 for mining until May, 2012. The reason I use Windows 7 is as the following:
I had tried to switch to a headless Linux solution but failed, due to the following problems:
I decided to give Xubuntu 12.04 a try, since I’ve heard that 12.04 is not only getting Long-Term-Support, but also fixing various bugs since 11.04 and 11.10.
The result is amazingly great! My machines never crash anymore!
Enough for my experience. Let’s move on.
Table of Content
Pre-stage - Installation Media
Install Bitcoin 0.6.2 on Xubuntu (optional)
The first thing you need is a USB to load Xubuntu in (Yap, a USB is still essential to get rid of CD-ROMs).
Then, download Unetbootin to load your Xubuntu CD image on the USB.
Now you’re ready to roll!
Try follow this article: “The Perfect Desktop - Xubuntu 12.04” until you get a working desktop.
Remember to check “Log in automatically” when you create a superuser.
We’ll need a logged user to mine headlessly.
Oh! You forget to check the option?
That’s all right, you can edit the /etc/lightdm/lightdm.conf like this after installation.
[SeatDefaults]
autologin-guest=false
autologin-user=<your username>
autologin-user-timeout=0
autologin-session=lightdm-autologin
greeter-session=lightdm-gtk-greeter
user-session=xubuntu
Caution: Choose your driver wisely, or you’ll lose 10% ~ 20% hash power!
Now follow the steps (in commandline):
(Don’t use the GUI (Settings -> Additional drivers) to install the post-release driver. It will fail and I don’t know why[a][b][c].)
Done!
[ For AMD Radeon 6xxx, 5xxx Series ]
Now follow the steps[2].
Install the prerequisite packages:
If you are using the x86_64 architecture (64 bit):
Compile and install the driver:
Done!
Check if all your cards can be detected and then write configuration to /etc/X11/xorg.conf.
If everything went fine, reboot the computer by “sudo reboot”.
After that, check if everything works:
Install openssh-server and byobu to perform remote login.
Now you can pull out the cables of your monitor, mouse and keyboard and enjoy a headless Xubuntu!
Go to CGMINER on bitcointalk page and download the latest version of cgminer.
Or on the command line:
Then unzip it to a directory.
Note: If you got libcurl4 error, install the lib:
Go to the directory and check if cgminer detects all your cards.
The correct result should show like the left diagram..
Note that both the OpenCL and the ADL detects 4 devices. | Note that the ADL can’t be initialized. (you forgot to set export GPU_USE_SYNC_OBJECTS=1) |
Write a script for your favorite mining pool:
#!/bin/sh
export DISPLAY=:0
export GPU_USE_SYNC_OBJECTS=1
cd /home/<yourhome>/cgminer-2.9.5-x86_64-built
./cgminer -o http://<mining_pool>:<port> -u <username> -p <password> --api-listen --api-network -I 9 --gpu-reorder --auto-fan --gpu-powertune 20 --gpu-engine 920,920,920,1125 --gpu-memclock 795,795,795,975
#!/bin/sh
export DISPLAY=:0
export GPU_USE_SYNC_OBJECTS=1
cd /home/<yourhome>/cgminer-2.9.5-x86_64-built
./cgminer -o http://<mining_pool>:<port> -u <username> -p <password> --api-listen --api-network -I 8 -g 2 --gpu-reorder --auto-fan --gpu-powertune 20 --gpu-engine 920,920,920,1125 --gpu-memclock 795,795,795,975
Save it as a file and change the permission to execute it.
You now have a headess bitcoin mining machine! Just SSH to your machine with byobu and execute you script.
You can safely press “F6” and exit since your mining session will be kept in byobu.
-- If you think this article is useful to you, please make a donation to:
1M1mB5BQX5QthTojfHxXxJQJr8ro5xLcKR
If you want to setup a private p2pool:
https://bitcointalk.org/index.php?topic=62842.0
If you don’t waste your time on setting up p2pool, you can test on my p2pool node:
username: <Bitcoin Address you want to receive payment>
password: <any letter would be ok>
If you want to buy or exchange Bitcoin with the following currency company, you can use my affiliate link of AurumXchange. It is the official partner of Mt. Gox to transfer Bitcoin to LibertyReserve.
If you want to run bitcoin daemon on your Xubuntu system, open your terminal and install packages by typing the following commands[3]:
Now you have the latest version of bitcoind installed. Pretty easy, right?
-- If you think this article is useful to you, please make a donation to:
1M1mB5BQX5QthTojfHxXxJQJr8ro5xLcKR
[1] Complete Table of the relationship between Catalyst and APP SDK could be found on AMD website
[2] Thanks for the instruction on Unofficial Wiki for the AMD Linux Driver
[3] Follow the instruction of an excellent answer on AskUbuntu
[a]I'm going to try to make this work under mint linux...It should be the same....
[b]_Marked as resolved_
[c]Why not