[Nix-dev] tigervnc service?

Tim Sears tim at timsears.com
Sun Apr 23 07:07:31 CEST 2017


Thanks Volth. That preStart bit got me a bit further. I am running the
awesome window manager and getting the error:

awesome: main:619: cannot open display (error 1)

That leads to the server and ssh tunnel shutting down before anything
appears on the remote client side.

Using lightdm and awesome for my physical workstation. Not sure I am
starting X properly as far as vncserver is concerned.

My xstartup file looks like this...

#!/nix/store/hi4j75r312lsjhpdln9p8blyixs59hbs-bash-4.4-p12/bin/bash
        echo xstartup-start | systemd-cat -t "vncserver"
        while [ true ]; do
/nix/store/dglxfr7ivy7hrx2scrli9acsrx0nxicj-awesome-4.1/bin/awesome :1 ;
sleep 1; done



On Sat, Apr 22, 2017 at 2:30 PM, Volth <volth at volth.com> wrote:

> I used it to have a graphical console to libvirt-lxc containers in
> virt-manager (which has vnc client):
>
> ---
>   vnc-backdoor = { config, pkgs, lib, ... }: {
>     config = {
>         systemd.services."vncserver" = {
>           description = "VNC Server";
>           after = [ "network.target" ];
>           wantedBy = [ "multi-user.target" ];
>
>           path = [ pkgs.xorg.xauth pkgs.perl ];
>
>           environment.HOME = "/root";
>           environment.USER = "root";
>
>           preStart = ''
>             ${pkgs.coreutils}/bin/rm   -rf $HOME/.vnc
>             ${pkgs.coreutils}/bin/mkdir -p $HOME/.vnc
>             echo -e '#!${pkgs.bash}/bin/bash\n${pkgs.xterm}/bin/xterm
> &\nwhile [ true ]; do ${pkgs.icewm}/bin/icewm; done' >
> $HOME/.vnc/xstartup
>             ${pkgs.coreutils}/bin/chmod 755 $HOME/.vnc/xstartup
>           '';
>
>           serviceConfig = {
>             Type = "forking";
>             ExecStart = "${pkgs.tigervnc}/bin/vncserver -geometry
> 1024x768 -securitytypes none :1";
>             ExecStop = "${pkgs.tigervnc}/bin/vncserver -kill :1";
>           };
>         };
>     };
>   };
> ----
>
> On 4/22/17, Tim Sears <tim at timsears.com> wrote:
> > Has anyone managed to get tigervnc or any other vnc server running as a
> > service under nixos?
> >
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170422/509626ce/attachment.html>


More information about the nix-dev mailing list