You are not logged in.

#1 2023-04-11 16:31:22

EsotericJankyHomeServers
Member
Registered: 2023-04-11
Posts: 2

Need help with starting VNC on SDDM

Im trying to turn the real SDDM screen into a vnc server so that if my display is off and im away from my pc, a systemd script opens up a vnc server with sddm and plasma desktop
I've already tried several systemd scripts but all failed, including the one from archwiki, here's the ones ive tried:

`
[Unit]
Description=x11vnc VNC Server for X11
Requires=display-manager.service
After=display-manager.service

[Service]
Type=forking
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment SDDMXAUTH=$(/usr/bin/find /var/run/sddm/ -type f)"
ExecStart=/usr/bin/x11vnc -display :0 -auth ${SDDMXAUTH} -ncache 10 -forever -shared -bg -o /var/log/x11vnc.log -rfbauth /etc/x11vnc.passwd -xkb -norc -noxrecord -noxdamage -nomodtweak -multiptr
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
Restart-sec=2

[Install]
WantedBy=graphical.target
`

this one worked but the screen size was sooooooo small and once i logged in to my user on Plasma X11 the entire screen was black, i was able to open apps with krunner keyboard shortcut and xrandr didnt let me switch to any resolutions

another one i tried is

`
[Unit]
Description=Remote desktop service (VNC) for :0 display
Requires=display-manager.service
After=network-online.target
After=display-manager.service

[Service]
Type=simple
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment XAUTHORITY=$(find /var/run/sddm/ -type f)"
Environment=HOME=/root
ExecStart=x0vncserver -display :0 -rfbauth /root/.vnc/passwd
Restart=on-failure
RestartSec=500ms

[Install]
WantedBy=multi-user.target
`
but execstart just didnt work, exit status 1 all the time

the one from the wiki for tigervnc used lightdm, but im using sddm. also im trying to have variable resolutions like on tigervnc viewer where it resizes the screen to window size, but that only worked with the server on vncserver : command .
This entire setup is probably unnecessary but i just want to know if its possible at all lol


Hey hey people, bloated Arch install here. Why are my flatpaks taking up 31gb?

Offline

#2 2023-04-18 20:22:53

BluishHumility
Member
Registered: 2023-03-31
Posts: 26

Re: Need help with starting VNC on SDDM

EsotericJankyHomeServers wrote:

another one i tried is

[Unit]
Description=Remote desktop service (VNC) for :0 display
Requires=display-manager.service
After=network-online.target
After=display-manager.service

[Service]
Type=simple
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment XAUTHORITY=$(find /var/run/sddm/ -type f)"
Environment=HOME=/root
ExecStart=x0vncserver -display :0 -rfbauth /root/.vnc/passwd
Restart=on-failure
RestartSec=500ms

[Install]
WantedBy=multi-user.target

but execstart just didnt work, exit status 1 all the time

It looks like you may have gotten this from here: https://gist.github.com/mjtiempo/8662e8 … d5cc78ceaf

Did you see the comment? It might be worth a shot:

toneoesa commented on Mar 5
---
Thanks! It works for me if give parameter -fd for x0vncserver.

Offline

#3 2023-04-21 06:20:42

EsotericJankyHomeServers
Member
Registered: 2023-04-11
Posts: 2

Re: Need help with starting VNC on SDDM

I checked the manpage for x0vncserver and -fd isnt mentioned anywhere, i tried booting up into my desktop now and typing x0vncserver  -fd -display :0 and i got nothin,
heres the service status after i added -fd to it: (i just found out about BBCode big_smile )

 × x0vncserver.service - Remote desktop service (VNC) for :0 display
     Loaded: loaded (/etc/systemd/system/x0vncserver.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Fri 2023-04-21 09:03:41 EEST; 14min ago
   Duration: 8ms
    Process: 690 ExecStartPre=/usr/bin/bash -c /usr/bin/systemctl set-environment XAUTHORITY=$(find /var/run/sddm/ -type f) (code=exited, status=0/SUCCESS)
    Process: 692 ExecStart=x0vncserver -rf -display :0 -rfbauth /root/.vnc/passwd (code=exited, status=1/FAILURE)
   Main PID: 692 (code=exited, status=1/FAILURE)
        CPU: 18ms

Apr 21 09:03:41 arch-desktop systemd[1]: x0vncserver.service: Scheduled restart job, restart counter is at 5.
Apr 21 09:03:41 arch-desktop systemd[1]: Stopped Remote desktop service (VNC) for :0 display.
Apr 21 09:03:41 arch-desktop systemd[1]: x0vncserver.service: Start request repeated too quickly.
Apr 21 09:03:41 arch-desktop systemd[1]: x0vncserver.service: Failed with result 'exit-code'.
Apr 21 09:03:41 arch-desktop systemd[1]: Failed to start Remote desktop service (VNC) for :0 display.

Hey hey people, bloated Arch install here. Why are my flatpaks taking up 31gb?

Offline

Board footer

Powered by FluxBB