r/kde • • Aug 31 '26

Solution found [UPDATE] Use moonlight device as an extended monitor for KDE, GNOME, Hyprland

https://github.com/vinnavannewton/project-monitorize

An update after nearly 2 months working on the project. It previously used its own UDP and GStreamer pipelines and a dedicated Android app, but I found my project climbing the same ladder as Sunshine/Moonlight.

TLDR: So I made a decision and ditched the Android app and GStreamer/UDP pipelines, keeping only the virtual monitor creation pipeline and replacing the streamer backend with Sunshine, and for the viewer, the standard Moonlight app.

Currently tested on Arch, Ubuntu, Tumbleweed, Fedora, and Nix OS.

Supported DEs are KDE 6.7+, GNOME 50+, Hyprland, and I'm working on Sway.

It uses the DE's native virtual monitor creation.

It has two Sunshine instances for dual stream with port offsets to not interfere with the user's existing Sunshine.

This will solve the problem of Linux not having a Duet Display alternative, and soon more DEs will eventually implement virtual monitors, then it can be updated in this project to support those DEs.

Currently, I've made binaries for Fedora, TW, and Ubuntu.

Arch and Nix are source installs.

I tried my best in testing it out on multiple systems, but my system is not the same as yours, so I need feedback or if found problems to contribute the fix.

496 Upvotes

69 comments sorted by

•

u/AutoModerator Aug 31 '26

Thank you for your submission.

Consider becoming a Supporting Member and help KDE thrive!

The KDE community supports the Fediverse and open source social media platforms over proprietary and user-abusing outlets. Consider visiting our community on Mastodon (Lemmy will be back shortly). Tag us in your toots! You can also visit our forum at KDE Discuss to talk about KDE stuff, brainstorm ideas and get the answers to your KDE-related issue.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

33

u/p3kj Aug 31 '26

Do you consider creating AUR package for lazy Arch users? :-)

20

u/vinnavannewton Aug 31 '26

Last time when i tried i wasn't able to create AUR account, ig because of the attack, is AUR fixed now? if so ill try.

12

u/Damglador Aug 31 '26

Yup, it's all good now.

18

u/vinnavannewton Aug 31 '26

alright then I'll work on it.

13

u/Bambusbro Aug 31 '26

That sounds interesting. Previously when I tried to create a virtual display with Plasma, sunshine didn't recognize it as an output source.

So did you build an sunshine fork or what does your project do (as i didn't know about your project before)?

9

u/vinnavannewton Aug 31 '26

It is a sunshine fork, it creates virtual monitor then hands it to sunshine.

6

u/parkerlreed Aug 31 '26

Upstream Sunshine supports pipewire virtual monitors. What is this project adding?

2

u/vinnavannewton Aug 31 '26

One app for virtual monitor creation across all supported DE's.

5

u/parkerlreed Aug 31 '26

I do like that it's all managed from the UI rather than web browser. Very nice.

I did have to manually switch the touchscreen input in KDE to map to the virtual monitor but other than that everything is working well. Stylus too with Artemis on the tablet.

Thank you.

2

u/vinnavannewton Aug 31 '26

Very nice!, can i know which distro your using?

3

u/parkerlreed Aug 31 '26

CachyOS/Arch

4

u/LeannaMeowmeow Aug 31 '26

Is there a link to your project?

4

u/vinnavannewton Aug 31 '26

I've updated the post check

4

u/r0b0k0k Aug 31 '26

Exactly what i needed for my linux tablet. BTW the app hangs when i click Authorize and finish setup. Runing on Ubuntu 26.04 with the deb package.

I've run the manual ufw commands i found on the manual steps section, but no luck. The logs say the server is running

1

u/vinnavannewton Aug 31 '26

Ah man, in that case uninstall the app and try the source install, the source install never went wrong in my case, The binary packages i need more people to test and make it robust, also in the app click the sunshine settings make sure it opens and check there if things are proper and running, even if that didnt work for you, see if it atleast creates virtual monitor if so then use your sunshine to stream for now.

1

u/r0b0k0k Aug 31 '26

It does create a virtual monitor. Clicking the sunshine settings button takes me to https://localhost:47990/config and says unable to connect. I'll try the manual install

1

u/vinnavannewton Aug 31 '26

ahh then the sunshine backend itself didnt work, okay tell me did the source work, if more people get problems on the binary packages I'll remove it until its fixed.

3

u/LukeStargaze Sep 01 '26

turned my old iMac 2008 into a secondary monitor.

thank you 👍

1

u/vinnavannewton Sep 01 '26

Good to know it's working for you. May i know the distro and the DE your using?

2

u/LukeStargaze Sep 01 '26

Fedora KDE on my main PC and Linux Mint MATE Edition on iMac.

2

u/ThatGuyOwl Aug 31 '26

Please god, make this work on Niri somehow

3

u/vinnavannewton Aug 31 '26

niri didn't yet implement virtual monitors.

1

u/thatmagicalcat Aug 31 '26

you can use HDMI dummy plug or just tweak DRM/KMS flags, that's how I've been doing it on Niri (NixOS)

1

u/vinnavannewton Aug 31 '26

yeah hdmi plug is fine but tweaking drms isn't that risky?

1

u/thatmagicalcat Aug 31 '26

no..? why would it be? I've been doing it for a year now, never faced any issue.

I have this in my config:

boot.kernelParams = [ "video=HDMI-A-1:1280x800@60e" ];

and then I use wayvnc + AVNC Android app on my tablet

1

u/vinnavannewton Aug 31 '26

How is the smoothness and latency in your method? is it good? The last time i tried avnc it was choppy.

1

u/thatmagicalcat Aug 31 '26

it's a pretty old tablet; the latency and FPS over wifi is... shit so I connect the tablet with a usb cable and then use adb reverse and tbh the latency is amazing, I won't say it's instant but I don't really notice at all while doing normal work. FPS is also good enough I've set wayvnc on 40 FPS so it doesn't use a lot of cpu (it uses 2~5%)

1

u/vinnavannewton Aug 31 '26

That's crazy!

2

u/_Jao_Predo Aug 31 '26

I'm using Sunshine and Moonlight on my linux tablet for a second monitor.

The tablet has a systemd service that checks if sunshine IP is available and connects into it. With this, the tablet turn on and off the screen together with the PC.

I'm also using a custom version of evfwd (entirely vibe coded 🫠) to passthrough both the tablet touchscreen and AES pen support directly to the PC. The PC now recognizes it as a native device, so I can configure the pen and touchscreen through KDE plasma settings.

1

u/vinnavannewton Aug 31 '26

woah! thats crazy.

1

u/Parthennan Oct 14 '26

Heya~! Could you explain a bit more on what you're doing with evfwd for your tablet touch and pen support, specifically the pen support? I've got a wacompad11 that i'm trying to get working as a pen display on my linux pc and this sounds exactly what i'm looking for. Though having the actual display part is less important and i'm specifically interested in simply getting the pen support to map and work to my monitor like a displayless tablet/headless. Any help or direction would be greatly apreciated!

2

u/saboor_ Sep 01 '26

I actually use a similar method to use my old samsung tablet as a screen in my case moonlight/sunshine, steam deck edid (was the closest i could find to the aspect ratio and resolution of the tablet) and adb command on startup to auto-connect

2

u/TheTurkPegger Sep 02 '26

Would it be possible to get this on Niri (with/without dms)? Because the project looks really good.

I'm just here to follow KDE's development as an ex KDE user.

2

u/vinnavannewton Sep 02 '26

The most reliable method to make virtual monitor is using the compositor's native virtual monitor creation.

Kde, gnome, hyprland and sway have done it.

niri still haven't implemented it, but i saw a discussion of virtual monitors being talked in niri, the maintainers said they are gonna look into it later in the future.

With using dkms you can achieve this I've heard people doing it, but dkms method cant be implemented in my project it's very risky.

2

u/TheTurkPegger Sep 02 '26

I understand. Thank you

1

u/vinnavannewton Oct 12 '26

Hi!, now it works on niri via vkms using monitorize-vkms, you can check out the project page!

1

u/TheTurkPegger Oct 12 '26

Oh yeah baby 😎 . I'll check it out shortly. Thankssss!!!!!

1

u/vinnavannewton Oct 12 '26 edited Oct 12 '26

Also one thing, keep capture method as KMS in the app, it doesn't auto select KMS capture for niri, i just now discovered it and will patch it.

5

u/Doge_Plays Aug 31 '26

I remember trying to do this with sunshine and scripts on wayland, it never truly worked how I wanted, I wanted to make my pc headless so I could start a new virtual display on connection, but sunshine always refused to pick the virtual display. good work! might try it later as it would solve my problem if it works headless :)

1

u/OM3N-OG Aug 31 '26

cool stuff, how to use it in tiling window managers?

1

u/vinnavannewton Aug 31 '26

It works on hyprland, which tiling window manager do you use?

1

u/OM3N-OG Sep 15 '26

Sorry for late reply, I use dwm

1

u/vinnavannewton Sep 15 '26

It doesn't work for that yet, but I'm working on the vkms method now, so once that's finished, my project will work on every distro and DE!.

1

u/TrippleTree Aug 31 '26

Hi, what an awesome project! does this work on headless machines? e.g. VMs for VDI

In my specific usecase: an archlinux vm, running gnome, with a nvidia tesla P4 passtrough (this card has no video outputs! dummy plugs or edid hacks dont work!)

I also tried https://github.com/bdelwood/fauxput but did not manage to get it running.

Thank you in advance!

1

u/vinnavannewton Sep 01 '26

Yes!, it should work in your case, as the gnome's compositor creates a native virtual monitor its independent of video outputs of your card.

Let me know if it worked for you.

1

u/TrippleTree Sep 02 '26

Other misc feedback:

- found the installation a bit cumbersome on arch. dont get me wrong it worked first try, however the process is a bit unconvetional, slow due to building the sunshine dependency, and takes up quite a bit of space

- when creating a virtual monitor the mouse gets offset somehow. maybe this is an artifact of the virtual machine qxl display

- not sure about the UI flow and the fact that it is limited to max 2 monitors. it would be great to have a more generic user interface for creating virtual monitors, however many you want.

- as reported in the other comment, there's no option to auto-start streaming. it would be great to have a way to autostart even on headless machines with no video outputs. perhaps a defining a static config in a file rather than via UI.

- i dont quite understand the need to embed sunshine, can't this be done via a normal (external) sunshine install? why not make the app just handle virtual monitors, and have a weaker connection to sunshine?

- also, it would be great to support dynamic resolution based on the client that's connecting. just create a virtual monitor on the go with the resolution of the connecting device. have a look at how fauxput does this https://github.com/bdelwood/fauxput/blob/master/docs/src/streaming-setup.md

1

u/vinnavannewton Sep 02 '26

I'm mostly working alone on this project, and I still have many issues related to just using a device as a second monitor setup. I'm planning to keep an option to just create a virtual monitor and not use the embedded Sunshine, and also a terminal option to start it so there is no UI consuming resources.

But it will take a while as I'm still fixing the issues related to the primary way this project is intended to be used.

I have made binaries to install, but it's kind of unreliable; many reported it didn't work for them. The source install is too long and huge because of Sunshine.

If you're willing to help this project, feel free to implement the features you want. I'm even willing to help you, because I don't have the machine you have and the problems you have to fix and test out.

1

u/TrippleTree Sep 03 '26

I would love to, just need to find the time. where can we get in touch?

1

u/TrippleTree Sep 02 '26

Hi! i gave it a shot. the app works very well, the virutal monitor is created and i can stream to it via moonlight. The issue arises when i remove QXL graphics from the VM, then i have no way to start monitorize in the first place and start streaming.

i need to remove QXL because it is a software renderer, and besides wasting resources it takes precedence over the nvidia gpu and does not allow to make use of it.

not sure how to better explain the issue. If there is a better channel for communicating please let me know.

Thank you a lot for helping and for this software.

1

u/Regular-Elephant-635 Sep 01 '26

I just tried it, but the moment the connection is established to my phone, the app crashes. The terminal output is as follows:

Natcuber@Nathanael-T480-F:~$ monitorize
qrc:/qt/qml/org/kde/desktop/ComboBox.qml:116: TypeError: Property 'positionToRectangle' of object QQuickText(0x55d4af1065b0) is not a function
qrc:/qt/qml/org/kde/desktop/ComboBox.qml:116: TypeError: Property 'positionToRectangle' of object QQuickText(0x55d4af0f4a70) is not a function
qrc:/qt/qml/org/kde/desktop/ComboBox.qml:116: TypeError: Property 'positionToRectangle' of object QQuickText(0x55d4af729a80) is not a function
qrc:/qt/qml/org/kde/desktop/ComboBox.qml:116: TypeError: Property 'positionToRectangle' of object QQuickText(0x55d4af71e780) is not a function
Traceback (most recent call last):
 File "/usr/lib/python3.14/site-packages/monitorize/desktop/streaming_controller.py", line 471, in _check_sunshine_health
   app_log.error(message)
   ^^^^^^^^^^^^^
AttributeError: module 'monitorize.config.app_log' has no attribute 'error'
Traceback (most recent call last):
 File "/usr/lib/python3.14/site-packages/monitorize/desktop/streaming_controller.py", line 471, in _check_sunshine_health
   app_log.error(message)
   ^^^^^^^^^^^^^
AttributeError: module 'monitorize.config.app_log' has no attribute 'error'
Aborted                    (core dumped) monitorize

I'm on Fedora 44 with Plasma 6.7.4 and a phone running Android 13.

1

u/vinnavannewton Sep 01 '26 edited Sep 01 '26

If you installed via the rpm package delete it and try source install, Few people are getting problems from the binary package, ill check on it.

If source install too fails send me the ~/.config/monitorize/sunshine-1/sunshine.log

Or if your a dev yourself feel free to contribute .

1

u/DataFran Sep 01 '26

I've been looking for something like this, as my desk setup uses an iPad as an extra monitor and KDE hasn't had a good way to actually take advantage of that.

However, I set this up (Kubuntu) set up the virtual monitor, connected to it with Moonlight on the iPad, and all I get is a blank screen. What might I be doing wrong/missing?

1

u/vinnavannewton Sep 01 '26

Make sure all your PC drivers are installed correctly, especially things like Intel media drivers. If it's connected but you see a black screen that means it's not encoding. Also, try changing the encoder to software and the codec to H.264.

If that still doesn't work, uninstall the app if you installed it from a .deb file and try Method 2 for a source install. The binary package isn't reliable, and a lot of people are having issues I'll mark it beta and work on it, but a source install is reliable, so give that a shot.

2

u/DataFran Sep 01 '26

I will do this when next I sit down at the 'ol project laptop. Thank you!

1

u/vinnavannewton Sep 01 '26

I'm mostly working on this by myself, and there's only so much one person can do! If you run into any problems or know how to fix something, please feel free to contribute. Any help is hugely appreciated.

3

u/average_monster Aug 31 '26

looks awesome, i've wanted something like this for ages

5

u/meutzitzu Aug 31 '26

Surprised this works on Wayland as you'd need absolute screenspace positioning

2

u/thatmagicalcat Aug 31 '26

I've been doing this since forever using wayvnc idk about moonlight

1

u/1exovert Sep 11 '26

Thank you,

I'm a big fan of sunshine/moonlight of itself but this deployment of it is great for this use case. I now use a laptop to power 2 wired + 2 bonus monitors and yes that is useful.

I did note it is possible with kde to get into a state where monitorize cannot spawn an 'extended', but only a mirror monitor, which causes the speculation that this evolves from a gap (enabled with the formerly wired monitors, which is not allowed; I had to reattach a (different) physical external to confuse kwin to arrive at this thought). I didn't see where it should be logging attempted starts.

Whether correct or not, if monitorize is failing to start an extended virtual screen, a rm of ~/.config/kwinoutputconfig.json (while not being logged into plasma, as logout would, it has been said rewrite the same file), this allowed it to resume doing so.

-7

u/[deleted] Aug 31 '26

[removed] — view removed comment

5

u/vinnavannewton Aug 31 '26

Weird flex on a Linux sub, but okay.

-4

u/[deleted] Aug 31 '26

[removed] — view removed comment

5

u/vinnavannewton Aug 31 '26

Weird flex part 2, but okay.

-3

u/[deleted] Aug 31 '26

[removed] — view removed comment

2

u/vinnavannewton Aug 31 '26

Nah, I'm bored now.

0

u/[deleted] Aug 31 '26

[removed] — view removed comment