{"id":3865,"date":"2015-07-22T14:13:31","date_gmt":"2015-07-22T14:13:31","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=3865"},"modified":"2015-10-26T15:58:43","modified_gmt":"2015-10-26T15:58:43","slug":"tigervnc-with-centos","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=3865","title":{"rendered":"TigerVNC with CentOS"},"content":{"rendered":"<p><a href=\"http:\/\/wiki.centos.org\/HowTos\/VNC-Server\">VNC (Virtual Network Computing)<\/a><br \/>\n<a href=\"https:\/\/rbgeek.wordpress.com\/tag\/multiple-users-on-vnc\/\">How to install VNC server on CentOS 6<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# yum install vnc-server\r\nor\r\n# yum install tigervnc-server\r\n<\/pre>\n<pre class=\"brush: plain; title: Add user; notranslate\" title=\"Add user\">\r\n$ su -\r\n# useradd larry\r\n# useradd moe\r\n# useradd curly\r\n# passwd larry\r\n# passwd moe\r\n# passwd curly\r\n<\/pre>\n<pre class=\"brush: plain; title: \/etc\/sysconfig\/vncservers; notranslate\" title=\"\/etc\/sysconfig\/vncservers\">\r\nVNCSERVERS=&quot;1:larry 2:moe 3:curly&quot;\r\nVNCSERVERARGS&#x5B;1]=&quot;-geometry 640x480&quot;\r\nVNCSERVERARGS&#x5B;2]=&quot;-geometry 640x480&quot;\r\nVNCSERVERARGS&#x5B;3]=&quot;-geometry 800x600&quot;\r\n<\/pre>\n<h4>Recovery from a logout (Not implemented for CentOS 6)<\/h4>\n<p>If you logout of your desktop manager, it is gone! <\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ ps aux | grep andreas\r\nandreas    446  0.0  0.0  20040   636 ?        S    May06   0:00 dbus-launch --sh-syntax --exit-with-session\r\nandreas    447  0.0  0.0  36544  1684 ?        Ssl  May06   0:07 \/bin\/dbus-daemon --fork --print-pid 5 --print-address 7 --session\r\nandreas    560  0.0  0.2 581832 84144 ?        Ssl  May06  10:20 \/usr\/libexec\/gnome-settings-daemon\r\nandreas    564  0.0  0.0 293540  7976 ?        Ss   May06   0:00 seahorse-daemon\r\nandreas    568  0.0  0.0 137216  2072 ?        S    May06   0:00 \/usr\/libexec\/gvfsd\r\nandreas    595  0.0  0.0 255504  6740 ?        S    May06   0:00 \/usr\/libexec\/gdu-notification-daemon\r\nandreas    597  0.0  0.0 485748 11608 ?        Sl   May06   0:15 gpk-update-icon\r\nandreas    599  0.0  0.0 363212  3760 ?        Ssl  May06   0:00 \/usr\/bin\/pulseaudio --start --log-target=syslog\r\nandreas    601  0.0  0.0 235732  5344 ?        S    May06   0:02 abrt-applet\r\nandreas    605  0.0  0.0 364236  7724 ?        S    May06   0:10 \/usr\/libexec\/evolution\/2.32\/evolution-alarm-notify\r\nandreas    608  0.0  0.0 276476  8148 ?        S    May06   0:03 bluetooth-applet\r\nandreas    617  0.0  0.0 470144 11232 ?        S    May06   0:00 gnome-volume-control-applet\r\nandreas    619  0.0  0.0 146232  3124 ?        S    May06   0:00 \/usr\/libexec\/gvfs-gdu-volume-monitor\r\nandreas    620  0.0  0.0  30164  5216 ?        S    May06   0:00 \/usr\/sbin\/restorecond -u\r\nandreas    622  0.0  0.0 299516 11792 ?        Sl   May06   0:11 \/usr\/libexec\/polkit-gnome-authentication-agent-1\r\nandreas    629  0.0  0.0 324324 19408 ?        S    May06   0:01 python \/usr\/share\/system-config-printer\/applet.py\r\nandreas    636  0.0  0.0 115100  3964 ?        S    May06   0:00 \/usr\/libexec\/im-settings-daemon\r\nandreas    648  0.0  0.0 148232  3152 ?        S    May06   0:00 \/usr\/libexec\/gvfsd-trash --spawner :1.8 \/org\/gtk\/gvfs\/exec_spaw\/0\r\nandreas    687  0.0  0.0 264788  6504 ?        Ss   May06   1:57 gnome-screensaver\r\nandreas    707  0.0  0.0 232444  2064 ?        Sl   May06   4:20 \/usr\/libexec\/gvfs-afc-volume-monitor\r\nandreas    711  0.0  0.0 150896  2192 ?        S    May06   0:00 \/usr\/libexec\/gvfs-gphoto2-volume-monitor\r\nandreas    807  0.0  0.0  95228  2628 ?        S    May06   0:00 \/usr\/libexec\/pulse\/gconf-helper\r\nandreas    822  0.0  0.0  40900  2252 ?        S    May06   0:00 \/usr\/libexec\/gconf-im-settings-daemon\r\nandreas    839  0.0  0.0 135096  1800 ?        S    May06   0:00 \/usr\/libexec\/gvfsd-metadata\r\nandreas    841  0.0  0.0 141484  2336 ?        S    May06   0:00 \/usr\/libexec\/gvfsd-burn --spawner :1.8 \/org\/gtk\/gvfs\/exec_spaw\/1\r\nandreas  16254  0.2  0.0 633208 24604 ?        Sl   17:30   0:04 nautilus\r\nandreas  16260  0.0  0.0 451640 13056 ?        Sl   17:30   0:00 metacity\r\nroot     16426  0.8  0.0 102460  4316 ?        Ss   17:56   0:00 sshd: andreas &#x5B;priv]\r\nandreas  16430  0.1  0.0 102460  2000 ?        S    17:56   0:00 sshd: andreas@pts\/8\r\nandreas  16431  0.2  0.0 108340  1796 pts\/8    Ss   17:56   0:00 -bash\r\nandreas  16461  0.0  0.0 110240  1160 pts\/8    R+   17:56   0:00 ps aux\r\nandreas  16462  0.0  0.0 103256   852 pts\/8    S+   17:56   0:00 grep andreas\r\nandreas  51516  0.0  0.0 133476  5540 ?        S    Jul22   0:14 \/usr\/libexec\/gconfd-2\r\nandreas  65244  0.0  0.1 126628 50508 ?        S    May06   1:17 \/usr\/bin\/Xvnc :21 -desktop srv-fpga:21 (andreas) -auth \/home\/andreas\/.Xauthority -geometry 1280x1024 -rfbwait 30000 -rfbauth \/home\/andreas\/.vnc\/passwd -rfbport 5921 -fp catalogue:\/etc\/X11\/fontpath.d -pn\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n#!\/usr\/bin\/env bash\r\n\r\nif &#x5B; -z &quot;${USER}&quot; ]; then\r\n    echo &quot;no environment variable USER set&quot;\r\n    exit -1\r\nfi\r\n\r\nPID=\r\n\r\npid() {\r\n    PID=$(ps aux | grep ${USER} | grep Xvnc | grep -v grep | awk '{print $2}')\r\n}\r\n\r\nstart() {\r\n    echo &quot;==&gt; Start vncserver&quot;\r\n    DISPLAY=$(cat \/etc\/sysconfig\/vncservers | grep ${USER} | awk -v display=&quot;&#x5B;0-9]+&quot; -v user=&quot;:${USER}&quot; '{ if (match($0, display user)) { print substr($0, RSTART, RLENGTH - length(user)); } }')\r\n    ARGS=$(cat \/etc\/sysconfig\/vncservers | grep &quot;VNCSERVERARGS\\&#x5B;${DISPLAY}\\]&quot; | cut -d '&quot;' -f2)\r\n    echo &quot;    display=${DISPLAY}&quot;\r\n    echo &quot;    arguments=${ARGS}&quot;\r\n    vncserver :${DISPLAY} ${ARGS}\r\n}\r\n\r\nstop() {\r\n    echo &quot;==&gt; Stop vncserver&quot;\r\n    kill ${PID}\r\n}\r\n\r\npid\r\n\r\ncase &quot;$1&quot; in\r\n    start)\r\n        if &#x5B; -n &quot;${PID}&quot; ]; then\r\n            echo &quot;vncserver (pid=${PID}) is already running&quot;\r\n            exit -2\r\n        fi\r\n        start\r\n        ;;\r\n        \r\n    stop)\r\n        if &#x5B; -z &quot;${PID}&quot; ]; then\r\n            echo &quot;vncserver is not running&quot;\r\n            exit -3\r\n        fi\r\n        stop\r\n        ;;\r\n        \r\n    restart)\r\n        if &#x5B; -n &quot;${PID}&quot; ]; then\r\n            echo &quot;vncserver (pid=${PID}) is running. Stopping&quot;\r\n            stop\r\n            sleep 3\r\n        else\r\n            echo &quot;vncserver is already stopped&quot;\r\n        fi\r\n        start\r\n        ;;\r\n        \r\n    status)\r\n        if &#x5B; -n &quot;${PID}&quot; ]; then\r\n            echo &quot;vncserver (pid=${PID}) is running&quot;\r\n        else\r\n            echo &quot;vncserver is stopped&quot;\r\n        fi\r\n        ;;\r\n        \r\n    *)\r\n        echo &quot;$0 (start|stop|restart|status)&quot;\r\n        ;;\r\n        \r\nesac\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>VNC (Virtual Network Computing) How to install VNC server on CentOS 6 # yum install vnc-server or # yum install tigervnc-server $ su &#8211; # useradd larry # useradd moe # useradd curly # passwd larry # passwd moe # passwd curly VNCSERVERS=&quot;1:larry 2:moe 3:curly&quot; VNCSERVERARGS&#x5B;1]=&quot;-geometry 640&#215;480&quot; VNCSERVERARGS&#x5B;2]=&quot;-geometry 640&#215;480&quot; VNCSERVERARGS&#x5B;3]=&quot;-geometry 800&#215;600&quot; Recovery from a logout [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3865","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/3865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3865"}],"version-history":[{"count":7,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/3865\/revisions"}],"predecessor-version":[{"id":4201,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/3865\/revisions\/4201"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}