This script sets up the xmrig
mining software to run as a service on a Windows machine. The primary function is to ease the installation process of the miner and configure it to run in the background as a service, which can be beneficial for system administrators or researchers working with the xmrig
software.
This script is developed for educational and research purposes only. It is intended to demonstrate how to run an application (in this case, the xmrig
mining software) as a service on a Windows machine.
By using this code, you agree to the following:
- You will not use this code, in whole or in part, for malicious intent, including but not limited to unauthorized mining on third-party systems.
- You will seek explicit permission from any and all system owners before running or deploying this code.
- You understand the implications of running mining software on hardware, including the potential for increased wear and power consumption.
- The creator of this script cannot and will not be held responsible for any damages, repercussions, or any negative outcomes that result from using this script.
If you do not agree to these terms, please do not use or distribute this code.
- Powershell with Administrator rights
- Internet connection (to download required files)
- xmrig miner - xmrig/xmrig: RandomX, KawPow, CryptoNight and GhostRider unified CPU/GPU miner and RandomX benchmark (github.com)
- NSSM - NSSM - the Non-Sucking Service Manager
- Create a FTP Server in a Docker container and add
xmrig.exe
,config.json
, andnssm.exe
to the FTP Server
- Administrator Check: The script begins by ensuring that it is run with Administrator rights.
- Cleanup: If there are previous installations of
xmrig
or related files in the specified paths, they are removed. - Download: Files essential for the miner to function, like
xmrig.exe
,config.json
, andnssm.exe
, are downloaded from the specified FTP server. - Setup: The downloaded files are moved to their appropriate directories.
- Service Creation: Using
nssm
, the script sets upxmrig
as a service that runs in the background and starts automatically on system startup. - Logging: The script configures the service to write its logs to a specified file.
- Cleanup: Finally, the script file itself is deleted as a cleanup step.
- Modify the FTP server URLs in the script to point to your actual server containing the
xmrig
,config.json
, andnssm.exe
files. - Run the script with Administrator rights.