Install xorg-x11-Xvnc: pkg.installed: - name: xorg-x11-Xvnc Disable wayland login: file.managed: - name: /etc/gdm/custom.conf - source: salt://remote-desktop/files/custom.conf - user: root - group: root - mode: "0644" Check that passwd file has correct settings: file.managed: - name: /home/{{ pillar['username'] }}/.vnc/passwd - source: salt://remote-desktop/files/passwd - replace: False - user: {{ pillar['username'] }} - group: users - mode: "0600" - makedirs: True - dir_mode: "0700" Set vnc password if no passwd file: cmd.run: - name: bash -c "echo {{ pillar['remote-desktop']['password'] }} | vncpasswd -f > /home/{{ pillar['username'] }}/.vnc/passwd" - runas: {{ pillar['username'] }} - unless: bash -c "[[ -s /home/{{ pillar['username'] }}/.vnc/passwd ]]" Create x0vncserver desktop file: file.managed: - name: /home/{{ pillar['username'] }}/.config/autostart/x0vncserver.desktop - source: salt://remote-desktop/files/x0vncserver.desktop.template - template: jinja - user: {{ pillar['username'] }} - group: users - mode: "0600"