Why would I use Openstream?
You might want to use Openstream on your EC2 instance so that you can play anywhere. For example, a Raspberry Pi or a phone. By default, the Tesla T4 GPUs are not supported by Moonlight. Although there is a script to patch GeForce experience, there are some caveats. Notably, any "gaming features" are gone, and by default there is no desktop streaming option, unless you add it in manually. Since Openstream is only desktop streaming, it can be used for a variety of things.
Inspired by an automation GitHub guide:
You'll also want to follow this guide all the way (especially to the part about Elastic IP addresses), it will make sure you can use the same IP address, so you don't have to pair with a brand-new IP address.
Step 1: Create a Windows Server
Login to your AWS console. When you do, go to the EC2 dashboard. Make sure the region you want is selected. You can do so by checking the area at the top of the AWS console.
Depending on your account, you may need to request a limit increase, if you do, you can say that you're requesting a limit increase to create a workstation, or are just trying out AWS and wanted to see its performance. Generally, they approve most (if not all) requests for the G4dn instances. When requesting a limit increase, make sure to select SPOT INSTANCES
Anyway, you're now in the EC2 console. From here, click the orange launch instance button at the top right of the screen. Search for WIndows Server 2019. Windows Server is a cleaner, much more restrictive version of Windows 10. It's cleaner because many features are disabled by default, and it's restrictive as it add many security features and a very strong firewall.
Then you'll want to select the "G4DN.xlarge" instance
Image provided by TechGuru
When configuring your instance, you can leave everything as default. Here's where we are going to change settings related to our storage. I highly recommend something like 256 or 512 GBs. When creating this volume, please make sure to uncheck delete on termination.
Image provided by TechGuru
For tags, you HAVE TO add these tags: "Name" for the name and "Gaming" or whatever you want your instance to be named. Now, Moonlight & Openstream do need quite a few ports. When you go to configure the security group (when launching your gaming instance), please add these ports.
TCP 35043, 47984, 47989, 47995, 47996, 48010
UDP 47998, 47999, 48000, 48010
Click the "Add rule" button below all your existing ports and start adding! By the way, make the port accessible to the internet (0.0.0.0/0), you can do so by choosing "anywhere" as shown in the screenshot above.
Finally, you can launch the instance! When doing so, it will talk about creating a key pair. Keep this file safe, you will also need it to get your password.
At the top right (while selecting you instance), click connect. Keep in mind, it could take up to 4 minutes for the instance to fully provision and allow you to copy your password. Anyway, when you click connect, select the "RDP client" tab and copy the IP address of the instance.
Every Windows computer comes with a RDP client. Just click the Windows flag/logo/start menu, type RDP and it's literally right there. If you're not using you can use Remote Desktop app from Microsoft (for Mac) or Remmina (for Linux)
You can install Remmina by going to your terminal and typing...
sudo apt install remmina
Once you've put you add the IP address into your RDP client, and logged in using the password you received, you should see your EC2 desktop. Now that you're in Windows, let's get it configured!
Step 2: Turn on Windows features and configure optimal settings
This process is automatically applied if you use the cloudopenstream script.
Click here for instructions on using the script. Skip to step three if you are using the script.
First, you need to update the GPU. Luckly, you can do this using Parsec GPU Updater script or cloudopenstream. If you don't want to use either script, you can use this page here:
As mentioned earlier, a Windows Server doesn't have some features that we need.
First, go to your server manager and enable QWAVE (Quality Windows Audio Video Experience, or something like that) in order to activate it, go to the top where it says "add roles and/or features", and you'll want to get the "Wireless LAN Service"
Next, for games to run, you're going to need the basics like Visual Studio. You can download ALL redistributes (15, 17, & 19) at the official Microsoft website. This is a direct link to the Visual Studio redist: https://aka.ms/vs/16/release/vc_redist.x64.exe
For audio, install VBCable here
Finally, install Openstream using this link
The server needs to auto-login so that you can start a script and immediately start playing!
- On the computer, right-click the Windows flag/logo/start menu and click run
netplwiz.exe (image for reference)
- Uncheck "user must enter a username and password to use this computer"
- Type in your instance's password one last time
- Restart the instance (you can use the start menu)
Install Parsec: (optional)
Parsec is like RDP but with a focus on no latency. Download it here, create an account (or login), this will be used as a backup in case there are any problems with Openstream. You can download it here: https://builds.parsecgaming.com/package/parsec-windows.exe
Now we need to add the Open-stream ports to the Windows firewall. Open a new Powershell window and enter this:
New-NetFirewallRule -DisplayName "Moonlight TCP" -Direction Inbound -LocalPort 47984,47989,48010 -Protocol TCP -Action Allow | Out-Null
New-NetFirewallRule -DisplayName "Moonlight UDP" -Direction Inbound -LocalPort 47998,47999,48000,48010 -Protocol UDP -Action Allow | Out-Null
We are done with step two.
Step 3: Finalizing our automated setup
Now, please follow the steps provided here:
Stop reading the guide when you get to "Creating the Start Script"
What I recommend you do is assign a static/elastic IP address. Every time you turn your instance off, it will change the IP address when you turn it back on. Meaning reconnecting and pairing Open-stream over and over again. This is what I was talking about above.
First, create a network interface, you can do this by going to the left-hand side of the EC2 management console, then selecting the orange "Create network interface" button on the top right. Choose a default subnet in any of your preferred region (example: us-west-1c).
Second, go to the left-hand side again, and click Elastic IPs. Then click allocate Elastic IP address button at the top right. Once you get an IP address, click the "actions" button next to the orange button while selecting your IP address. Then click associate in the drop-down "actions" menu, which you then select your new network interface.
If you already made a launch template, you can modify the launch template by going to the left-hand side, selecting launch templates and then actions dropdown on the top right. When you do that, click "modify template", this will create a new version. (I recommend naming your new version "2")
In order for your script to execute your new version, change this line in the script to your version name. The best way to do that is by using Notepad or Visual Studio Code.
--launch-template LaunchTemplateId=$($LAUNCH_TEMPLATE),Version=newversionname --image-id $($ami)
None of that is needed if you didn't create a launch template.
You will also need to add your security group, or Open-stream cannot connect to your instance. All you need to do is go back to the left-hand side, select "Network interfaces" select the network interface you created, and then "Actions" then "change security groups", search for your security group, click "add security group" and then save. Usually, when creating your network interface, you can select a security group, this is just in case you didn't set this up.
After all of that, continue the guide (you can now begin to create a launch template)
Remember, before the "Advanced details" tab, add your network interface like this...
Finally, you can now use Openstream and Moonlight.
- Download Moonlight at the official source here
- Enter your Elastic IP address
- Connect to the instance using RDP
- Make sure Openstream is on (it should automatically start)
- Enter the code Moonlight provides on the Open-stream application
- Restart the computer fully
- Inside Moonlight, choose Desktop if you're using mouse and keyboard. If you're using a controller, I recommend Steam Big Picture.
That's it! Now you have a fully automated gaming (or workstation) server powered by Open-stream and AWS!