This Node.js script automates a number of steps in Larry Gadea's guide on how to set up a streaming gaming service on EC2.
I've only tested this on OS X but it should work on other operating systems with some minor tweaks.
With this script you can get in-game with minimal effort.
There's three phases to starting a gaming instance:
- Set up AWS with the right security group and start the EC2 instance.
- Print out details for accessing the instance using a remote desktop client to login into Steam.
- Output configurations files to connect to the VPN via TunnelBlink
Install node.js if it's not already on your machine.
We'll also need Remote Desktop software. I recommend CoRD as this script can automate the configuration for CoRD if you turn on the useRDPLink
option in config.json
.
For our VPN client, download TunnelBlink.
Finally, download this script to your computer and run
npm install
To start a new gaming session run
node index.js
The first time you run this it will complain about not having any AWS credentials. Log in to AWS and go to Security Credentials then Access Keys. Create a new Access Key and click Show Access Key. Copy these details to config.json
. You also need to enter a region to start the image in. To find your closest AWS region check out cloudping. You'll need to enter the code name for the region, you can look that up here.
Now when you run the script, it will start up a Windows instance and print out the instance-id and IP address.
On to step two, it will print out details for logging in via RDP. Enter these into your Remote Desktop Software. Once you've logged in it will ask you to change your password, enter a new password and it'll open up the desktop with Steam. Login to Steam, go to Preferences -> In-Home Sharing Streaming and ensure the enable streaming checkbox is enabled. Then click the logout shortcut on the desktop.
Step three, in this scripts directory, there's a openVNP directory. Open this and there'll be two files. Open client.ovpn
with TunnelBlink. You'll have to enter a username and password. The username is Administrator, the password is what you set in the previous step.
Now we're ready to go! Open up Steam on your local computer. Once again, go to Settings -> In-Home Sharing Streaming and ensure the enable streaming checkbox is enabled. Now you should see the remote computer appear.
When you're finished gaming you can press 1 to stop the instance and exit or 2 to keep the instance running and quit.
useRDPLink
If true, instead of displaying instructions for an RDP it will open a fully configured RDP link. Works with CoRDuseSpotImage
: Whether to use a spot image or normal instancesecurityGroupName
: The name of the AWS security groupspotPrice
: The maximum spot pricing to payspotDuration
: The maximum duration an instance is active (safeguard incase you forget to turn it off)instanceType
: The type of EC2 instanceimageId
: The base image for the instanceusername
: Username for accessing the serverpassword
: Password for accessing the serveraccessKeyId
: AWS Access keysecretAccessKey
: AWS Secret keyregion
: AWS Region
- price-to-low - Your bid price for the spot price is too low. Try bumping the
spotPrice
up inconfig.json
- capacity-not-available - There's no servers available for spot requests. Try changing
useSpotImage
to false. - When opening In-Home sharing the remote computer is visible but has a status of
Not connected
- Force Steam to check for updates on your locally and remotely.
- Install RDP software that can open RDP links on the command line. If you switch
useRDPLink
to true the script will do run open rdp://username:[email protected]. CoRD does this, Microsoft Remote Desktop does not. - Once you change the Windows password and log into Steam (click Remember my password), go into the AWS Console and create an image of the instance. Set
imageId
to the image you've just created andpassword
to your new password and it will automatically log you in and start up Steam next time you run the script.