<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Werk &#187; vnc</title>
	<atom:link href="http://werk.feub.net/tag/vnc/feed/" rel="self" type="application/rss+xml" />
	<link>http://werk.feub.net</link>
	<description>Pourquoi Werk? ^.^</description>
	<lastBuildDate>Tue, 06 Dec 2011 14:18:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mise en place d&#8217;un serveur VNC et tunnel SSH</title>
		<link>http://werk.feub.net/2011/12/mise-en-place-dun-serveur-vnc-et-tunnel-ssh/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mise-en-place-dun-serveur-vnc-et-tunnel-ssh</link>
		<comments>http://werk.feub.net/2011/12/mise-en-place-dun-serveur-vnc-et-tunnel-ssh/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 14:08:23 +0000</pubDate>
		<dc:creator>Fabien</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[remote access]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tigervnc]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://werk.feub.net/?p=900</guid>
		<description><![CDATA[Voici un court tutoriel pour utiliser VNC sur une machine CentOS et ainsi accéder à une (ou des) session(s) X. En ce qui me concerne, je l&#8217;utilise ponctuellement pour avoir accès au bureau XFCE de mon serveur dédié. Installation du paquet L&#8217;installation se fait toujours avec yum, pour CentOS 5.x et Fedora avant F11: # [...]]]></description>
			<content:encoded><![CDATA[<p>
<img src="http://werk.feub.net/medias/2011/12/Network_Connections.png" alt="" class="floatleft" />Voici un court tutoriel pour utiliser <a href="http://fr.wikipedia.org/wiki/Virtual_Network_Computing" title="Wikipedia : VNC" target="_blank">VNC</a> sur une machine <a href="http://www.centos.org/" title="CentOS" target="_blank">CentOS</a> et ainsi accéder à une (ou des) session(s) X. En ce qui me concerne, je l&#8217;utilise ponctuellement pour avoir accès au bureau <a href="http://www.xfce.org/" title="XFCE" target="_blank">XFCE</a> de mon serveur dédié.
</p>
<p><span id="more-900"></span></p>
<h4>
Installation du paquet<br />
</h4>
<p>
L&#8217;installation se fait toujours avec <code>yum</code>, pour CentOS 5.x et <a href="http://fedoraproject.org/" title="Fedora Project" target="_blank">Fedora</a> avant F11:
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum install vnc-server</span></pre></div></div>

<p>
Pour CentOS 6.x et Fedora après F11, on utilise TigerVNC :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum install tigervnc-server</span></pre></div></div>

<h4>
Attribuer un mot de passe VNC à l&#8217;utilisateur<br />
</h4>
<p>
Se connecter en tant que l&#8217;utilisateur pour l&#8217;accès VNC, puis lui attribuer un mot de passe avec cette commande :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">vncpasswd</pre></div></div>

<p>
Ceci va créer le répertoire <code>.vnc</code> et stocker le mot de passe.
</p>
<h4>
Configurer le serveur<br />
</h4>
<p>
Il faut éditer le fichier <code>/etc/sysconfig/vncservers</code> avec quelque chose comme ceci :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">VNCSERVERS</span>=<span style="color: #ff0000;">&quot;2:fabien toto:6&quot;</span>
VNCSERVERARGS<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;-geometry 1024x768 -localhost&quot;</span>
VNCSERVERARGS<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">6</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;-geometry 800x600&quot;</span></pre></div></div>

<p>
Ce qui signifie que fabien va avoir un écran de 1024x768px accessible sur le port VNC 2 (port VNC 5900 + 2 = 5902) seulement en local, alors que toto utilisera le port 6 avec une résolution de 800x600px.
</p>
<h4>
Démarrage et initialisation du serveur<br />
</h4>
<p>
Le serveur doit etre lancé une fois pour initialiser le fichier de configuration <code>~/.vnc/xstartup</code> des utilisateurs :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /sbin/service vncserver start</span>
<span style="color: #666666; font-style: italic;"># /sbin/service vncserver stop</span></pre></div></div>

<p>
Il ne reste plus que quelques modifications à effectuer pour accéder à sa session à distance. Dans le cas de XFCE, je remplace simplement <code>twm &#038;</code> par <code>startxfce4 &#038;</code> (<code>gnome-session &#038;</code> pour Gnome ou <code>startkde &#038;</code> pour KDE). La ligne <code>XKL_XMODMAP_DISABLE=1</code> est nécessaire pour éviter des problèmes de mappage de clavier, il est bon de ne pas l&#8217;oublier. Voici mon fichier <code>xstartup</code> :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Uncomment the following two lines for normal desktop:</span>
<span style="color: #666666; font-style: italic;">#unset SESSION_MANAGER</span>
<span style="color: #666666; font-style: italic;">#exec /etc/X11/xinit/xinitrc</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vnc<span style="color: #000000; font-weight: bold;">/</span>xstartup <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vnc<span style="color: #000000; font-weight: bold;">/</span>xstartup
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-r</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.Xresources <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> xrdb <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.Xresources
xsetroot <span style="color: #660033;">-solid</span> grey
vncconfig <span style="color: #660033;">-iconic</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
xterm <span style="color: #660033;">-geometry</span> 80x24+<span style="color: #000000;">10</span>+<span style="color: #000000;">10</span> <span style="color: #660033;">-ls</span> <span style="color: #660033;">-title</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VNCDESKTOP</span> Desktop&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
<span style="color: #666666; font-style: italic;">#twm &amp;</span>
startxfce4 <span style="color: #000000; font-weight: bold;">&amp;</span></pre></div></div>

<h4>
Tunnel SSH<br />
</h4>
<p>
L&#8217;option <code>-localhost</code> n&#8217;autorise l&#8217;accès qu&#8217;en local. Pour accèder à ce serveur en VNC il faut donc au préalable établir une connexion SSH entre la machine cliente et celui-ci en créant un tunnel qui redirigera le port 5904 du serveur vers le port &#8211; par exemple &#8211; 6004 du client. Voici comment instancier cette connexion SSH depuis un client linux :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-L</span> <span style="color: #000000;">6002</span>:localhost:<span style="color: #000000;">5902</span> IP_SERVEUR</pre></div></div>

<p>
Et voici la configuration de ce tunnel avec <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" title="puTTY" target="_blank">puTTY</a> sous Windows :
</p>
<div class="post-image">
<img src="http://werk.feub.net/medias/2011/12/1_tunnel_putty.png" alt="" title="puTTY" width="456" height="442" class="alignnone size-full wp-image-901" />
</div>
<div class="post-image">
<img src="http://werk.feub.net/medias/2011/12/2_tunnel_putty.png" alt="" title="Tunnel avec puTTY" width="456" height="442" class="alignnone size-full wp-image-903" />
</div>
<p>
Une fois la connexion effectuée, il suffit d&#8217;utiliser son client VNC avec localhost et le port 6004 pour accéder au serveur en toute sécurité. En ligne de commande sous linux avec le client vncviewer :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ vncviewer localhost:<span style="color: #000000;">6002</span></pre></div></div>

<p>
Et sous Windows par exemple avec le client UltraVNC :
</p>
<div class="post-image">
<img src="http://werk.feub.net/medias/2011/12/3_ultravnc.png" alt="" title="UltraVNC" width="375" height="372" class="alignnone size-full wp-image-904" />
</div>
<p>
De cette façon, il n&#8217;est pas possible de se connecter à la machine depuis une autre IP que la locale (<code>127.0.0.1</code>).</p>
]]></content:encoded>
			<wfw:commentRss>http://werk.feub.net/2011/12/mise-en-place-dun-serveur-vnc-et-tunnel-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora 13 XFCE et VNC</title>
		<link>http://werk.feub.net/2010/06/fedora-13-xfce-et-vnc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fedora-13-xfce-et-vnc</link>
		<comments>http://werk.feub.net/2010/06/fedora-13-xfce-et-vnc/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 10:32:26 +0000</pubDate>
		<dc:creator>Fabien</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[vnc]]></category>
		<category><![CDATA[xfce]]></category>

		<guid isPermaLink="false">http://werk.feub.net/?p=425</guid>
		<description><![CDATA[Mon petit serveur sous Fedora 13 démarre en runlevel 3, au cas où &#8211; notamment en VNC &#8211; j&#8217;ai tout de même l&#8217;environnement de bureau léger XFCE. Mais celui-ci ne fonctionne pas de suite en accès à distance, seul le fond d&#8217;écran apparaît ainsi que le curseur de la souris. Quelques modifications s&#8217;imposent, outre l&#8217;ajout [...]]]></description>
			<content:encoded><![CDATA[<p>
Mon petit serveur sous <a title="fedoraproject.org" href="https://fedoraproject.org/" target="_blank">Fedora 13</a> démarre en <a title="Wikipedia" href="http://fr.wikipedia.org/wiki/Run_level" target="_blank">runlevel 3</a>, au cas où &#8211; notamment en <a title="Wikipedia" href="http://fr.wikipedia.org/wiki/Virtual_Network_Computing" target="_blank">VNC</a> &#8211; j&#8217;ai tout de même l&#8217;environnement de bureau léger <a title="XFCE" href="http://www.xfce.org/?lang=fr" target="_blank">XFCE</a>. Mais celui-ci ne fonctionne pas de suite en accès à distance, seul le fond d&#8217;écran apparaît ainsi que le curseur de la souris. Quelques modifications s&#8217;imposent, outre l&#8217;ajout de <code>startxfce4 &amp;</code> en lieu et place de <code>twm &amp;</code>, il faut commenter les parties de test exec de xinitrc. Voici le fichier ~/vnc/xstartup pour que XFCE démarre correctement avec VNC :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
vncconfig <span style="color: #660033;">-iconic</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;
<span style="color: #7a0874; font-weight: bold;">unset</span> DBUS_SESSION_BUS_ADDRESS
<span style="color: #007800;">OS</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">uname</span> -s<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$OS</span> = <span style="color: #ff0000;">'Linux'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$WINDOWMANAGER</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
	<span style="color: #000000; font-weight: bold;">*</span>gnome<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>SuSE-release <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>gnome<span style="color: #000000; font-weight: bold;">/</span>bin
		<span style="color: #7a0874; font-weight: bold;">export</span> PATH
	<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">;;</span>
	<span style="color: #000000; font-weight: bold;">esac</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-r</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.Xresources <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> xrdb <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.Xresources
startxfce4 <span style="color: #000000; font-weight: bold;">&amp;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://werk.feub.net/2010/06/fedora-13-xfce-et-vnc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc (Feed is rejected)
Page Caching using apc
Object Caching 280/292 objects using memcached

Served from: werk.feub.net @ 2012-02-05 21:15:33 -->
