Content-type: text/html

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  <meta name="Generator" content="wrote by hand">
  <meta name="Author" content="Joey Kelly">
  <title>JKWiki: VNCSetupTips</title>
  <link type="text/css" href="jkwiki.css" rel="stylesheet"/>
  <script src="jkwiki.js"></script>
  <link rel="shortcut icon" href="jokeshow.jpg" type="image/x-icon">
</head>

<body>

  <div id="page">

    <div id="content">
      <!-- <h1>JKWiki: <small>VNCSetupTips</small></h1> -->
        <p><a href="?HomePage">HomePage</a> :: <a href="?TechnicalProjects">TechnicalProjects</a> :: VNCSetupTips</p>
<h1><a id="VNCSetupTips"></a>VNC Setup Tips</h1>
<h1><a id="ConfiguringTheServer"></a>Configuring the server</h1>
<p><strong>NOTE:</strong> This section was originally researched and written by <a href="http://nolug.org/index.pl?ScottManzella">Scott Manzella</a></p>
<ul>
<li>Optimum Resolution
<ul>
<li>The optimum resolutions for the VNC server depends on the remote users desktop settings.
<ul>
<li>1280&#215;1024 = 1152&#215;922</li>
<li>1024&#215;768 = 922&#215;691</li>
</ul>
</li>
<li>The best resolution can generally be calculated by multiplying the original resolution by .9 or using 90% of the original resolution.</li>
<li>When starting the vncserver on the host server, one can specify the resolution and color depth. For Instance:
<ul>
<li>vncserver -geometry 1152&#215;922 -depth 24</li>
</ul>
</li>
<li>Also, a specific VNC session can be terminated by using the -kill switch. For instance:
<ul>
<li>vncserver -kill :1 or vncserver -kill :2 etc.....</li>
</ul>
</li>
</ul>
</li>
<li>Static Session numbers ???
<ul>
<li>see notes and code below &#8211; <a href="?JoeyKelly">JoeyKelly</a></li>
</ul>
</li>
<li>Setting default desktop - Gnome or KDE or Other ???
<ul>
<li>this is handled by other means, not by VNC &#8211; <a href="?JoeyKelly">JoeyKelly</a></li>
</ul>
</li>
<li>Configuring client component
<ul>
<li>Tunneling through SSH using PuTTY</li>
</ul>
</li>
<li>Printing across the WAN ???
<ul>
<li>see <a href="?CitrixReplacementUsingRemoteVNC">CitrixReplacementUsingRemoteVNC</a> for a solution &#8211; <a href="?JoeyKelly">JoeyKelly</a></li>
</ul>
</li>
</ul>
<hr /><h1><a id="StaticSessionNumbers"></a>Static session numbers</h1>
<h4><a id="FromTheRealvncUnixVncserverDocs"></a>From the realvnc unix vncserver docs</h4>
<pre>
 vncserver can be run with no options at all. In this case it will choose the
 first available display number (usually :1), start Xvnc as that display, and
 run a couple of basic applications to get you started. You can also specify
 the display number, in which case it will use that number if it is available
 and exit if not, eg: 


 vncserver :13 
</pre>
<p>What this means is that we can designate a port for $user&#39;s vnc client that will never change, if we script it right.</p>
<h4><a id="Shellcode"></a>Shellcode:</h4>
<pre>
 #!/bin/bash
 # Copyright 2004 by Joey Kelly, <a href="http://joeykelly.net">http://joeykelly.net</a>
 # This script is licensed under the GPL.
 #
 # This script is for the user to run to start a vnc session
 # Hopefully this will eliminate the problem of getting calls whenever
 # the process dies.
 #
 # here we set the port number we want to run on (vnc&#39;s real port = 5900 + $USERVNCPORT increment)
 USERVNCPORT=10     # arbitrary number, must be unique for each user
 #
 # NOTE:
 # if we want to kill the user&#39;s existing session, we would do:
 # vncserver -kill :$USERVNCPORT
 #
 # we need to kill off the old pidfiles
 # use rm -f so redhate doesn&#39;t complain with a prompt
 rm -f /tmp/.X11-unix/X$USERVNCPORT
 rm -f /tmp/.X$USERVNCPORT-lock
 #
 # now we start the vnc daemon
 vncserver :$USERVNCPORT &amp;
 echo <q>VNC server restarted. Please log in to VNC as normal.n</q>
 # sometimes the terminal will hang&#8230;
 sleep 3
 echo <q>Please press RETURN.</q>
</pre>

    </div>

    <div id="footer">
      <hr>
      <small><i><b><a href="https://gitlab.com/mmlj4/jkwiki">JKWiki</a></b> is a scraped-together wiki app by Joey Kelly</i></small>
    </div>

  </div>

</body>
</html>
