Jump to content
kimmo88

[Guide] 24/7 Bot using Google Cloud VPS - free for 2 months!

Recommended Posts

Here's a quick and dirty guide on how to run your bots 24/7 using Google Compute Engine (GCE). Google Cloud is giving free trial worth $300 credits to be used within 60 days.

Part 0: Some prerequisites:

  1. Google account.
  2. Valid credit card. (USD$1 will be charged for validation purposes.)

Part 1: Here are the registration steps:

  1. Go to https://cloud.google.com/compute/
  2. Click on the "Free Trial" blue button.
  3. Login using your google account.
  4. Fill in the form and give your credit card info.
  5. Once you are done, you can start to create a 'project'.

Part 2: Here are the steps to create a new VM:

  1. In your project, select 'Compute'->'Compute engine'->'VM instances' section in the left pane.
    • Spoiler
       

      G8MAJff.gif

       

  2. Click on the blue 'New Instance' to create a new VM.
    • Spoiler

      ZGUjcbL.gif

       

  3. In the 'create a new instance' section, fill in and select the following:

a. Name - put in any name you desire.

b. Zone - select default - 'us-central1-c' (Note: other zones cost more credits!)

c. Machine type - select n1-highcpu-2 (2 vcpus, 1.8 GB memory) (Note: this is sufficient to run the bot smoothly. Other options are overkill and also cost more credits!)

d. Image - select 'windows-server2012-r2-dc-v20150331'

e.    Username - any name you desire (do not use the same machine name as in step a! Failure to do so will not allow you to login to your server.)

f. Password - Click on 'create or reset Windows password' button in the console.Use the password to login to your Windows 2012 machine and then change to the password you desire.

g. External IP - select default - 'Ephemeral'

h. Click on 'create' once you are ready.

Part 3: Here are the steps to login and setup your VM:

  1. Click on your new VM to view the profile page.
  2. Click on 'Download the RDP' file to help you connect.
    • Spoiler

      kiS2mMm.gif

       

  3. Save the file into your PC desktop.
  4. Check the status of your VM creation via the Serial Console -> View output. Scroll all the way down to view this message. Please be patient as it may it up to 5-10mins for VM creation to complete:
    • Spoiler

      -->  SUCCESS: Attempted to run the scheduled task "GCEStartup".

      -------------------------------------------------------------

      Instance setup finished. VM is ready to use.

      -------------------------------------------------------------

      Starting ScriptManager

      Finished running startup scripts.

       

  5. You can now start a RDP session into your VM using the downloaded file.
  6. Once you are remotely in your new 'Windows server 2012 R2', do the following steps:
    • a. Go to the Server Manager window, select Local Server on the left menu and then disable the following:
      • Windows Firewall
      • Windows Update
      • IE Enhanced Security Configuration
    • b. Go to the Power Options to select Turn off Display to Never.
  7. You are now ready to transfer Bluestacks/AutoIt/MyBot files into the server. I use Teamviewer FTP function to do this transfer.

 

***Important - Install the latest version of Bluestacks available here: https://gamebot.org/forums/thread-2686.html

Part 4: Final steps for running the bot without interruptions when logging out of RDP:

  • For some strange reason, when you log-out of RDP, the bot stops running. A workaround to prevent this is to have a 'RDP over RDP' session. You can create an additional user ID in your server to do this. It should be something like this:
    • Spoiler

      W5Ny5id.gif

       

Detailed steps:

  1. From your own desktop, login to your server via RDP using original 'user1' credentials.
  2. In the remote server logging in as 'user1' - install and run your bot.
  3. In the remote server logging in as 'user1' - create a new user - 'user2'.
  4. Disconnect your RDP session logging in as 'user1'.
  5. From your own desktop, re-connect your RDP session to your remote server - but this time login using 'user2'.
    • Spoiler

      COX4VAb.gif

       

  6. Once you are in your remote server logging in as 'user2', you should see an 'empty' desktop without any bot running.
  7. 7. In the remote server logging in as 'user2', create a new RDP profile with Computer - 127.0.0.1 and User name: user
    • Spoiler

      MBIP9qt.png

  8. In the remote server logging in as 'user2', you should see your bot running in the RDP session[user1] within your RDP session[user2].
  9. From now on, on your own desktop, just use the RDP profile you have created in step 5 to check your bot.

 

The steps above is for running a single bot in a single VM. What if you are running 'multiple' bots in 'multiple' VMs?

Spoiler

If you are running 2 bots in 2 VMs, create 2 user IDs in each VM. Use the 2nd user ID to rdp to the other VM and leave it running.

 

Example:

VM1 with user1 and user2

VM2 with userA and userB

In VM1, run the bot using user1.

In VM2, run the bot using userA.

In VM1, rdp into VM2 using user2.

In VM2, rdp into VM1 using userB.

 

Alternatively, if you running 2 or even more bots. You can create a dedicated a VM just to rdp into VMs running those bots.

 

Example:

VM1 with bot running.

VM2 with bot running.

VM3 with bot running.

VM4 with permanent rdp sessions into VM1,VM2,VM3.

Part 5: Monitoring your bot:

  • On your PC/laptop: Use default RDC.
  • On your Android/IOS devices: Download Microsoft 'RD Client' app.

Part 6: How long can my bot run with free $300 credits?

  • You can use the pricing calculator (https://cloud.google.com/products/calculator/) to estimate how long can your $300 credit last. If you have 2 or more VMs running 24/7, your $300 will not last a full 60 days.
  • Below is a sample calculation for running 2 VM instances type n1-highcpu-2:
    • Spoiler

      oxFXFE8.gif

       

    • Spoiler

      8AJ12ND.gif

       

Estimated cost is ~$200/month. With $300 free credits, 2VMs running 24/7 can last ~45days.

 

Spoiler

 

Part 7: Frequently Asked Questions

  • Out of Sync (OOS)
  • Why bot running slow? How to improve performance?
  • Suspension/Ban?
  • Will my credit card be charged?

 

 

  • Upvote 10

Share this post


Link to post
Share on other sites

To prevent bot disconnection, there is no need to create 2 instances. On the first, it is sufficient to create a new user account with administrator permission. Then open remote desktop on the vm and point it to 127.0.0.1 and log on with the user created before. Install here bluestacks, autoit and bot and run it here. To disconnect, remember to do not disconnect the 127.0.0.1,but disconnect main remote desktop

  • Upvote 3

Share this post


Link to post
Share on other sites

Thanks @magilg! Will try that. For those only have one single bot running on one vm instance, this is a good solution. Saves on credit and can run the bot for max 60 days with some credits left!

Share this post


Link to post
Share on other sites

Thanks @magilg! Will try that. For those only have one single bot running on one vm instance' date=' this is a good solution. Saves on credit and can run the bot for max 60 days with some credits left!

[/quote']

You're welcome, I'm using this method with no issues at all, running bot 24/7

The main problem with google servers is the frequent disconnection of bluestacks, facing client and server out of sync and connection lost while searching a village. I tried to set the search speed at 10 and to set bluestacks at high priority on windows task manager, it seems better but not solved...

  • Upvote 1

Share this post


Link to post
Share on other sites

Here is why you need a CPU with at least 2cores(2.3Ghz) to run your bot smoothly:

fxnwQgp.gif

Average CPU usage is >90%. Interestingly, the 2 dips in usage is during the 6-hours force break.  :D

Share this post


Link to post
Share on other sites

I'm running multiple bots on multiple VMs, so there is no need for such method. Anyway, i've updated the 'how-to' guide for the benefit of those who are looking to setup their own bot on gcloud VPS.

Share this post


Link to post
Share on other sites

So one credit card only 2 month free? :D I will wait for 1 gem boost :D

Why wait for 1 gem boost? There aren't any 1 gem boost for a long time!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×