Git Product home page Git Product logo

wsl-tutorial's Introduction

wsl-tutorial

The tutorial will tell you how to run desktop environment inside Windows Subsystem for Linux. And you don't need to build a developement environment with virtual machines any more. :)

Screenshot

wsl

Prerequisites

Your PC must be running a 64-bit version of Windows 10 Anniversary Update build 14393 or later.

To find your PC's CPU architecture and Windows version/build number, open Settings>System>About. Look for the OS Build and System Type fields. system

Installation

In order to run Bash on Windows, you will need to manually:

1.Turn-on Developer Mode

developer

2.Enable the “Windows Subsystem for Linux (beta)” feature

windwos_features

After enabling Windows Subsystem for Linux

1.Restart your computer

2.Run bash

bash

After you have accepted the License, the Ubuntu user-mode image will be downloaded and a “Bash on Ubuntu on Windows” shortcut will be added to your start menu.

Install VcXsrv

Install the lastest version of VcXsrv.

Upgrade ubuntu

sudo apt-get update
sudo apt-get upgrade

Install xfce desktop

sudo apt-get install xfce4-terminal
sudo apt-get install xfce4

Specify the display server

Add DISPLAY=:0.0 to your ~/.bashrc, and don't forget to run source ~/.bashrc. :)

export DISPLAY=:0.0
export LIBGL_ALWAYS_INDIRECT=1

Fix dbus error (Only Ubuntu 14.04 and Ubuntu 16.04)

You need to replace

<listen>unix:tmpdir=/tmp</listen>

with

<listen>tcp:host=localhost,port=0</listen>

in /etc/dbus-1/session.conf.

Fix connection refused (Only Ubuntu 14.04)

You need to replace

<auth>EXTERNAL</auth>

with

<auth>ANONYMOUS</auth>
<allow_anonymous/>

in /etc/dbus-1/session.conf.

Open display server

Open XLaunch, choose “One large window” or “One large window without titlebar” and set the “display number” to 0. Other settings leave as default and finish the configuration.

VcXsrv

Run xfce desktop

Execute the following command inside “Bash on Ubuntu on Windows”.

startxfce4

Fix powerline fonts rendering

Install the lastest version of Hack fonts.

Fix Unicode fonts rendering

sudo apt-get install fonts-noto
sudo apt-get install fonts-noto-hinted
sudo apt-get install fonts-noto-mono
sudo apt-get install fonts-noto-unhinted

Fix Chinese fonts rendering

sudo apt-get install fonts-noto-cjk

Fix mkdir command has wrong permissions

Add the following shell code to your bashrc

if grep -q Microsoft /proc/version; then
    if [ "$(umask)" == '0000' ]; then
        umask 0022
    fi
fi

Install Chinese input method

1.Install fcitx

sudo apt-get install fcitx
sudo apt-get install fcitx-pinyin

2.Add the following command to your bashrc file

export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx

3.Relogin

Install drop-down terminal

sudo apt-get install guake

How to shutdown wsl

1.Close VcXsrv

2.Exit “Bash on Ubuntu on Windows”

Enjoy your self

Please enjoy your development environment. :)

References

wsl-tutorial's People

Contributors

qmonkey avatar tomashubelbauer avatar hfmanson avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.