Headless ZCash Mining Rig
This past spring I built a computer with 6-GPUs attached to it to mine cryptocurrencies, i.e. a “mining rig”. I intended this computer to be “headless”, or to run without a connected monitor, mouse, or keyboard to save electricity. I eventually decided that it would be most profitable for me to mine ZCash (a.k.a ZEC), and so this post will explain how I did that.
Materials
Here is a list of all of the parts I had to buy, along with links to the pages that I bought them from.
Computer:
- GPU - GTX 1070 8GB, x6 - $2,400.00
- PSU - 1300W Gold Fully Modular - $240.00
- MOBO - Intel Z170A - $110.00
- USB/GPU Riser Cables, x6 - $65.00
- CPU - Intel Celeron G3900 dual core 2.80 GHz - $55.00
- DISC - 120 GB SATA3 SSD - $60.00
- RAM - 4GB Single DDR4 2133 MT/s - $30.00
- BOOT - 32GB USB 3.0 Flash Drive - $16.00
- DVI to DVI cable (for monitor) - $9.00
- HDMI display emulator - $8.40
- Monitor (Craigslist) - $10.00
- Mouse (Craiglist) - $5.00
- Keyboard (Craigslist) - $10.00
- Internet access
- Router
- Ethernet cable
Case:
- 1/16” x 1” angled aluminum - 3x 8ft pieces - $16.20
- 3/4” x 3.5 pvc plank - 1x 8ft plank - $13.48
- #8x1/2” self tapping sheet metal screws - $6.50
- Cabinet plastic protector dots/pads/bumpers - $2.00
Other:
- Surge protector - $23.00
- Kilowatt meter - $19.00
- Box fan (Target) - $17.00
- Smoke detector (Lowes) - $14.00
- 3-prong Extension Cord (Craigslist) - $10.00
- Flame-resistant (plastic/metal) table (Craigstlist) - $25.00
The grand total for everything came to $3,113.70. I already owned a few things, e.g. a mouse, a smoke detector, PVC boards, which reduced the costs above.
Aside from the actual rig components, you’ll also probably need:
- a hack-saw to cut the aluminum angles
- a drill with a screwdriver attachment to assemble the frame
- sandpaper to remove the rough edges of the aluminum (60 to 120 coarseness)
- a saw to cut the PVC board (I used a circular saw)
I roughly followed the instructions in this video to construct the frame and mount/connect the hardware. It’s still probably a good place to start, though I did have to install an additional support beam because my graphics cards were too heavy and were bending the frame.
Setup
Though the rig is going to mine in a “headless” state – and so won’t have a display, keyboard, or mouse to waste any additional electricity – you will still need a monitor, keyboard, and mouse for the initial setup (as seen in the photo above). Plug those in now.
Unplug any GPUs you have connected to the motherboard.
Turn the power on. To do this, you’ll initially need to short the pins on your motherboard’s power switch header with a flat-head screwdriver. (I short pins 6 and 8 on this picture. Look in your motherboard manual to determine which pins you need to connect.) You might need to hold the screwdriver against the pins for a couple seconds before it turns on. You’ll only need to do this once. From here on, you can just use the on/off switch on the power supply unit (PSU) to start/stop the computer.
The computer should boot into BIOS because it doesn’t have an operating system installed yet. Once that happens, configure BIOS to automatically boot when it receives power, then shut the computer down. Download the latest version of BIOS for your motherboard onto your USB on another computer. Plug in the USB and reboot your mining rig. Follow the instructions on screen to update your BIOS. Once the update completes, power down the rig.
Connect a single graphics card to the motherboard via one of your riser cables, and plug the monitor into the GPU via the DVI-D cable, or an HDMI cable, if possible. Turn the computer on and it will once again open into BIOS. In BIOS settings:
- enable UEFI/Legacy boot (rather than just UEFI boot)
- change boot order to boot from USB first (not the “UEFI USB” option)
Power off.
On another computer, install Ubuntu 16.04 onto a USB drive. I used these instructions.
Plug your ubuntu USB drive into a USB port on the rig’s motherboard, then turn the rig back on. The rig should open to the Ubuntu install screen. Follow the instructions, selecting “auto login” without a password.
Once the install has you reboot, reopen BIOs by hitting F11 (or whatever you are prompted with) and change the boot order in BIOS to be 1st UEFI SSD. Then reboot. You can now remove your USB and plug in your remaining GPUs.
Once Ubuntu boots up and you see the desktop, modify the following system settings:
- turn off screen lock
- never turn screen off when inactive
- do not require password when waking from suspend
- security and privacy
- disable error reports
Next open a terminal and run the following:
Since this is Ubuntu, we won’t have access to the EVGA overclocking program that most people use on windows. Here’s how to get around the limitation:
Save the config file you just edited and reboot.
At this point you’re pretty much ready to start mining. You’ll probably want to choose a mining pool to contribute your hashing power to. I like flypool, as it does not charge transaction fees, consistently earns block rewards, and doesn’t require any account setup. Just point your miner at their servers and start getting paid!
The last step is to download the mining software and start running it. I used EWBF’s ZCash miner for linux, which you can read about here and download here. Unzip the file to your home directory.
Here’s the shell script that I use to run the miner.
If you’ve done things correctly, you can now start the miner with:
And you should be able to tail the process with:
The log should look something like the following:
If it does, congratulations! You’re mining.
Going Headless
At this point, shut the machine off. Unplug the monitor, keyboard, and mouse, and plug in the HDMI emulator into one of the GPUs. Turn the mining rig back on.
SSH into the mining rig from another computer using your sudo password and the IP you found earlier.
Once you have shell access to the mining rig, start a tmux session. I usually split the pane vertically, running the mining process in one pane and tailing the mining log in the other. When you are done looking at the log, simply detatch from tmux and logout from the rig.
Your miner is now headless! You can start, stop, shutdown, and restart the miner from your laptop over SSH. This is very convenient.
Other Notes
The miner generates a good bit of heat. For this reason, I keep it in the coolest place I can (a basement) and have a box fan blowing on it on high at all times. I also take special precaution to keep it away from anything that could catch fire, and have installed a smoke detector directly above it and a thermal motion sensor attached to an alarm pointed at it 24/7. I haven’t had any issues. But I’d rather be safe than sorry!
Two sites that I use to calculate profitability are:
- http://whattomine.com/
- https://www.crypto-coinz.net/crypto-calculator/
I check these roughly once a month to confirm that ZEC is still roughly paying the best for my hardware.
If I did it all over again, I’d probably opt for higher-end GPUs (1080 TI’s) and simply buy fewer of them. I could have probably achieved comparable hash rates with three 1080TI’s, saved money on a smaller PSU, and cut my electric bill in half along the way.
The entire setup currently draws approximately 1020W continuously at the wall – according to my kilowatt meter. My effective cost of electricity is $0.12/kWhr. So it costs me 12 cents to run the rig each hour, and $2.88 to run per day – about $88 per month. It’s not cheap. But on good months the rig generates between $500 and $800 in income with zero work required from me. Even factoring electricity into the equation, the hardware paid for itself within 5 months.
UPDATE: I’ve now switched to this miner: https://bitcointalk.org/index.php?topic=2021765.0 which is under active development
Did this article help you out? Donations welcome:
- ZEC - t1MgGnXQz62fcYDhbRzYVzsA1MmWi8acw22
- ETH - 0x8470309D2A9447De1F0f75850D9FA64cE11bA462
- BTC - 1JEkNAvX8in4mMu94hizTfBkLYEueGedom
- BCH - 1NiPvxKcmUyMSpt47acQD5H2yeKFJo6wNw