Outils pour utilisateurs

Outils du site


issue121:labo_linux

While I was translating the News column for the French version of Full Circle, one particular item caught my eye. It was actually about openSUSE running on Windows 10 rather than Ubuntu, because, the developers argue, openSUSE has been around for a long time and is very stable. But it did contain the following sentence : “In its Anniversary Update, Microsoft launched Windows Subsystem for Linux (WSL). This allowed the Windows 10 users to run Bash on Ubuntu on Windows 10.” I thought I'd try to find out more about this: how to install it, what can be done with it, by me in particular, just because the newness of the idea – running bash, on Ubuntu, on the Windows 10 kernel – sounded completely extraordinary. In addition, I must be among only a few Ubuntu users who actually use Windows 10 as their main operating system. So I can try the thing out with no extra effort… or very little. As the saying goes, “Fools rush in where angels fear to tread.” My first move was to look up “WSL” with Bing on Edge, the Windows 10 browser. At first, that just got me a long list of various organizations (Spanish learners?), with, at the very bottom of the page, “Windows Subsystem for Linux.” Even using DuckDuckGo on Firefox, I got White Star Line, World Surf League, Westwood Shipping, and, finally, Bash on Ubuntu on Windows. Here's the link: https://msdn.microsoft.com/en-us/commandline/wsl/about. The page begins with this “Important note This is the first release of this brand new technology and it is branded “beta” deliberately – it’s not yet complete! We know there are issues and incomplete features, you should expect some things to work, and many things to fail. But we appreciate you playing with this feature and helping us identify the issues we need to fix in order to deliver a great experience.”

En traduisant la rubrique des Actus pour la version française du Full Circle, un article en particulier m'a interpellée. En fait, c'était au sujet d'openSUSE, plutôt qu'Ubuntu, qui tournerait sur Windows 10, parce que, insistent les développeurs, openSUSE existe depuis longtemps et est extrêmement stable. Cela dit, j'y trouvais aussi les phrases suivantes : « Lors de sa mise à niveau appelée “Anniversary”, Microsoft a lancé Windows Subsystem for Linux (WSL). Ceci permet aux utilisateurs de Windows 10 d'exécuter Bash sur Ubuntu sur Windows. » Curieuse de nature, je voulais en savoir davantage : comment l'installer et ce que je pouvais en faire, tout simplement parce que la nouveauté de l'idée - faire tourner Bash, sur Ubuntu, sur le noyau de Windows 10 - avait l'air complètement extraordinaire. En outre, je dois figurer parmi les très rares utilisateurs d'Ubuntu qui se servent de Windows 10 comme système d'exploitation principal. Ainsi, je pouvais essayer le truc avec aucun effort supplémentaire… ou très peu. Comme dit le dicton, « les sots se ruent là où les anges n'osent pas s'aventurer » !

J'ai commencé par chercher « WSL » avec Bing sur le navigateur de Windows 10, Edge. Au début, le résultat n'était qu'une longue liste de diverses organisations (les apprenants d'espagnol ??) avec, tout en bas de la page, « Windows Subsystem for Linux ». Même avec DuckDuckGo sur Firefox, j'ai obtenu White Star Line, World Surf League, Westwood Shipping, et, enfin, Bash on Ubuntu on Windows. Voici le lien (en anglais) : https://msdn.microsoft.com/en-us/commandline/wsl/about. La page commence par cette

« Note importante

« Ceci est la première publication de cette toute neuve technologie et elle est appelée “bêta” exprès - elle n'est pas encore finie ! Nous savons qu'il y a des problèmes et des fonctionnalités incomplètes : vous devriez vous attendre à ce que certaines choses fonctionnent et que beaucoup de choses échouent. Mais nous vous remercions vraiment de bien vouloir bricoler avec cette fonctionnalité, nous aidant ainsi à cerner les problèmes qu'il faudrait résoudre pour vous apporter une excellente expérience. »

You, meaning all people, but particularly developers, are definitely being invited to try it out and report back to Microsoft so they can fix whatever problems you come across. Basically, you can run “common command-line utilities, […], navigate the file system [apparently even your C: Windows], and run Bash shell scripts which rely on supported command-line utilities.” After this enticing beginning, you can watch a 17-minute long video (on the same page) where two Microsoft Senior Program Managers insist that it's not a Virtual Machine, but Bash on Ubuntu on Windows, and show that you can do sudo apt-get install git. You can also do apt-date update and upgrade, which I did after my install. If you want to know… I've been writing all of this to put off having to install the thing, even though, on this same page, we are told that it's “just a few clicks”! We'll see about that. The Install Guide is here: https://msdn.microsoft.com/en-us/commandline/wsl/install_guide, and the first thing to note is that your Windows 10 must be a 64-bit version of the Anniversary Update build 14393 or later. To find out whether you meet the requirements, go to Settings > System > About

Vous, ce qui signifie tous les gens, mais surtout les développeurs, êtes vraiment invités à l'essayer et à donner vos avis et suggestions à Microsoft pour qu'ils puissent résoudre tout problème que vous auriez pu rencontrer. Essentiellement, vous pouvez lancer des « utilitaires habituels en ligne de commande, […] naviguer dans le système de fichiers [et même votre C: Windows] et exécuter des scripts Bash qui dépendent des utilitaires en ligne de commande pris en charge ».

Après ce début bien attrayant, vous pouvez regarder une vidéo de 17 minutes (sur la même page) où deux gestionnaires de projet principaux de Microsoft insistent sur le fait qu'il ne s'agit aucunement d'une machine virtuelle, mais que c'est vraiment Bash sur Ubuntu sur Windows. En outre, ils démontrent qu'il est possible de faire sudo apt-get install git. Faire sudo apt-get update et sudo apt-get upgrade est également possible et je l'ai fait après mon installation. Si vous voulez connaître la vérité, je suis en train d'écrire tout ceci pour retarder l'installation de la chose, bien que, sur la même page, on nous dise que, pour ce faire, il suffit de « quelques clics » ! On verra bien…

Le Guide d'installation se trouve ici : https://msdn.microsoft.com/en-us/commandline/wsl/install_guide, et la première chose à prendre en compte est que votre Windows 10 doit être une version en 64 bits de la mise à niveau Anniversary, build 14393 ou ultérieur. Pour savoir si votre machine répond à ces exigences, allez à Paramètres > Système > Informations système tout en bas de la colonne de gauche.

Looks like my five- or six-year-old Toshiba fills the bill (previous page, bottom right), but please excuse the French… Next, you must turn on the Developer Mode (below) by hand. Go to Settings > Update and Security > For Developers, and select Developer Mode. But when I did, I got this rather daunting message: Or, in plain English, “In Developer Mode, you can, among other things, install and run applications without going through the Windows Store. You will be exposing your machine and your personal data to security risks and may damage your machine. Are you sure you really want to do this?” When I clicked on Yes, a package began installing. The purple circle continued turning until after I'd saved the pictures above and below. Question: will it be possible to get out of Developer Mode? Heaven only knows, but sufficient unto the day is the evil thereof…

Il semblerait que mon Toshiba de cinq ou six ans a tout ce qu'il faut (page précédente, en bas à droite)…

Puis, il faut activer le mode développeur (ci-dessous) manuellement. Allez à Paramètres > Système > Mise à jour et Sécurité > Pour les développeurs, et sélectionnez Mode développeur. Quand je l'ai fait, le message suivant, plutôt intimidant, s'est affiché :

« En mode développeur, vous pouvez notamment installer et exécuter des applications sans passer par le Windows Store. Vous exposez alors votre périphérique et vos données personnelles à des risques pour la sécurité et risquez d'endommager votre périphérique.

« Activer le mode développeur ? Oui Non »

Quand j'ai cliqué sur Oui, l'installation d'un paquet a commencé. Le cercle violet tournait jusqu'à ce que j'aie sauvegardé les deux images ci-dessous.

Question : Sera-t-il possible de sortir du Mode développeur ? Dieu seul le sait, mais à chaque jour suffit sa peine…

Okay, next: you must enable the Windows Subsystem for Linux feature in the graphical interface by going to Start > and down to the T's, for “Turn Windows Features on and off.” At least, that's what the instructions on the Install Page say. But, on my list of things, there's nothing at Turn, and there's nothing at Windows Features. This does not bode well. Google (or in this case Bing) being my friend, I found this page: https://windowsinstructed.com/turn-windows-features-windows/ It tells you to go into the Control Panel, but the all-business one is no longer easily available in Windows 10. What I had to do was go to Settings > System > Programs and functions. Then, at the very bottom of the list of your programs, under the title Related Settings, there is a link to “Programs and Functions”. When you click on that link, you get the familiar Control Panel from Windows 7. In the left-hand column, you'll find what the official instructions were referring to, that is “Turn Windows Features on and off.” So I ticked the “Windows Subsystem for Linux (beta)” and clicked on OK. Windows began searching for necessary files… and I went to watch TV a bit. When I next looked at my computer it was rebooting on its own.

Bon, ensuite : il faut activer la fonction Windows Subsystem for Linux dans l'interface graphique en allant à Démarrer (logo Windows à gauche dans la barre des tâches), puis en descendant les programmes, par ordre alphabétique, jusqu'aux T, pour « Turn Windows Features On and Off » (Activer et désactiver les fonctions Windows). Du moins c'est ce que j'ai lu dans les instructions sur la page Install. Mais ma liste de programmes ne contient rien à Turn et il n'y a rien dans Fonctions Windows. Cela n'augurait rien de bon. Puisque Google (ou dans mon cas Bing), est mon ami, j'ai trouvé cette page : https://windowsinstructed.com/turn-windows-features-windows/ Il vous dit d'aller dans le Panneau de contrôle, mais celui qui fait l'affaire n'est plus facilement disponible dans Windows 10. Ce qu'il me fallait faire était d'aller à Paramètres > Système > Applications et fonctionnalités. Puis, tout en bas de la liste de vos programmes, sous le titre Paramètres associés, il y a un lien vers Programmes et fonctionnalités. Quand vous cliquez sur ce lien, le bien connu Panneau de contrôle de Windows 7 s'affiche. Dans la colonne de gauche, vous trouvez ce à quoi faisaient référence les instructions officielles, c'est-à-dire, en français, « Activer ou désactiver des fonctionnalités Windows ». J'ai donc coché « Sous-système Windows pour Linux (bêta) », puis cliqué sur OK. Windows a commencé à rechercher les fichiers qu'il fallait… et je suis allée regarder un peu la télé. Quand je suis revenue à mon ordinateur, il était en train de redémarrer tout seul.

It's true that the Install instructions say “you must restart when prompted.” But: • Windows rebooted without asking, and • I was supposed to be prompted to reboot after going into the Power Shell as administrator (open the menu of Windows Power Shell in the list of programs and right-click on Windows Power Shell, then choose Run as administrator), and typing “Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux” + Enter. So I'll try doing that now. At least my computer is still working! AND, once it was done, RestartNeeded was False! Now, theoretically, all I have to do is open a normal command prompt and type bash?!!! Yesssss!!

Il est vrai que les instructions d'installation disent qu'il faut redémarrer à l'invite, mais : • Windows a redémarré sans me demander quoi que ce soit et • une invite à redémarrer était censée s'afficher après être allée dans Power Shell en tant qu'administrateur (dans la liste des programmes, faites un clic droit sur Windows Power Shell, puis choisir Exécuter en tant qu'administrateur) et, enfin, saisir « Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux » + Entrée.

Ce que j'ai tout de suite fait. Au moins, mon ordinateur fonctionne toujours ! ET, après RestartNeeded était marqué False ! (Pas besoin de redémarrer).

À ce stade, théoriquement, tout ce qu'il fallait faire était d'ouvrir une Invite de commandes Windows normale, puis taper bash !!!

Ouaouh, ça fonctionne !! Le résultat était :

Or, in English (bottom): – Beta feature – This will install Ubuntu on Windows, distributed by Canonical and licensed under its terms available here… Type “y” to continue: I, in fact, typed “o” for “oui” to continue, and now Ubuntu is downloading from the Windows Store! (Canonical provided the code from Ubuntu 14,04 LTS, a.k.a. Trusty to Microsoft for this very purpose.) That's done and now it's “Extracting file system, this will take a few minutes…” Once the installation has been declared successful, I'll be prompted to enter a “UNIX user name”, then to “Enter a new UNIX password:”, which I'll do before trying anything else. From now on, I will have a “Bash on Ubuntu on Windows” shortcut in my Start menu!!! It IS there… Awesome! Even though I'm neither a developer, nor, for that matter, a big user of the Command Line … I've just done an update-upgrade (below) that seemed to work normally except that execution was denied to several things and “Upstart” couldn't connect to the socket – connection refused. AND I just wrote you a very short note with Nano to prove that Bash really does work. “Bash on Ubuntu on Windows” has recently been added to my list of programs!

« – Fonctionnalité bêta – Cette opération va installer Ubuntu sur Windows, un produit distribué par Canonical et sous licence, selon les conditions disponibles ici : https://aka.ms/uowterms

« Taper “ o ” pour continuer : »

C'est ce que j'ai fait et, après, Ubuntu s'est téléchargé à partir du Windows Store ! (Canonical a fourni le code d'Ubuntu 14.04 LTS, alias Trusty, à Microsoft à ces fins précises.)

Bon, ensuite il extrayait le système de fichiers, ce qui a nécessité quelques minutes. Une fois l'installation réussie, je devais entrer un nom d'utilisateur UNIX, puis un nouveau mot de passe UNIX. Dès lors, il y aurait un raccourci vers Bash sur Ubuntu sur Windows dans le menu démarrer !! Et il y était - génial (bien que n'étant ni développeur, ni, même, un grand utilisateur de la ligne de commande) !

J'ai tout de suite fait un update-upgrade (ci-cessous) qui semblait tout à fait normal sauf que l'exécution fut refusée à plusieurs choses et « Upstart » ne pouvait pas se connecter au socket, car la connexion fut refusée. Ensuite j'ai écrit le court message (visible en bas à droite) avec Nano pour démontrer que Bash fonctionne bel et bien et partager ce que j'en fais.

issue121/labo_linux.txt · Dernière modification : 2017/06/06 11:04 de auntiee