2022-07-29 13:45:26 +00:00
|
|
|
:github_url: https://github.com/LizardByte/Sunshine/tree/nightly/docs/source/about/usage.rst
|
2022-04-18 18:53:28 +00:00
|
|
|
|
|
|
|
Usage
|
|
|
|
=====
|
|
|
|
#. See the `setup`_ section for your specific OS.
|
|
|
|
#. Run ``sunshine <directory of conf file>/sunshine.conf``.
|
|
|
|
|
2022-04-18 20:05:17 +00:00
|
|
|
.. Note:: You do not need to specify a config file. If no config file is entered the default location will be used.
|
|
|
|
|
|
|
|
.. Attention:: The configuration file specified will be created if it doesn't exist.
|
2022-04-18 18:53:28 +00:00
|
|
|
|
|
|
|
.. Tip:: If using the Linux AppImage, replace ``sunshine`` with ``./sunshine.AppImage``
|
|
|
|
|
|
|
|
#. Configure Sunshine in the web ui
|
|
|
|
The web ui is available on `https://localhost:47990 <https://localhost:47990>`_ by default. You may replace
|
|
|
|
`localhost` with your internal ip address.
|
|
|
|
|
2022-04-18 20:05:17 +00:00
|
|
|
.. Attention:: Ignore any warning given by your browser about "insecure website".
|
2022-04-18 18:53:28 +00:00
|
|
|
|
|
|
|
.. Caution:: If running for the first time, make sure to note the username and password Sunshine showed to you,
|
|
|
|
since you cannot get back later!
|
|
|
|
|
|
|
|
Add games and applications.
|
|
|
|
This can be configured in the web ui.
|
|
|
|
|
2022-06-09 03:00:59 +00:00
|
|
|
.. Note:: Additionally, apps can be configured manually. `src_assets/<os>/config/apps.json` is an example of a
|
|
|
|
list of applications that are started just before running a stream. This is the directory within the GitHub
|
|
|
|
repo.
|
2022-04-18 18:53:28 +00:00
|
|
|
|
2022-06-28 23:16:24 +00:00
|
|
|
.. Attention:: Application list is not fully supported on macOS
|
2022-04-18 18:53:28 +00:00
|
|
|
|
|
|
|
#. In Moonlight, you may need to add the PC manually.
|
|
|
|
#. When Moonlight request you insert the correct pin on sunshine:
|
|
|
|
|
|
|
|
- Login to the web ui
|
2022-06-18 00:05:51 +00:00
|
|
|
- Go to "PIN" in the Navbar
|
2022-04-18 18:53:28 +00:00
|
|
|
- Type in your PIN and press Enter, you should get a Success Message
|
|
|
|
- In Moonlight, select one of the Applications listed
|
|
|
|
|
|
|
|
Network
|
|
|
|
-------
|
|
|
|
Sunshine will be available on port 47990 by default.
|
|
|
|
|
2022-04-18 20:05:17 +00:00
|
|
|
.. Danger:: Do not expose port 47990, or the web ui, to the internet!
|
2022-04-18 18:53:28 +00:00
|
|
|
|
|
|
|
Arguments
|
|
|
|
---------
|
|
|
|
To get a list of available arguments run the following:
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
sunshine --help
|
|
|
|
|
|
|
|
Setup
|
|
|
|
-----
|
|
|
|
|
|
|
|
Linux
|
|
|
|
^^^^^
|
2022-06-15 19:52:38 +00:00
|
|
|
The deb and rpm packages handle these steps automatically. The AppImage does not, third party packages may not as well.
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-04-18 18:53:28 +00:00
|
|
|
Sunshine needs access to `uinput` to create mouse and gamepad events.
|
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
#. Add user to group `input`, if this is the first time installing.
|
|
|
|
.. code-block:: bash
|
2022-04-18 18:53:28 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
sudo usermod -a -G input $USER
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
#. Create `udev` rules.
|
|
|
|
.. code-block:: bash
|
2022-04-18 18:53:28 +00:00
|
|
|
|
2022-06-24 03:36:06 +00:00
|
|
|
sudo nano /etc/udev/rules.d/85-sunshine.rules
|
2022-04-18 18:53:28 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
Input the following contents.
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
.. code-block::
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
|
2022-04-18 18:53:28 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
Save the file and exit:
|
2022-04-18 18:53:28 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
#. ``CTRL+X`` to start exit.
|
|
|
|
#. ``Y`` to save modifications.
|
2022-04-18 18:53:28 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
#. Optionally, configure autostart service
|
|
|
|
- filename: ``~/.config/systemd/user/sunshine.service``
|
|
|
|
- contents:
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
.. code-block::
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
[Unit]
|
|
|
|
Description=Sunshine Gamestream Server for Moonlight
|
2022-04-18 18:53:28 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
[Service]
|
|
|
|
ExecStart=<see table>
|
2022-04-18 18:53:28 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
[Install]
|
|
|
|
WantedBy=graphical-session.target
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
.. table::
|
|
|
|
:widths: auto
|
2022-06-15 19:52:38 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
======== ============================================== ===============
|
|
|
|
package ExecStart Auto Configured
|
|
|
|
======== ============================================== ===============
|
2022-06-29 00:39:33 +00:00
|
|
|
aur /usr/bin/sunshine ✔
|
2022-06-18 00:05:51 +00:00
|
|
|
deb /usr/bin/sunshine ✔
|
|
|
|
rpm /usr/bin/sunshine ✔
|
|
|
|
AppImage ~/sunshine.AppImage ✖
|
2022-07-29 13:45:26 +00:00
|
|
|
Flatpak flatpak run dev.lizardbyte.sunshine ✖
|
2022-06-18 00:05:51 +00:00
|
|
|
======== ============================================== ===============
|
2022-06-15 19:52:38 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
Start once
|
|
|
|
.. code-block:: bash
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
systemctl --user start sunshine
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
Start on boot
|
|
|
|
.. code-block:: bash
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
systemctl --user enable sunshine
|
2022-04-18 18:53:28 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
#. Additional Setup for KMS
|
|
|
|
.. Note:: ``cap_sys_admin`` may as well be root, except you don't need to be root to run it. It is necessary to
|
|
|
|
allow Sunshine to use KMS.
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
Enable
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine))
|
|
|
|
|
|
|
|
Disable
|
|
|
|
.. code-block:: bash
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
sudo setcap -r $(readlink -f $(which sunshine))
|
2022-06-09 03:00:59 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
#. Reboot
|
2022-06-09 03:00:59 +00:00
|
|
|
.. code-block:: bash
|
2022-04-18 18:53:28 +00:00
|
|
|
|
2022-06-18 00:05:51 +00:00
|
|
|
sudo reboot now
|
2022-04-18 18:53:28 +00:00
|
|
|
|
2022-06-28 23:16:24 +00:00
|
|
|
macOS
|
2022-04-18 18:53:28 +00:00
|
|
|
^^^^^
|
|
|
|
Sunshine can only access microphones on macOS due to system limitations. To stream system audio use
|
|
|
|
`Soundflower <https://github.com/mattingalls/Soundflower>`_ or
|
|
|
|
`BlackHole <https://github.com/ExistentialAudio/BlackHole>`_ and
|
|
|
|
select their sink as audio device in `sunshine.conf`.
|
|
|
|
|
|
|
|
.. Note:: Command Keys are not forwarded by Moonlight. Right Option-Key is mapped to CMD-Key.
|
|
|
|
|
2022-06-15 19:52:38 +00:00
|
|
|
.. Caution:: Gamepads are not currently supported.
|
|
|
|
|
|
|
|
Configure autostart service
|
|
|
|
|
|
|
|
MacPorts
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
sudo port load Sunshine
|
2022-04-18 18:53:28 +00:00
|
|
|
|
|
|
|
Windows
|
|
|
|
^^^^^^^
|
|
|
|
For gamepad support, install `ViGEmBus <https://github.com/ViGEm/ViGEmBus/releases/latest>`_
|
|
|
|
|
|
|
|
Shortcuts
|
|
|
|
---------
|
|
|
|
All shortcuts start with CTRL + ALT + SHIFT, just like Moonlight
|
|
|
|
|
|
|
|
- ``CTRL + ALT + SHIFT + N`` - Hide/Unhide the cursor (This may be useful for Remote Desktop Mode for Moonlight)
|
|
|
|
- ``CTRL + ALT + SHIFT + F1/F13`` - Switch to different monitor for Streaming
|
|
|
|
|
|
|
|
Application List
|
|
|
|
----------------
|
|
|
|
- You can use Environment variables in place of values
|
2022-06-09 03:00:59 +00:00
|
|
|
- ``$(HOME)`` will be replaced by the value of ``$HOME``
|
2022-04-18 18:53:28 +00:00
|
|
|
- ``$$`` will be replaced by ``$``, e.g. ``$$(HOME)`` will be replaced by ``$(HOME)``
|
|
|
|
- ``env`` - Adds or overwrites Environment variables for the commands/applications run by Sunshine
|
|
|
|
- ``"Variable name":"Variable value"``
|
|
|
|
- ``apps`` - The list of applications
|
|
|
|
- Example application:
|
|
|
|
|
|
|
|
.. code-block:: json
|
|
|
|
|
|
|
|
{
|
|
|
|
"name":"An App",
|
|
|
|
"cmd":"command to open app",
|
|
|
|
"prep-cmd":[
|
|
|
|
{
|
|
|
|
"do":"some-command",
|
|
|
|
"undo":"undo-that-command"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"detached":[
|
|
|
|
"some-command",
|
|
|
|
"another-command"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
- ``name`` - The name of the application/game
|
|
|
|
- ``output`` - The file where the output of the command is stored
|
|
|
|
- ``detached`` - A list of commands to be run and forgotten about
|
|
|
|
- ``prep-cmd`` - A list of commands to be run before/after the application
|
|
|
|
|
|
|
|
- If any of the prep-commands fail, starting the application is aborted
|
|
|
|
- ``do`` - Run before the application
|
|
|
|
|
|
|
|
- If it fails, all ``undo`` commands of the previously succeeded ``do`` commands are run
|
|
|
|
|
|
|
|
- ``undo`` - Run after the application has terminated
|
|
|
|
|
|
|
|
- This should not fail considering it is supposed to undo the ``do`` commands
|
|
|
|
- If it fails, Sunshine is terminated
|
|
|
|
|
|
|
|
- ``cmd`` - The main application
|
|
|
|
|
|
|
|
- If not specified, a process is started that sleeps indefinitely
|
|
|
|
|
|
|
|
Considerations
|
|
|
|
--------------
|
|
|
|
- When an application is started, if there is an application already running, it will be terminated.
|
|
|
|
- When the application has been shutdown, the stream shuts down as well.
|
|
|
|
- In addition to the apps listed, one app "Desktop" is hardcoded into Sunshine. It does not start an application,
|
|
|
|
instead it simply starts a stream.
|