[HowTo] Moonlight-Embedded (former Limelight) using Luna Launcher


I started again with the following steps:

-Add Testing Repo to install newer version of cmake
sudo nano /etc/apt/sources.list


deb http://ftp.us.debian.org/debian testing main contrib non-free

sudo nano /etc/apt/preferences
Package: cmake
Pin: release a=testing
Pin-Priority: 900

-Install cmake
sudo apt-get update
sudo apt-get install cmake
cmake --version
–> Should be 3.7.0

-Install libraries
sudo apt-get install vero-userland-dev-osmc
sudo apt-get install vero2-userland-dev-osmc
sudo apt-get install libasound2-dev
sudo apt-get install libopus
sudo cp /usr/osmc/include/amcodec/ /opt/vero/include/ -r

-Clone moonlight-embedded to local directory
mkdir ~/build
cd ~/build
git clone https://github.com/irtimmer/moonlight-embedded.git

-Change to the subfolder /make of the just downloaded repository and compile
cd moonlight-embedde/make
_cmake …/ -DAMLOGIC_INCLUDE_DIR=/opt/vero/include -DAMCODEC_LIBRARY="/opt/vero/lib" -DAMADEC_LIBRARY="/opt/vero/lib" -DAMAVUTILS_LIBRARY="/opt/vero/lib"

So when trying to compile I get the following error:

osmc@osmc:~/build/moonlight-embedded/cmake$ cmake …/ -DAMLOGIC_INCLUDE_DIR=/opt/vero/include -DAMCODEC_LIBRARY="/opt/vero/lib" -DAMADEC_LIBRARY="/opt/vero/lib" -DAMAVUTILS_LIBRARY="/opt/vero/lib"
CMake Error at CMakeLists.txt:1 (project):

Unix Makefiles

does not support platform specification, but platform


was specified.

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
– Configuring incomplete, errors occurred!


Should be /opt/vero2 I think


But I’m on a Vero?


If you are using a Vero 1, you shouldn’t set AmLogic directory. There’s a different setting for iMX6 I think.


Ok? I tried to set the dir because I had the same problem as mkub, when I run cmake without the parameters (missing Broadcom, Freescale and Amlogic):

osmc@osmc:~/build/moonlight-embedded/cmake$ cmake …/
– Could NOT find Freescale (missing: KERNEL_INCLUDE_DIR VPU_LIBRARY)
– Checking for module ‘libudev’
– No package ‘libudev’ found
CMake Error at /usr/share/cmake-3.7/Modules/FindPkgConfig.cmake:415 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.7/Modules/FindPkgConfig.cmake:588 (_pkg_check_modules_internal)
CMakeLists.txt:24 (pkg_check_modules)

– Configuring incomplete, errors occurred!
See also “/home/osmc/build/moonlight-embedded/cmake/CMakeFiles/CMakeOutput.log”.

Also, when I now tried to install libuvdev-dev I got a warning message which makes me a bit hesitant to install :wink:

osmc@osmc:~/build/moonlight-embedded/cmake$ sudo apt-get install libudev-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
armv7-libass-osmc armv7-libbluray-osmc armv7-libcrossguid-osmc armv7-libnfs-osmc
armv7-librtmp-osmc armv7-libshairplay-osmc armv7-libsqlite-osmc libapparmor1 libass5 libatasmart4
libcdio13 libconfuse-common libconfuse0 libdevmapper-event1.02.1 libenca0 libfribidi0
libgraphite2-3 libgudev-1.0-0 libharfbuzz0b libip4tc0 libjasper1 liblcms2-2 liblvm2app2.2 liblz4-1
libmad0 libmicrohttpd10 libogg0 libparted2 libpcrecpp0 libplist2 libpolkit-agent-1-0
libpolkit-backend-1-0 libpolkit-gobject-1-0 libsamplerate0 libseccomp2 libsgutils2-2 libsmbclient
libssh-4 libtag1-vanilla libtinyxml2.6.2 libvorbis0a libvorbisenc2 libwebp5 libwebpdemux1
libwebpmux1 libxslt1.1 libyajl2 mediacenter-addon-osmc mediacenter-eventclients-common-osmc
mediacenter-send-osmc mediacenter-skin-osmc python-chardet python-imaging python-pexpect
python-pil python-pkg-resources python-requests python-six python-unidecode python-urllib3
sysvinit-core vero-image-4.4.0-8-osmc vero-libcec-osmc
Use ‘apt-get autoremove’ to remove them.
The following extra packages will be installed:
binutils dmsetup hdparm init-system-helpers kbd keyutils libc-bin libc-dev-bin libc-l10n libc6
libc6-dev libdevmapper1.02.1 libfdisk1 libgcrypt20 libgssapi-krb5-2 libk5crypto3 libkrb5-3
libkrb5support0 liblvm2app2.2 libmount1 libncurses5 libncursesw5 libselinux1 libsepol1
libsmartcols1 libtinfo5 libudev1 linux-libc-dev locales makedev mount nfs-common rpcbind
sysvinit-utils util-linux
Suggested packages:
binutils-doc apmd glibc-doc rng-tools krb5-doc krb5-user open-iscsi watchdog util-linux-locales
Recommended packages:
powermgmt-base console-setup console-data manpages manpages-dev krb5-locales libgpm2
The following packages will be REMOVED:
armv7-eventlircd-osmc armv7-remote-osmc diskmount-osmc init libpam-systemd policykit-1
smb-app-osmc systemd systemd-sysv udev udisks udisks-glue vero-mediacenter-osmc vero1-device-osmc
The following NEW packages will be installed:
keyutils libc-l10n libfdisk1 libudev-dev makedev
The following packages will be upgraded:
binutils dmsetup hdparm init-system-helpers kbd libc-bin libc-dev-bin libc6 libc6-dev
libdevmapper1.02.1 libgcrypt20 libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0
liblvm2app2.2 libmount1 libncurses5 libncursesw5 libselinux1 libsepol1 libsmartcols1 libtinfo5
libudev1 linux-libc-dev locales mount nfs-common rpcbind sysvinit-utils util-linux
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
init systemd-sysv (due to init)
31 upgraded, 5 newly installed, 14 to remove and 403 not upgraded.
Need to get 19.8 MB of archives.
After this operation, 105 MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase ‘Yes, do as I say!’
?] n


That’s what you want to set. IMX6 is Freescale. I think Moonlight supports it.

Something is wrong here. Can you post your APT history?


like this? apt-get.pdf (52.3 KB)


Please use the official Pastebin.


Right, sorry, here are the latest entries or do you need everything?


Is anyone getting a black screen with moonlight 2.2.2?
I’m getting a loop on the log:
Waiting for IDR frame Waiting for IDR frame Waiting for IDR frame Waiting for IDR frame Waiting for IDR frame

The stream starts OK on the server. Same launched with luna or via command line.
GeForce Experience

UPDATE: This is indeed a geForce problem introduced in the latest version. Moonlight has already patched it but we’ll have to wait for a embbebed release.
Problem is described here:


How do I go about changing the IP address of the host computer in LUNA? I tried to delete the host from within LUNA and also uninstall/reinstall LUNA but it still insist on trying to connect to the IP address of my host PC before I changed it and made it static.

Also, it sees the wireless PC XBOX controller and I’m able to add it but I cannot select the button mapping option. Any idea what the issue could be?

Sorry, I’m a LINUX noob and have been trying to get streaming WITH a wireless controller working for like a year now. Hopefully I’ll finally be successful in 2017!


The version of Luna you’re using would be extremely helpful in answering your questions as the behaviour of both parts (pairing and mapping) is vastly different between 0.6.x versions and the current 0.7.0-RCs.


Hi exxe,
Thanks for taking the time to respond. I have v 0.7.0 RC4 installed.

I did manage to find the LUNA install directory (the one with all the Python and a few HTM files) but was not able to find the location of the host PC IP address. I can start and run moonlight from the command line but it’s a PITA since the PC is on the other side of the house. Had lots of issues with the xboxdrv in the past, inexplicably it would sometimes work (but still with button assignment issues) and other times it would not.

Thanks again and all the best for 2017


As of 0.7.0, IP addresses shouldn’t be saved between pairings (which is why they don’t exist in the settings anymore). Instead, when clicking the add host button, you should be presented with this screen

or with a selection of the hosts discovered via mDNS (if the dependencies are installed).

Luna shouldn’t fall back to previously used IP by default (but might do so in the input dialog, which can be changed obviously). If it does for you how, I’d need the logs right from starting Luna to the point where she misbehaves (they’re part of Kodi’s log, which is located at ~/.kodi/temp/kodi.log, all log entries belonging to Luna are prefixed accordingly - the easiest way to do this is open a terminal window and tail the file - tail -f ~/.kodi/temp/kodi.log - , then start Luna and copy the necessary parts, but please use pastebin for this!) and a more precise description of what’s happening (i.e. is there a host already shown in the top row, … ) and the exact steps to reproduce this.
I’m sorry that this will be kind of a lot of work for you, especially since you said that you’re not too proficient with Linux, but there’s no way for me to know what’s going wrong without this. I’ve paired my two machines countless times and never encountered a case where the pairing itself tried to pair a previous IP.

Thanks, I wish you the same :slight_smile:


Here is the output of the tail command:

Basically after I select any game in LUNA the screen clears and this pops up momentarily before returning me back to the OSMC main menu:

Moonlight Embedded 2.2.2 (EMBEDDED:PI)
Connect to
Can't connect to server

Which makes sense since the server address is

When I remove the host and then add host the default IP address for the screen you show above is When I enter it displays a message that that host is already paired and adds it back to the LUNA main menu. When I click on the host and select any game it again tries to connect to and fails.

Thank you again for your help kind sir!


I’ll give you another more detailed response tomorrow, but since we seem to live in different time zones (it’s almost 3am here :slight_smile: ):
Remove the host from within Luna, exit the addon, remove the ~/.cache/moonlightfolder on your Pi, start Luna and pair again (yes, in this order), if I’m not mistaken - which I might be, so no promises! - that should do the trick.


No dice. Doing as you suggested did allow me to re-pair with the host (had to enter the PIN again) but when I attempt to launch a game I still get

Moonlight Embedded 2.2.2 (EMBEDDED:PI)
Connect to
Can't connect to server

I also tried the moonlight unpair command on IP but that failed as expected, and rebooting between steps with the same result . Additionally, I tried going about it the long way which I expected would work for sure. I reassigned back to the host PC. From here I was able to launch a game from LUNA as expected. I then went and removed the host from LUNA, set the Host PC IP back to, rebooted everything, added the host in LUNA and it’s STILL trying to connect to


Simply calling moonlight’s unpair command will always fail with new versions of Luna because a different key dir is created per host (this essentially allows for the multi host functionality). Instead, you’d have to call it like this moonlight unpair -keydir [path], where path is ~/.cache/moonlight/[HOST-UUID].
As a side note, this is also the reason why Luna always told you that you’re already paired with that host, since the certificates aren’t deleted when you remove a host (yet).

Did you have a previous version installed? Given that the log shows that the proper host is selected when the game list is shown / a game is started, the only thing I can think of right now is that the config file includes some old values. It should be located at ~/.kodi/userdata/addon_data/script.luna/.storage/luna.conf and not contain a host parameter (as in: not even the key should be there).


I did have a previous LUNA version installed but I uninstalled it before installing this new one (I think). Either way, this is as deep as that directory goes:


I’m wondering if the pair, and consequently host IP address, was somehow stored in a moonlight setting since I believe that before I installed LUNA I did try doing a command-line pair and run from the CLI. Should I try uninstalling moonlight & LUNA or will that not wipe all the associated settings?


The storage directory is hidden :wink: It’s used for pretty much anything Luna needs to store, e.g. covers / fanarts for games, the game list itself, … It absolutely has to exist and if it doesn’t it would be created as soon as Luna is started for the first time. All the scrapers (disabled or not, as that’s determined at a later stage) are creating their necessary directories (if necessary of course, and they’re all sub dirs of .storage) as soon as they’re instantiated. Even the information if an update check has been performed in the last 24hrs is stored in there (and that’s executed right after bootstrapping the add-on, while the main menu is rendered).
In short, there’s literally no way this dir is missing - especially in conjunction with the logs you posted above, you wouldn’t even get to Luna’s main menu if it’s not there for some reason.

Moonlight itself doesn’t store that kind of information, it’s using either mDNS for automatic host discovery or requires you to specify an IP. It’s then using the certificates in ~/.cache/moonlight/ (but not in any subfolders) to try and make a connection.

I’m almost entirely sure that this is an issue with Luna, and most likely induced by an old configuration file. Uninstalling an add-on in Kodi doesn’t remove the settings unfortunately (everything in ~/.kodi/userdata/addon_data/script.luna/ and the sub dirs) and Luna doesn’t remove / validate an existing config file after an update (which might be an issue in it’s own right).
As a side note, appending the address key (not host as I’ve said before, I’m sorry) with any IP address to my config file and forcing a different IP as launch argument for moonlight causes it to connect to the IP specified in my config file (i.e. exactly the problem you’re having).

So it’s either manually editing / removing the config file or simply removing the entire dir (~/.kodi/userdata/addon_data/script.luna) - the latter will cause Luna to recreate everything needed, including the config file itself.