Open tex opened 3 years ago
Probably connected with upgrade to 1.11.0 (https://github.com/NixOS/nixpkgs/commit/2829500ac2bdeb1e09ee9e169a0e72c357c052e5)
From Arch forum: You probably have an old /etc/pam.d/tigervnc, you need to delete that and rename the newest tigervnc.pacnew to tigervnc, otherwise vncsession-start fails ("Failure daemonizing"/"pam_open_session failed: 28 (Module is unknown)")
I tried to run vncsession and for this failure deamonizing error. There is no /etc/pam.d/tigervnc in my system.
Also from Arch forum (https://bbs.archlinux.org/viewtopic.php?pid=1925998#p1925998)
Anyone have a service already created for this?
In pkgs/tools/admin/tigervnc/default.nix, we list a couple of required packages in the PATH. At the time of writing, these are xterm twm xsetroot xauth
. The error you pointed out is quickly fixed by adding xinit
to this list.
However. It appears that the current version of tigervnc expects an Xsession
file in /etc/X11
. Hence tigervnc won't work even with this fix. Our tests would have caught this problem -- but unfortunately, I never got around to work on them again, the tests only exist as a pull request (#85214).
I might look into this later, but won't promise anything.
I marked this as stale due to inactivity. → More info
It is only a poor workaround, but you can use
xinit /home/user/.vnc/xstartup -- $(realpath $(which Xvnc)) :1 PasswordFile=/home/user/.vnc/passwd
to get a vncserver running similarly as before.
@typetetris could you explain how to use that? would it be used in ExecStart
for the service proposed above?
You probably could make it work.
I never bothered. I start the vncserver when I need it, from the command line. An always running vncserver makes me uncomfortable.
As a workaround, you should be able to add the xorg.xinit
package to the list of packages required in PATH
of the systemd service using systemd.services.<name>.path
(source).
The proper fix would probably be adding xorg.xinit
to the list of dependencies for tigervnc
@michaelCTS Unfortunately I'm afraid I think this will not work, as I alluded to here.
Personally, I have no use for the modern Xsession infrastructure and just use the following simple custom replacement script for booting up a VNC session:
#!/usr/bin/env bash
# prepare Xauthority file
cookie=$(mcookie)
xauth -f $HOME/.Xauthority source - <<EOF
add $HOSTNAME:1 . $cookie
add $HOSTNAME/unix:1 . $cookie
EOF
# logic lifted from sx
trap 'DISPLAY=:1 exec xterm & wait "$!"' USR1
(trap "" USR1 && exec Xvnc :1 -auth $HOME/.Xauthority -desktop $HOSTNAME:1) & pid=$!
wait "$pid"
Perhaps we should include a version of this in our package?
I just created a systemd service based on the workaround of @typetetris.
{ pkgs, ... }:
let
home = "/home/user";
in
{
environment.systemPackages = [pkgs.xorg.xinit];
systemd.services.vncserver = {
enable = true;
environment = {
PATH = pkgs.lib.mkForce "/run/wrappers/bin:${home}/.nix-profile/bin:/nix/profile/bin:${home}/.local/state/nix/profile/bin:/etc/profiles/per-user/user/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin";
};
unitConfig = {
Description = "Remote desktop service (VNC)";
After = "syslog.target network.target";
};
serviceConfig = {
Type = "simple";
User = "user";
WorkingDirectory = "${home}";
ExecStartPre = "/bin/sh -c '${pkgs.tigervnc}/bin/vncserver -kill :1 > /dev/null 2>&1 || :'";
ExecStart = "${pkgs.xorg.xinit}/bin/xinit ${home}/.vnc/xstartup -- ${pkgs.tigervnc}/bin/Xvnc :1 -interface 127.0.0.1 -rfbauth ${home}/.vnc/passwd";
ExecStop = "${pkgs.tigervnc}/bin/vncserver -kill :1";
};
wantedBy = ["multi-user.target"];
};
}
xstartup
#!/bin/sh
exec $(realpath $(which i3))
Just hard-coded the PATH variable to get it working, not sure if there is a better way.
tigervnc does not start due to ".vncserver-wrapped: couldn't find "xinit" on your PATH."
I have this in my NixOS configuration.nix:
I have xorg enabled:
It is server without monitor connected.
Worked good until last update. I am on channel:
nixos https://nixos.org/channels/nixos-20.09
It doesn't start even from command line if I install it with nix-shell -p tigervnc