From 85b7d685ef85236ce48528369ff23abd6b26fcc6 Mon Sep 17 00:00:00 2001 From: fredrikr79 Date: Fri, 14 Feb 2025 07:56:34 +0100 Subject: [PATCH] add password auth to x11vnc --- configuration.nix | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/configuration.nix b/configuration.nix index eaad300..5580072 100644 --- a/configuration.nix +++ b/configuration.nix @@ -154,18 +154,6 @@ in }; }; - # services.x11vnc = { - # enable = true; - # display = ":0"; # use existing x session - # auth = null; # uses current x session auth - # loop = true; - # extraOptions = [ - # "-forever" # keep open - # "-shared" # multiple clients - # "-nopw" # no password - # "-rfbport 5900" # vnc port - # ]; - # }; systemd.services.x11vnc = { description = "x11vnc server for mirroring x display"; after = [ "display-manager.service" ]; @@ -173,11 +161,20 @@ in serviceConfig = { # ExecStart = "${pkgs.x11vnc}/bin/x11vnc -display :0 -forever -nopw -rfbport 5900 -auth /home/fredrikr/.Xauthority"; ExecStart = '' - ${pkgs.x11vnc}/bin/x11vnc -display :0 -forever -shared -nopw -rfbport 5900 -listen 0.0.0.0 -auth /home/fredrikr/.Xauthority \ - -ncache 10 -ncache_cr -repeat -xkb -noxdamage + ${pkgs.x11vnc}/bin/x11vnc -display :0 -forever -shared -usepw \ + -rfbport 5900 -listen 0.0.0.0 \ + -auth /home/fredrikr/.Xauthority \ + # -ncache 10 -ncache_cr \ + -repeat -xkb -noxdamage \ -tightfilexfer -xrandr -many \ - -clip 1920x1080 # Adjust if needed + -clip 1920x1080+0+0 \ + -geometry 1920x1080 \ + -noxinerama \ + -grabptr -grabkbd -noxrecord -noxfixes \ + -rfbauth /home/fredrikr/.vnc/passwd + # -ssl -sslverify -sslcert /home/fredrikr/x11vnc-ssl.pem -sslCipher ALL \ ''; + # TODO: add ssl encryption to vnc connection Restart = "always"; User = "fredrikr"; Environment = "DISPLAY=:0"; @@ -280,6 +277,7 @@ in { alsa-utils x11vnc gawk + openssl ]); programs.steam.enable = true;