KasmVNC icon indicating copy to clipboard operation
KasmVNC copied to clipboard

Sunlight / Moonlight support

Open westurner opened this issue 1 year ago • 5 comments

Sunlight server w/ Moonlight client supports gamestreaming screencasting at HDR 4k 120hz with supported GPUs.

Could sunlight and/or moonlight be used with Kasm instead of VNC?

sunshine server

  • src: https://github.com/LizardByte/Sunshine
  • docs: https://docs.lizardbyte.dev/projects/sunshine/en/latest/

moonlight server

  • web: https://moonlight-stream.org/
  • src: https://github.com/moonlight-stream/
  • https://github.com/moonlight-stream/moonlight-docs/wiki/Frequently-Asked-Questions#can-i-stream-my-entire-desktop-with-moonlight
  • https://github.com/moonlight-stream/moonlight-docs/wiki/Frequently-Asked-Questions#is-moonlight-secure
    • Beginning in Sunshine v0.22, full end-to-end encryption is supported [with some of the moonlight apps on some devices]. This includes all video, audio, control, and connection setup traffic. By default, full encryption is enabled for capable devices when streaming over the Internet. Encryption can be disabled or made mandatory for LAN and WAN connections independently in the Sunshine configuration.

  • https://github.com/moonlight-stream/moonlight-qt/issues/508#issuecomment-2557672877

westurner avatar Dec 20 '24 20:12 westurner

Just found this too, which mentions kasm and HTML5 and 60 FPS w/ gstreamer hwenv (nvenc)

selkies-gstreamer

  • src: https://github.com/selkies-project/selkies-gstreamer
  • docs: https://selkies-project.github.io/selkies-gstreamer/

westurner avatar Dec 20 '24 20:12 westurner

  • oss-fuzz / cloudfuzz continuously fuzz libvnc: https://github.com/google/oss-fuzz/tree/be6c9296814d2b4655a5f938509714b6281c661f/projects/libvnc
  • Recent fuzzing of gstreamer found a number of issues.

westurner avatar Dec 20 '24 20:12 westurner

I have been using kasm focal desktop core as the base image for a sunshine gamestreaming container: compose and docker file below. I'm struggling to get controller input to work, yet mouse/kb games are working well, but as long as you have your cuda docker integration setup correctly, you can assign individual GPU's or over subscribe a single GPU.

Unfortunately, the 24.02 nobel kasm desktop flavors change something I have yet to figure out and mouse/kb input do not work. any ideas appreciated to improve the below

FROM  kasmweb/core-ubuntu-noble:1.16.1-rolling-weekly

USER 0

RUN wget wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb; dpkg -i ./cuda-keyring_1.1-1_all.deb
RUN apt-get update;apt-get install -y nvidia-utils-565 libnvidia-encode-565 libnvidia-decode-565 cuda-libraries-12-6 cuda-drivers-565
RUN apt-get update;apt-get install -y innoextract libboost-filesystem1.83 libboost-iostreams1.83 libboost-program-options1.83  libboost-system1.83
RUN apt-get update;apt-get install  -y libzip.* firefox mesa-vulkan-drivers llvm
# libvulkan.* vulkan-tools libgnutls.* libcairo* librsvg.*
RUN apt-get update;apt-get install -y file-roller jstest-gtk
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test

RUN wget https://repo.steampowered.com/steam/pool/steam/s/steam/steam-launcher_1.0.0.82_amd64.deb
RUN wget https://repo.steampowered.com/steam/pool/steam/s/steam/steam-libs-amd64_1.0.0.82_amd64.deb
RUN wget https://github.com/lutris/lutris/releases/download/v0.5.18/lutris_0.5.18_all.deb
RUN apt-get update;apt-get install -y libc6:amd64 libc6:i386 libegl1:amd64 libegl1:i386 libgbm1:amd64 libgbm1:i386 libgl1-mesa-dri:amd64 libgl1-mesa-dri:i386 libglib2.0:amd64 libgamemodeauto*:amd64 libgamemode*:amd64 ./steam-launcher_1.0.0.82_amd64.deb ./steam-libs-amd64_1.0.0.82_amd64.deb ./lutris_0.5.18_all.deb 
RUN wget https://github.com/LizardByte/Sunshine/releases/download/v0.23.1/sunshine-ubuntu-24.04-amd64.deb
RUN dpkg --unpack sunshine*.deb;rm -f /var/lib/dpkg/info/sunshine*.postinst;dpkg configure sunshine-ubuntu-24.04-amd64;apt-get install -yf


#RUN apt-get install -y  ./sunshine-*.deb
RUN git clone https://github.com/lutris/lutris.git /opt/lutris
RUN apt-get update;apt-get install -y steam-libs-amd64 steam-libs-i386 g++-11

#RUN apt-get update;apt-get upgrade -y
USER 1000

services: desktop1: #image: kasmweb/core-cuda-focal:1.15.0-rolling image: 127.0.0.1:5000/gamestreaming:latest environment: - NVIDIA_VISIBLE_DEVICES=0 - NVIDIA_DRIVER_CAPABILITIES=all - VNC_PW=gameadmin ports: - 6980:6901 - 47980:47980/tcp - 47985:47985/tcp - 48006:48006/tcp - 55410:55410/udp - 55411:55411/udp - 47994:47994/udp - 47995:47995/udp - 47996:47996/udp - 55410:55410/udp - 55435:55435/tcp - 55435:55435/udp privileged: true volumes: - /dev/uinput:/dev/uinput - /dev/uhid:/dev/uhid - /dev/input:/dev/input - /volumes/gamestreaming/persistent/desktop1:/home/kasm-user - /volumes/gamestreaming/persistent/common:/games device_cgroup_rules: - 'c 13:* rmw' - 'c 10:* rmw' restart: always desktop2: #image: kasmweb/core-cuda-focal:1.15.0-rolling image: 127.0.0.1:5000/gamestreaming:latest environment: - NVIDIA_VISIBLE_DEVICES=1 - NVIDIA_DRIVER_CAPABILITIES=all - VNC_PW=gameadmin ports: - 6981:6901 - 47970:47970/tcp - 47965:47965/tcp - 47991:47991/tcp - 55420:55420/udp - 47979:47979/udp - 47980:47980/udp - 47981:47981/udp - 55415:55415/udp - 55436:55436/tcp - 55436:55436/udp volumes: - /dev/uinput:/dev/uinput - /dev/uhid:/dev/uhid - /dev/input:/dev/input - /volumes/gamestreaming/persistent/desktop2:/home/kasm-user - /volumes/gamestreaming/persistent/common:/games #privileged: true device_cgroup_rules: - 'c 13:* rmw' - 'c 10:* rmw' restart: always

ACiDGRiM avatar Dec 25 '24 05:12 ACiDGRiM

@westurner , we are working on several thinks in the background that will help KasmVNC compete with other solutions like those. It will likely be a few releases before we are there, but you should see things rolling out with each new release.

mmcclaskey avatar Jan 06 '25 17:01 mmcclaskey

Still hoping for SR-IOV in retail GPUs.

Not sure about vCPU functionality in GPUs. (The old NVIDIA vCPU unlock doesn't work with newer cards.)

Is there sufficient process isolation in GPUs?

https://www.google.com/search?q=sr-iov+iommu

Bought a laptop with an iGPU and a dGPU; hoping to do PCIE passthrough with QEMU.

virt-manager has a GUI way to select the GPU to passthrough

CF Zero Trust has Browser Isolation. https://developers.cloudflare.com/cloudflare-one/policies/browser-isolation/

Universal Blue (blue) distros are bootc + rpm-ostree based; https://github.com/ublue-os/image-template

Bootc: https://containers.github.io/bootc/relationships.html

On Wed, Dec 25, 2024, 12:27 AM ACiDGRiM @.***> wrote:

I have been using kasm focal desktop core as the base image for a sunshine gamestreaming container: compose and docker file below. I'm struggling to get controller input to work, yet mouse/kb games are working well, but as long as you have your cuda docker integration setup correctly, you can assign individual GPU's or over subscribe a single GPU.

Unfortunately, the 24.02 nobel kasm desktop flavors change something I have yet to figure out and mouse/kb input do not work. any ideas appreciated to improve the below

FROM kasmweb/core-ubuntu-noble:1.16.1-rolling-weekly

USER 0

RUN wget wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb; dpkg -i ./cuda-keyring_1.1-1_all.deb RUN apt-get update;apt-get install -y nvidia-utils-565 libnvidia-encode-565 libnvidia-decode-565 cuda-libraries-12-6 cuda-drivers-565 RUN apt-get update;apt-get install -y innoextract libboost-filesystem1.83 libboost-iostreams1.83 libboost-program-options1.83 libboost-system1.83 RUN apt-get update;apt-get install -y libzip.* firefox mesa-vulkan-drivers llvm

libvulkan.* vulkan-tools libgnutls.* libcairo* librsvg.*

RUN apt-get update;apt-get install -y file-roller jstest-gtk RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test

RUN wget https://repo.steampowered.com/steam/archive/precise/steam_latest.deb RUN wget https://github.com/lutris/lutris/releases/download/v0.5.18/lutris_0.5.18_all.deb RUN apt-get update;apt-get install -y libc6:amd64 libc6:i386 libegl1:amd64 libegl1:i386 libgbm1:amd64 libgbm1:i386 libgl1-mesa-dri:amd64 libgl1-mesa-dri:i386 libglib2.0:amd64 libgamemodeauto*:amd64 libgamemode*:amd64 ./steam_latest.deb ./lutris_0.5.18_all.deb RUN wget https://github.com/LizardByte/Sunshine/releases/download/v0.23.1/sunshine-ubuntu-24.04-amd64.deb RUN dpkg --unpack sunshine*.deb;rm -f /var/lib/dpkg/info/sunshine*.postinst;dpkg configure sunshine-ubuntu-24.04-amd64;apt-get install -yf

#RUN apt-get install -y ./sunshine-*.deb RUN git clone https://github.com/lutris/lutris.git /opt/lutris RUN apt-get update;apt-get install -y steam-libs-amd64 steam-libs-i386 g++-11

#RUN apt-get update;apt-get upgrade -y USER 1000

services: desktop1: #image: kasmweb/core-cuda-focal:1.15.0-rolling image: 127.0.0.1:5000/gamestreaming:latest environment:

  • NVIDIA_VISIBLE_DEVICES=0
  • NVIDIA_DRIVER_CAPABILITIES=all
  • VNC_PW=gameadmin ports:
  • 6980:6901
  • 47980:47980/tcp
  • 47985:47985/tcp
  • 48006:48006/tcp
  • 55410:55410/udp
  • 55411:55411/udp
  • 47994:47994/udp
  • 47995:47995/udp
  • 47996:47996/udp
  • 55410:55410/udp
  • 55435:55435/tcp
  • 55435:55435/udp privileged: true volumes:
  • /dev/uinput:/dev/uinput
  • /dev/uhid:/dev/uhid
  • /dev/input:/dev/input
  • /volumes/gamestreaming/persistent/desktop1:/home/kasm-user
  • /volumes/gamestreaming/persistent/common:/games device_cgroup_rules:
  • 'c 13:* rmw'
  • 'c 10:* rmw' restart: always desktop2: #image: kasmweb/core-cuda-focal:1.15.0-rolling image: 127.0.0.1:5000/gamestreaming:latest environment:
  • NVIDIA_VISIBLE_DEVICES=1
  • NVIDIA_DRIVER_CAPABILITIES=all
  • VNC_PW=gameadmin ports:
  • 6981:6901
  • 47970:47970/tcp
  • 47965:47965/tcp
  • 47991:47991/tcp
  • 55420:55420/udp
  • 47979:47979/udp
  • 47980:47980/udp
  • 47981:47981/udp
  • 55415:55415/udp
  • 55436:55436/tcp
  • 55436:55436/udp volumes:
  • /dev/uinput:/dev/uinput
  • /dev/uhid:/dev/uhid
  • /dev/input:/dev/input
  • /volumes/gamestreaming/persistent/desktop2:/home/kasm-user
  • /volumes/gamestreaming/persistent/common:/games #privileged: true device_cgroup_rules:
  • 'c 13:* rmw'
  • 'c 10:* rmw' restart: always

— Reply to this email directly, view it on GitHub https://github.com/kasmtech/KasmVNC/issues/305#issuecomment-2561623792, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAMNS7ZXIE6EZHZF25KVID2HI63LAVCNFSM6AAAAABT7ZNJZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRRGYZDGNZZGI . You are receiving this because you authored the thread.Message ID: @.***>

westurner avatar Jan 19 '25 11:01 westurner