How To Create VM on Azure to Mine Bitcoin/Litecoin in 10 Minutes or Less

You probably have heard of Bitcoin by now, some say this will be the future our financial transactions. We will see if that’s true or not in years to come. That said, Bitcoin might be hard to grasp on at first, it’s a form of crypto-currency that acts as a currency only live digitally on the internet. This isn’t a guide on understanding what Bitcoin is, but rather a step-by-step guide on how to spin off a virtual machine on your own to start mining Bitcoins. The setup only works for mining on a shared pool, and is what most people out there are doing those days. If you ever hoping to mine some Bitcoins shared pool is your best bet. For a standard desktop CPU to mine a single Bitcoin, according to the calculation some did, it would need 100 years to mine one single Bitcoin.

Step One: Spin Off Virtual Machine on Azure

First go login to Microsoft Azure, they offer free trail if you don’t have a paid plan. We will be using Ubuntu as the base image to run this program called cpuminer.

2015-11-11_2027

Click “All Resources” > Type “Ubuntu” Pick Ubuntu Server 15.04 or 14.04 both are ok.

2015-11-11_2028

Click Create, this will proceed and you will need to give a hostname, user name and password. Remember the user name and password as that’s your root user to use to SSH login to the server.

2015-11-11_2030

Step Two: Install Dependencies and Compile cpuminer

Use a tool such as Putty to SSH into the server with the credential and IP from above. Run the command below. First two command make sure your Ubuntu system are up to date. Next, it will grab all the dependencies that cpuminer requires in order to compile and run. After that, you will checkout the source code of cpuminer and compile.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git build-essential libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm
git clone https://github.com/pooler/cpuminer.git
cd cpuminer
./autogen.sh
./configure CFLAGS="-O3"
make
./minerd --url=your.minerpool.org --user=username --pass=password -a sha256d

The last command is the most important, you need to replace the “your.minerpool.org” part to something that usually starts with stratum+tcp:// follow with your shared pool URL and your username and password. Make sure you add –a sha256d in the end if you are mining a shared Bitcoin pool. This is the Bitcoin hash algorithm are in, and by default cpuminer is using Litecoin’s hash algorithm. So if you don’t add that you will be wasting time mining. Your program will never be able to solve any hashes and tractions, and you will never rewarded for the effort.

If you don’t have a shared pool to mine, or don’t know where you should start. There is a list of comparisons of shared pools take a look before start mining !

2015-11-10_1739

When you started the mining process, you should expect to see something similar above. If you see any accepted n/n khash/s (yay!!!) that means you are doing it right. You should expect to see rewards from your shared pool whenever you scoring a hash.

Jonathan Hu

Programming by day, Web Development, Canucks & Movies for spare time!
Co-founder of Next of Windows and a cool geek 🙂

Last updated: 11/12/2015

Posted in: How to , Virtualization
Discover more: , ,