Skip to content

A tutorial about how to run desktop environment inside Windows Subsystem for Linux

Notifications You must be signed in to change notification settings

QMonkey/wsl-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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. :)

wsl2-tutorial

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 only if your Windows version is older than 1803

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) and only if your Windows version is older than 1803

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

About

A tutorial about how to run desktop environment inside Windows Subsystem for Linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •