Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
problems with autostarting vnc server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Sun Apr 12, 2015 2:31 am    Post subject: problems with autostarting vnc server Reply with quote

I have installed tigervnc and created a script to autostart the vnc servers:
/etc/systemd/system/tigervnc@.service:
[Unit]
Description=Remote desktop service (VNC)
After=network.target

[Service]
Type=forking
User=adel

# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=-/usr/bin/vncserver -kill %i
ExecStart=/usr/bin/vncserver %i
ExecStop=/usr/bin/vncserver -kill %i

[Install]
WantedBy=multi-user.target

if I start the vnc serve by running vncserver :3 as the user adel, everything is fine
If i start via systemctl start tigervnc@3 I get the following in the journal
Apr 12 04:30:53 pc vncserver[6916]: Can't tell if 3 is on pc
Apr 12 04:30:53 pc vncserver[6916]: Use -kill :<number> instead
Apr 12 04:30:53 pc vncserver[6921]: usage: vncserver [:<number>] [-name <desktop-name>] [-depth <depth>]
Apr 12 04:30:53 pc vncserver[6921]: [-geometry <width>x<height>]
Apr 12 04:30:53 pc vncserver[6921]: [-pixelformat rgbNNN|bgrNNN]
Apr 12 04:30:53 pc vncserver[6921]: [-fp <font-path>]
Apr 12 04:30:53 pc vncserver[6921]: [-cc <visual>]
Apr 12 04:30:53 pc vncserver[6921]: [-fg]
Apr 12 04:30:53 pc vncserver[6921]: [-autokill]
Apr 12 04:30:53 pc vncserver[6921]: <Xvnc-options>...
Apr 12 04:30:53 pc vncserver[6921]: vncserver -kill <X-display>
Apr 12 04:30:53 pc vncserver[6921]: vncserver -list
Apr 12 04:30:53 pc systemd[1]: tigervnc@3.service: control process exited, code=exited status=2
Apr 12 04:30:53 pc systemd[1]: Failed to start Remote desktop service (VNC).
Apr 12 04:30:53 pc systemd[1]: Unit tigervnc@3.service entered failed state.


thanks
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Tue Apr 14, 2015 11:33 am    Post subject: Reply with quote

bump
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Tue Apr 14, 2015 1:57 pm    Post subject: Reply with quote

I start the X11VNC server as a normal user after I have open an X session with this user. If you start the VNC server with Systemd, it will be start by the super user root. The super user root do not open any X session by default. The VNC server may not be able to start because it do not have any X session to serve.

And if there is an X session open, if it's not open by root himself, root do not have access to it by default.

It may be possible to start the VNC server using Systemd, but I prefer to start it during a normal user X session. X11VNC do not need root permissions to serve. It can be automate using the desktop environment method.
_________________
Paul
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum