<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://knowledge.pinon-hebert.fr/mediawiki/index.php?action=history&amp;feed=atom&amp;title=WSL_%2Fetc%2Fhosts</id>
	<title>WSL /etc/hosts - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://knowledge.pinon-hebert.fr/mediawiki/index.php?action=history&amp;feed=atom&amp;title=WSL_%2Fetc%2Fhosts"/>
	<link rel="alternate" type="text/html" href="https://knowledge.pinon-hebert.fr/mediawiki/index.php?title=WSL_/etc/hosts&amp;action=history"/>
	<updated>2026-06-21T20:54:43Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://knowledge.pinon-hebert.fr/mediawiki/index.php?title=WSL_/etc/hosts&amp;diff=2052&amp;oldid=prev</id>
		<title>Jpinon : Page créée avec « WSL etant un linux comme les autres il a son fichier &lt;code&gt;/etc/hosts&lt;/code&gt;.  On peut l&#039;éditer avec... vi.&lt;syntaxhighlight lang=&quot;bash&quot;&gt; sudo vi /etc/hosts &lt;/syntaxhighlight&gt;Pour info le mot de passe pour sudo c&#039;est le mot de passe windows du compte connecté.  Mais on a un problème. A chaque reboot de la VM de WSL le fichier est effacé et remplacé par celui de Windows.   Par défaut :&lt;syntaxhighlight lang=&quot;bat&quot;&gt; C:\Windows\System32\drivers\etc &lt;/syntaxhighli... »</title>
		<link rel="alternate" type="text/html" href="https://knowledge.pinon-hebert.fr/mediawiki/index.php?title=WSL_/etc/hosts&amp;diff=2052&amp;oldid=prev"/>
		<updated>2026-06-20T22:36:11Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « WSL etant un linux comme les autres il a son fichier &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt;.  On peut l&amp;#039;éditer avec... vi.&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; sudo vi /etc/hosts &amp;lt;/syntaxhighlight&amp;gt;Pour info le mot de passe pour sudo c&amp;#039;est le mot de passe windows du compte connecté.  Mais on a un problème. A chaque reboot de la VM de WSL le fichier est effacé et remplacé par celui de Windows.   Par défaut :&amp;lt;syntaxhighlight lang=&amp;quot;bat&amp;quot;&amp;gt; C:\Windows\System32\drivers\etc &amp;lt;/syntaxhighli... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;WSL etant un linux comme les autres il a son fichier &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On peut l&amp;#039;éditer avec... vi.&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo vi /etc/hosts&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Pour info le mot de passe pour sudo c&amp;#039;est le mot de passe windows du compte connecté.&lt;br /&gt;
&lt;br /&gt;
Mais on a un problème. A chaque reboot de la VM de WSL le fichier est effacé et remplacé par celui de Windows. &lt;br /&gt;
&lt;br /&gt;
Par défaut :&amp;lt;syntaxhighlight lang=&amp;quot;bat&amp;quot;&amp;gt;&lt;br /&gt;
C:\Windows\System32\drivers\etc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Ce chemin m&amp;#039;a toujours laissé rêveur. Pourquoi drivers!&lt;br /&gt;
&lt;br /&gt;
Pour éviter cette remise a zéro on doit éditer le fichier &amp;lt;code&amp;gt;/etc/wsl.conf&amp;lt;/code&amp;gt;.&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo vi /etc/wsl.conf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;et on ajoute à la fin :&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[network]&lt;br /&gt;
generateHosts = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Et ça suffit.&lt;/div&gt;</summary>
		<author><name>Jpinon</name></author>
	</entry>
</feed>