linux搭建串流服务器 玩游戏 刷视频,客户端支持 ios 安卓 win linux macos等

archlinux 作为服务端,客户端我用的win上网本。 在10M的带宽上 可以系统1080p 30帧的 流畅体验,办公没有任何压力,游戏的话体验就差一点。60帧要20M

# 显卡驱动

我这里是核显 intel uhd630

1
sudo pacman -S vulkan-intel

# 服务端安装sunshine

有很多安装方法,我这里用aur的 简单一些

1
yay -S sunshine 

# 服务器端处理

依赖

1
sudo pacman -S fuse

用户权限

1
sudo usermod -a -G input $USER

udev 规则

1
2
echo 'KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"' | \
sudo tee /etc/udev/rules.d/85-sunshine-input.rules

KMS 的额外设置

1
sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine))

用户服务

1
2
mkdir -p ~/.config/systemd/user/
nano ~/.config/systemd/user/sunshine.service
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
[Unit]
Description=Sunshine Gamestream Server for Moonlight

[Service]
ExecStart=/usr/bin/sunshine
#Flatpak Only
#ExecStop=flatpak kill dev.lizardbyte.sunshine

[Install]
WantedBy=graphical-session.target

启动

1
2
systemctl --user enable sunshine
systemctl --user start sunshine

重启服务器,使用x11 登录桌面,我这里是kde (要无人职守的话,需要配置自动登录)

打开 https://IP:47990/ 配置帐号密码,并配置好帐号密码。

客户端下载,我这里是 windows

https://github.com/moonlight-stream/moonlight-qt/releases

https://github.com/moonlight-stream/moonlight-qt/releases/download/v4.3.1/MoonlightPortable-x64-4.3.1.zip

解压 运行,

链接 linux的ip ,让输入pin数字,在网页端 https://IP:47990/ 点pin 输入,然后客户端等一下自动链接上 点击desktop 完毕

推出快捷键是 ctl alt shift Q

鼠标灵敏度问题,需要两边设置分辨率一样 就ok了

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计