Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-07-05 15:26:25

trk204
Member
Registered: 2018-03-15
Posts: 10

[SLVED]xfce refuses to start inside vncserver when launched by systemd

Hey guys,  trying to get a xfce session to start inside of a vncserver instance on bootup.  Running debian stretch with xfce 4.12, and tigervnc

I have created a separate user to run the vnc session, created systemd .service files.  When i run the vncserver command as the user,   it will startup a xfce session just fine.  I can vnc into it and it works.  But when I try to run the exact same command in a systemd service unit,  I always get a vnc error about the X server already running.   But If I comment out the startxfce in the xstartup file for vnc and just add xeyes,  kick the vnc service and vncserver starts up just fine by systemd and will run xeyes no issue.  So I don't _think_ it's a vnc issue. 

Am I missing anything in the environment I should be passing to systemd to get xfce to run inside a vncserver instance at boot?

Xvnc TigerVNC 1.7.0 - built Apr  9 2017 14:38:13
Copyright (C) 1999-2016 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11903000, The X.Org Foundation


Thu Jul  5 15:16:47 2018
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on all interface(s), port 5902
 vncext:      created VNC server for screen 0
Killing Xtigervnc process ID 4109.../usr/bin/startxfce4: X server already running on display :2
xrdb: Connection refused
xrdb: Can't open display ':2'
xfce4-session: Cannot open display: .
Type 'xfce4-session --help' for usage.
 success!

---- vncserver will start fine when only calling xeyes ----


Xvnc TigerVNC 1.7.0 - built Apr  9 2017 14:38:13
Copyright (C) 1999-2016 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11903000, The X.Org Foundation


Thu Jul  5 15:19:43 2018
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on all interface(s), port 5902
 vncext:      created VNC server for screen 0


root@XXXXX:/home/jnrlab/.vnc# cat /etc/systemd/system/vncserver@\:2.service 
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target home.mount
[Service]
Type=simple
User=5002
Group=2002
Environment=HOME=/home/jnrlab
PAMName=login
PIDFile=/home/%u/.vnc/%H%i.pid
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/bin/vncserver %i -AlwaysShared -name jnrlab-VNC -geometry 1280x1024 -fg -localhost no -verbose
ExecStop=/usr/bin/vncserver -kill %i

[Install]
WantedBy=multi-user.target
root@XXXXXXX:/home/jnrlab/.vnc# cat xstartup 
#!/bin/bash

#xrdb $HOME/.Xresources
xsetroot -solid grey

. /etc/profile
export SHELL=/bin/bash

xeyes
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
#vncconfig -nowin &
#startxfce4 &

Last edited by trk204 (2018-07-09 19:10:06)

Offline

#2 2018-07-05 17:58:12

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 4,828

Re: [SLVED]xfce refuses to start inside vncserver when launched by systemd

Can you post your systemd service file and your vns xstartup file contents?

Personally, I have much more luck running xrdp on the server.

Offline

#3 2018-07-09 19:09:20

trk204
Member
Registered: 2018-03-15
Posts: 10

Re: [SLVED]xfce refuses to start inside vncserver when launched by systemd

Hey ToZ,  I think I might have to chalk this up to xfce newbness.  I had included the service file and xstartup in the above code block. 

Whenever we had run kde like this,  it had accepted the & after startkde and I guess kde's session handler took over and didn't terminate the vncserver process.  After removing the & for startxfce4 it worked as it should.

Thanks for the help

Offline

Board footer

Powered by FluxBB