WSL use summary: from ArchLinux to Manjaro

Source: Internet
Author: User
Tags locale

1. Preface

The previous article describes the process of configuring the WSL environment under Windows 10, replacing the ALWSL script with ArchLinux. This article is based on the instructions of ArchLinux official website, install ArchLinux under WSL, and switch to the release Manjaro process.

First: X server is using Mobaxterm, where: The above section of the Windows 10 taskbar is the Manjaro interface, and four forms are in turn file Manager, Firefox 56, terminal terminal and the Teapot example program launched on the terminal.

  

2.WSL Installation ArchLinux Environment

ArchLinux gives a description: Install_on_wsl_ (Simplified Chinese). Things to be aware of during the installation process have been recorded on my GitHub. Here is a detailed description:

2.1 Microsoft Store installs Linux

* OPEN "developer mode" and tick "Windows Subsystem for Linux", the process can refer to the previous article.

* Enter Linux to search, may need to search two times, choose Ubuntu for installation, after installation,:

  

* Note: Startup After installation will remind you to enter your username and password, this step will be skipped. Turn it off and back on to the root login environment.

2.2 Installing ArchLinux

* Open Ubuntu from the Start menu. Download Arch bootstrap from the archlinux image of Tsinghua University. Tar.gz in the root user's directory localstate\rootfs\root, and then extract the "Note: Extract archlinux-bootstrap in the root directory, There may be a problem ":

tar -zxvf archlinux-bootstrap-2017.11. -x86_64. tar. gz

* In the ~/root.x86_64/etc/pacman.d/mirrorlist file, select the desired server and uncomment. This step is directly replaced by Manjaro's Tsinghua Image:

Server = https://mirrors.tuna.tsinghua.edu.cn/manjaro/stable/$repo/$arch

* Let WSL automatically generate/etc/resolv.conf "Note: or delete/etc/resolv.conf files directly":

Echo " # This file is automatically generated by WSL. To stop automatic generation of the This file, remove this line. " > ~/root.x86_64/etc/resolv.conf

* Exit all open Bash command-line windows. Open%localappdata%\packages in Windows Explorer and locate canonicalgrouplimited.ubuntuonwindows_* (where * represents a random string).

Delete Bin, etc, Lib, lib64, sbin in%localappdata%\packages\canonicalgrouplimited.ubuntuonwindows_*\localstate\rootfs, USR and var. Then rootfs\root\root.x86_64 move from (don't copy) the same file torootfs。

* The official website says fakeroot-tcp and glibc-wslare needed. We can skip this step first. Enter Pacman-syyu to update.

2.3 Installing Manjaro

* To put it simply, install all the packages that the Manjaro release has. If you already have a Manjaro installed, you can enter the pacman-ssq > Packages.txt Export Package list. File packages.txt has already put a copy on my github.

* Input pacman-s 'cat packages.txt ' installation Manjaro environment, about 1000 packs Total 1G downloads, please wait patiently.

* Enter useradd-m-s/bin/bash username Create user, here will automatically create user files, the user's Xfce4 environment will also be set.

* Modify the file /etc/sudoers file, add username all= (All) Nopasswd:all , so you can use sudo directly without losing the password.

* Set this user as the default user for Ubuntu Config--default-user username . Enter the terminal, "Note: username is the same as you set, here is Wurui":

* Install GLIBC-WSL, configure Chinese environment. GLIBC-WSL need to compile on their own, here to provide my own compiled version 2.26, see my Baidu cloud share.

* Input sudo pacman-u glibc-wsl-2.26-4-x86_64.pkg.tar. XZ installation GLIBC-WSL.

* File/etc/locale.gen, uncomment the two lines of comment: es_us. utf-8 utf-8 zh_cn. utf-8 utf-8

* Input sudo locale-gen :

sudo locale-gengenerating locales  ... Es_us. UTF-8done  zh_cn. UTF-8doneGeneration complete.

* Modify the file ~/.BASHRC, add the following lines, "Note: If it is externally modified, remember to use the sudo chmod 644 ~/.bashrc recovery. BASHRC access Rights" :

export lang="zh_cn. UTF-8" export Lc_all="zh_cn. UTF-8" export DISPLAY=:0

* The installation is complete and the X server environment is configured below.

2.4 Installing the X Server environment

* The X Server environment recommends the use of mobaxterm. You can find the latest version of Mobaxterm on the 0daydown website. The interface after launch.

* If you want to start Mobaxtem in the background. You can enter: "C:\Program Files (x86) \mobatek\mobaxterm\mobaxterm.exe"-hideterm .

* However, this will be a flash. After some groping, I found a better way. Mobaxterm Normal Startup, enter: WMIC process where name= "Xwin_mobax.exe" Get commandline you can see the command line arguments:

C:\users\wurui>wmic process where name= "Xwin_mobax.exe" get commandlinecommandline                                                                                         "C:\Users\wurui\ Docume~1\mobaxterm\slash\bin\xwin_mobax.exe "  -silent-dup-error-notrayicon-nolisten inet6-hostintitle +bs  -clipboard-nowgl-multiwindow-noreset:0

* At the same time, you can see the EXE at the beginning of Xwin in the c:\users\<username>\documents\mobaxterm\slash\bin directory:

c:\users\wurui\documents\mobaxterm\slash\bin>dir /b xwin*xwin. EXEXWINWM. exexwin_cygwin_1. 14.5. exexwin_cygwin_1. 16.3. Exexwin_mobax. exe

* Create a Autorun.vbs file under%homepath% with the following contents:

 set  ws=wscript.createobject ( " wscript.shell   " )  command  =  "  C:\users\<username>\documents\mobaxterm\slash\bin\xwin.exe   " &  " -silent-dup-error-notrayicon-nolisten Inet6-hostintitle +bs-clipboard-nowgl-multiwindow-noreset:0   "  "  MsgBox Command  ws. Run command , 0  

* (optional Step). Modify registry path computer \HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon under Userinit is: \ C Windows\system32\userinit.exe,wscript C:\users\<username>\autorun.vbs , so you can automatically start the X server when you log in.

2.5 Setting up Manjaro desktop shortcuts

* Consider a question first, how WSL's bash goes directly into Python. The method is input: bash-c "Python" , for example:

C:\users\wurui>bash-c "python"3.6.3 (default, OCT, 14:48:20) on linux Type  for more information.>>>

* Question two, how to start the Task Manager of the desktop environment. The method is input: bash-c "display=:0 Thunar" ,:

* Question three, how to start Manjaro and set up shortcuts. First of all, the Xwin at the start of the best to remove the -multiwindow parameters, otherwise the windows are separated; because it is a xfce4 desktop environment, you can enter bash-c "display=:0 startxfce4" to start the desktop.

* Right-click, select Shortcut, type: %windir%\system32\mshta.exe VBScript: CreateObject("Wscript.Shell"). Run("cmd/c start C:\users\<username>\documents\mobaxterm\slash\bin\xwin.exe & Bash-c ' DISPLAY=:0 Lang=zh_cn. UTF-8 startxfce4 ' ", 0) (window.close) , note <username> is your own user name:

* Modify the name to Manjaro. Next question, modify the icon for the shortcut. Use everything to search for maia.svg, which is the SVG icon for Manjaro. Using ImageMagick to convert to ICO format, bash input: convert maia.svg manjaro.ico :

E:\manjaro>Bash[[email protected] Manjaro]$ convert maia.svg Manjaro. Ico[[email protected] Manjaro]$

* Modify the icon of the shortcut:

* OK, okay. Now you can click on the shortcut to start the Manjaro, just like the beginning. Note: You should try to avoid starting multiple xwin.

2.6 Miscellaneous and testing

* /etc/pacman.conf added to the source of arch4edu:

== http://mirrors.tuna.tsinghua.edu.cn/arch4edu/$arch

* Input: sudo pacman-syu , then install mayavi-py3: sudo pacman-s mayavi-py3 .

* Enter Mayavi2, start Mayavi. Run the example program:

3. Concluding remarks

After the use of ALWSL installed ArchLinux, not satisfied. Accordingly, according to ArchLinux official website's explanation, installs the archlinux.

After a few attempts, we found a way to successfully switch to the Manjaro environment. By the way, the boot mode is optimized. Use the shortcut in combination with VBScript to hide the command-line form when the desktop environment starts.

Although the environment under the WSL is not satisfactory, it also allows us to see the possibility of playing Linux environments in Windows. Finally, I wish you all a pleasant play:).

  

WSL use summary: from ArchLinux to Manjaro

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.