VNC Wiki Update - Have you got VNC working?

droth49
Posts: 26
Joined: Mon Dec 16, 2013 8:02 am
Location: Lebanon, Illinois

Re: VNC Wiki Update - Have you got VNC working?

Postby droth49 » Mon Jan 06, 2014 11:30 am

OK, went back and changed everything that was"l" to "1" and reran the "systemctl start vncserver@:1.service" as root. received the same error message as before. here is my vncservice@:1.server file. Bigfoot, I believe I post the complete error messages, don't think anything was cut off. However I will recheck and if different repost.

# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@:<display>.service
# 2. Edit <USER> and vncserver parameters appropriately
# ("runuser -l <USER> -c /usr/bin/vncserver %i -arg1 -arg2")
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB$
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and w$
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
#
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.


[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
User=root
# 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

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: VNC Wiki Update - Have you got VNC working?

Postby bigfoot65 » Mon Jan 06, 2014 11:38 am

This is what I am talking about:
[root@localhost droth49]# systemctl status vncserver@:l.service
vncserver@:l.service - Remote desktop service (VNC)
Loaded: loaded (/usr/lib/systemd/system/vncserver@:l.service; disabled)
Active: failed (Result: exit-code) since Sat 2014-01-04 15:50:03 CST; 49s ago
Process: 1168 ExecStart=/usr/bin/vncserver %i (code=exited, status=2)
Process: 1167 ExecStartPre=/usr/bin/vncserver -kill %i (code=exited, status=2)

Jan 04 15:50:03 localhost.localdomain systemd[1]: Starting Remote desktop ser...
Jan 04 15:50:03 localhost.localdomain vncserver[1167]: vncserver: The HOME en...
Jan 04 15:50:03 localhost.localdomain vncserver[1168]: vncserver: The HOME en...
Jan 04 15:50:03 localhost.localdomain systemd[1]: vncserver@:l.service: contr...
Jan 04 15:50:03 localhost.localdomain systemd[1]: Failed to start Remote desk...
Jan 04 15:50:03 localhost.localdomain systemd[1]: Unit vncserver@:l.service e...
Notice the last 6 lines have ... after them which cuts off the messages. You have to have a full screen when doing status to get the complete message or you can direct output to a file.

Code: Select all

systemctl status vncserver@:l.service > error.txt
I believe this will help sort out your issues.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

droth49
Posts: 26
Joined: Mon Dec 16, 2013 8:02 am
Location: Lebanon, Illinois

Re: VNC Wiki Update - Have you got VNC working?

Postby droth49 » Mon Jan 06, 2014 12:15 pm

OK, see what you are talking about. Will get it and post in a few minutes.

droth49
Posts: 26
Joined: Mon Dec 16, 2013 8:02 am
Location: Lebanon, Illinois

Re: VNC Wiki Update - Have you got VNC working?

Postby droth49 » Mon Jan 06, 2014 8:15 pm

OK, sorry so long getting back but 10" of snow keep me busy a long with my own ignorance . I have enclosed the "vncserver file" first, followed by the response when server tried to start, followed by the "systemctl status report" (notes in area of concern) and lastly the "journalctl -xn". Two things standout for me: first, line "Loaded: loaded (/usr/lib/systemd/system/vncserver@:1.service; disabled)", my thinking is this should be enabled, but I am not sure how to do that. Second, "The HOME environment variable is not set" this shows up in both the "systemctl status report" and the "Journalctl -xn" file. Once again I do not know how to fix these! I have a headless system and really would like to get this to work. Hope this helps!

# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@:<display>.service
# 2. Edit <USER> and vncserver parameters appropriately
# ("runuser -l <USER> -c /usr/bin/vncserver %i -arg1 -arg2")
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
#
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.


[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
# 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
***********************************************************************

[root@localhost system]# systemctl start vncserver@:1.service
Job for vncserver@:1.service failed. See 'systemctl status vncserver@:1.service' and 'journalctl -xn' for details.
[root@localhost system]#

**************************************************************************

[root@localhost system]# systemctl status vncserver@:1.service
vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (/usr/lib/systemd/system/vncserver@:1.service; disabled) ---my thinking is this should be enabled, how?---
Active: failed (Result: exit-code) since Mon 2014-01-06 20:43:35 CST; 3min 4s ago
Process: 2371 ExecStart=/usr/bin/vncserver %i (code=exited, status=2)
Process: 2370 ExecStartPre=/usr/bin/vncserver -kill %i (code=exited, status=2)

Jan 06 20:43:35 localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)...
Jan 06 20:43:35 localhost.localdomain vncserver[2371]: vncserver: The HOME environment variable is not set. ---this does not look right, how do I set this?----
Jan 06 20:43:35 localhost.localdomain systemd[1]: vncserver@:1.service: control process exited, code=exited status=2
Jan 06 20:43:35 localhost.localdomain systemd[1]: Failed to start Remote desktop service (VNC).
Jan 06 20:43:35 localhost.localdomain systemd[1]: Unit vncserver@:1.service entered failed state.
[root@localhost system]#


******************************************************************************

[root@localhost system]# journalctl -xn
-- Logs begin at Mon 2013-12-23 21:36:59 CST, end at Mon 2014-01-06 20:43:35 CST. --
Jan 06 20:36:43 localhost.localdomain systemd[1]: Failed to start Remote desktop service (VNC).
-- Subject: Unit vncserver@:1.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
-- Documentation: http://www.freedesktop.org/wiki/Softwar ... e9d022f03d
--
-- Unit vncserver@:1.service has failed.
--
-- The result is failed.
Jan 06 20:36:43 localhost.localdomain systemd[1]: Unit vncserver@:1.service entered failed state.
Jan 06 20:40:01 localhost.localdomain CROND[2342]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Jan 06 20:40:28 localhost.localdomain systemd[1]: Reloading.
Jan 06 20:43:35 localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)...
-- Subject: Unit vncserver@:1.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
--
-- Unit vncserver@:1.service has begun starting up.
Jan 06 20:43:35 localhost.localdomain vncserver[2370]: vncserver: The HOME environment variable is not set. ----This shows up again---
Jan 06 20:43:35 localhost.localdomain vncserver[2371]: vncserver: The HOME environment variable is not set.
Jan 06 20:43:35 localhost.localdomain systemd[1]: vncserver@:1.service: control process exited, code=exited status=2
Jan 06 20:43:35 localhost.localdomain systemd[1]: Failed to start Remote desktop service (VNC).
-- Subject: Unit vncserver@:1.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
-- Documentation: http://www.freedesktop.org/wiki/Softwar ... e9d022f03d
--
-- Unit vncserver@:1.service has failed.
--
-- The result is failed.
Jan 06 20:43:35 localhost.localdomain systemd[1]: Unit vncserver@:1.service entered failed state.
[root@localhost system]#

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: VNC Wiki Update - Have you got VNC working?

Postby bigfoot65 » Mon Jan 06, 2014 8:30 pm

This line appears to be missing from your service file:
PIDFile=/home/<USER>/.vnc/%H%i.pid
and this one:
User=root
You have to include the user who is running the service. If you do not want to run as root, then follow the remaining wiki guidance to do it as a different user.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

wyldeone
Posts: 45
Joined: Sun Dec 11, 2011 6:17 am

Re: VNC Wiki Update - Have you got VNC working?

Postby wyldeone » Tue Jan 07, 2014 3:53 am

This is a copy of my vncserver@:1.service file
#The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@:<display>.service
# 2. Edit <USER> and vncserver parameters appropriately
# ("runuser -l <USER> -c /usr/bin/vncserver %i -arg1 -arg2")
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
#
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.


[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
User=root
# 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#
As you can see its the same as yours.

I stop the vnc server and restarted it and this is what my status looks like.

Code: Select all

[root@localhost ~]# systemctl start vncserver@:1.service [root@localhost ~]# systemctl status vncserver@:1.service vncserver@:1.service - Remote desktop service (VNC) Loaded: loaded (/usr/lib/systemd/system/vncserver@:1.service; enabled) Active: active (running) since Tue 2014-01-07 21:59:38 LHST; 4s ago Process: 21252 ExecStart=/usr/bin/vncserver %i (code=exited, status=0/SUCCESS) Process: 21247 ExecStartPre=/usr/bin/vncserver -kill %i (code=exited, status=0/SUCCESS) CGroup: name=systemd:/system/vncserver@.service/vncserver@:1.service ├─21261 /usr/bin/Xvnc :1 -desktop localhost.localdomain:1 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpa... ├─21271 /usr/bin/vncconfig -iconic ├─21275 vncconfig -iconic ├─21277 mate-session ├─21280 dbus-launch --exit-with-session mate-session ├─21281 /bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session ├─21285 /usr/libexec/dconf-service ├─21292 /usr/libexec/mate-settings-daemon ├─21294 mate-keyring-daemon --start --components=gpg ├─21299 marco --sm-client-id 102e3f5ae3a72e24b9138830836077237100000058920031 ├─21305 mate-panel --sm-client-id 1072fe5491d6b936d313873502411109100000015500031 ├─21307 /usr/libexec/gvfsd ├─21312 /usr/libexec//gvfsd-fuse -f /root/.gvfs ├─21333 caja --sm-client-id 1072fe5491d6b936d3138735024099474600000015500014 --sm-client-state-file /root/.config/session-state/caja-1388394387.desktop ├─21336 /usr/libexec/gvfs-udisks2-volume-monitor ├─21340 /usr/libexec/mate-panel/wnck-applet ├─21341 nm-applet ├─21343 mate-bluetooth-applet ├─21348 /usr/bin/vmtoolsd -n vmusr ├─21350 mate-power-manager ├─21351 mate-session ├─21352 /bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session ├─21353 /bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session ├─21355 /bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session └─21356 /usr/libexec/gvfs-mtp-volume-monitor Jan 07 21:59:35 localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)... Jan 07 21:59:35 localhost.localdomain vncserver[21247]: Killing Xvnc process ID 816 Jan 07 21:59:35 localhost.localdomain vncserver[21247]: Xvnc process ID 816 already killed Jan 07 21:59:38 localhost.localdomain vncserver[21252]: New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1 Jan 07 21:59:38 localhost.localdomain vncserver[21252]: Starting applications specified in /root/.vnc/xstartup Jan 07 21:59:38 localhost.localdomain systemd[1]: Started Remote desktop service (VNC). Jan 07 21:59:39 localhost.localdomain mate-session[21277]: WARNING: Could not get Systemd session class! [root@localhost ~]#
First which desktop environment did you install?

Did you run

Code: Select all

systemctl daemon-reload
once you had modified the vncserver@:1.service file?

Have you created the xstartup file?

To enable the vncserver use the following command

Code: Select all

systemctl enable vncserver@:1.service



Not sure why its not working for you, make sure you have done the above and we will take it from there.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: VNC Wiki Update - Have you got VNC working?

Postby bigfoot65 » Tue Jan 07, 2014 4:38 am

droth49 does not have the service set correctly.
[Service]
Type=forking
User=root
He is missing the last line above, the user line. Not sure, but that could be causing the issue.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

wyldeone
Posts: 45
Joined: Sun Dec 11, 2011 6:17 am

Re: VNC Wiki Update - Have you got VNC working?

Postby wyldeone » Tue Jan 07, 2014 4:41 am

Oh i was looking at his first copy of the vncserver file at the top of the page, the second one he posted does have the User=root missing.

droth49
Posts: 26
Joined: Mon Dec 16, 2013 8:02 am
Location: Lebanon, Illinois

Re: VNC Wiki Update - Have you got VNC working?

Postby droth49 » Wed Jan 08, 2014 4:02 pm

Still have some thing funky going on but want to try and solve it myself, sorry for the novice mistakes and hope you don't write me off because of them. Just a note I did try to install the one click VNC app could not get it going. Could the two of these program not be getting along? In the mean time I want to try a couple of things. Have correct the issues note earlier but as say things are a little funky yet. Will get back to you one way or the other.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: VNC Wiki Update - Have you got VNC working?

Postby bigfoot65 » Wed Jan 08, 2014 4:47 pm

Yes they may conflict. Should never install two similar apps at the same time. I think they both use tigervncserver. Recommend you pick one and stick with it.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

Who is online

Users browsing this forum: No registered users and 4 guests