techie
December 16, 2020

game screen mirroring: install moonlight on your raspberry

moonlight is a rebuild of the nvidia launched streaming protocol, you can easily stream your pc gaming content (audio+video) to your screen attached to the rasperry pi. also you can plug in your controller to the pi and it gets connected to your pc trough the pi. input lag is "ok", no shooter possible but casual games are pretty fun with it, smooth too!


because i never found a proper tutorial how to finally install moonlight on your raspberry correctly, i have a short tutorial in my apple notes for 2 years now, i want to share it with you in an adapted version. I forward exactly this tutorial for so long without having thought much about it.

i assume that everyone can install raspbian on his raspberry by himself. for this tutorial a debian based distro is required for everything to work.

url: https://www.raspberrypi.org/software/

first we ssh into the raspberry pi and add sources to the sources.list

nano /etc/apt/sources.list

add the following line

Add this line to your /etc/apt/sources.list file for Raspbian Stretch based distributions

deb http://archive.itimmer.nl/raspbian/moonlight stretch main

Add this line to your /etc/apt/sources.list file for Raspbian Jessie based distributions

deb http://archive.itimmer.nl/raspbian/moonlight jessie main

Fetch and install the GPG key

wget http://archive.itimmer.nl/itimmer.gpg
sudo apt-key add itimmer.gpg

Install the package using

sudo apt-get update
sudo apt-get install moonlight-embedded

Now you just have to make sure that your raspberry is in the same network as your pc. Running over wifi is a stupid decision in most cases.

now you can start pairing to your pc just find out the internal ip of your pc and pair it with the following command

moonlight pair X.X.X.X

if it is paired, i.e. you have set everything correctly in the Nvidia software, code pairing etc. but still no image is displayed, you can start the streaming mode on your own with the following command

moonlight streaming -1080 X.X.X.X

ready to go 🤯


some streaming commands input

-720 Use 1280x720 resolution [default]
-1080 Use 1920x1080 resolution
-width Horizontal resolution (default 1280)
-height Vertical resolution (default 720)
-30fps Use 30fps
-60fps Use 60fps [default]
-bitrate Specify the bitrate in Kbps
-packetsize Specify the maximum packetsize in bytes
-app Name of app to stream
-nosops Don't allow GFE to modify game settings
-input Use as input. Can be used multiple times
-mapping Use as gamepad mapping configuration file (use before -input)
-audio Use as ALSA audio output device (default sysdefault)
-localaudio Play audio locally