GithubHelp home page GithubHelp 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. :)

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

wsl-tutorial's People

Contributors

qmonkey avatar j2doll avatar crramirez avatar tomashubelbauer avatar

Stargazers

mmsobolev avatar  avatar Dominik Antal avatar flyfire avatar Yanjin Li avatar  avatar Gaurav Kanoongo avatar Hasan avatar André Kruger avatar Stephanie Nadeau avatar  avatar Maxim Kosterin avatar  avatar  avatar  avatar  avatar Ben avatar Rikka0_0小六花 avatar  avatar  avatar  avatar  avatar Magnus Nemo avatar Amin D. Hatib avatar  avatar Laurence avatar Imaginary Stargazer avatar Molasses avatar  avatar  avatar Mathias Sven avatar  avatar rubickecho avatar Oscar Barrett avatar Patrick Kerschbaum avatar Null avatar HAOYU  LI avatar Hussain Sabir avatar Qeaux avatar  avatar  avatar  avatar MG avatar Yellow Fish avatar James Blackburn avatar Kshitij Arya avatar 深代ゆかり avatar  avatar hossein s. borhani avatar Aaron Linder avatar ETBox avatar Bongjun Jang avatar Deez avatar Joost van Dijk avatar RED COBRA avatar chicagoist avatar AFattahi avatar NeoChow avatar Chris Brooks avatar Alice avatar Zhenyu Lei avatar  avatar John Kordich avatar  avatar Marcus Albertsson avatar Glyne J. Gittens avatar Pablo Cabezas avatar Fredrik Averpil avatar 曾令燊 avatar TJ avatar xtvjxk avatar Deke Kincaid avatar Daniel Mahler avatar  avatar  avatar hanjian avatar Dongliang Qin avatar Ahmed Yasin KUL avatar Dmitry Semigradsky avatar  avatar  avatar Vladimir Kochetkov avatar xcy avatar  avatar Daniel Hall avatar Travis Vitale avatar Zbigniew Juruś avatar Vinnie avatar @xeronull avatar Tomato1107 avatar Talha Kerpiççi avatar  avatar huang825172 avatar  avatar There Is No TIme avatar guo avatar Moch. Raditya Aulya Aramdhan avatar wen avatar Guang Li avatar DilongX avatar

Watchers

 avatar Luca Boscolo avatar Charles Simchick avatar DartPower avatar Thomas Copper avatar  avatar  avatar Jonas Erbe avatar Jamie R. Robillard Sr. avatar L.Zhang avatar paradj avatar david.wang avatar Eric Field avatar SyXo avatar  avatar  avatar  avatar MG avatar jack lee avatar  avatar Tamago avatar

wsl-tutorial's Issues

`apt-get install` unable to locate font packages

In the font installation step, only sudo apt-get install fonts-noto succeeds.
The following apt-get install commands fail with an "E: Unable to locate package fonts-..." error:

sudo apt-get install fonts-hack-otf
sudo apt-get install fonts-hack-ttf
sudo apt-get install fonts-hack-web
sudo apt-get install fonts-noto-hinted
sudo apt-get install fonts-noto-mono
sudo apt-get install fonts-noto-unhinted
sudo apt-get install fonts-noto-cjk

I noticed that this page says:

This package used to contain the web variants of the Hack font, which are now part of the consolidated fonts-hack package.

This package is a dummy transitional package. It can be safely removed.

The other fonts-hack-* packages are also described as dummy transitional packages that can be safely removed.

However, sudo apt-get install fonts-hack also fails with an "E: Unable to locate package fonts-hack" error.

xrdb: Can't open display

Following wsl2-tutorial - using ArchLinux instead of Ubuntu - I get the following error when I try to run startxfce4:

$ startxfce4
/usr/sbin/startxfce4: X server already running on display 192.168.96.1:0
xrdb: Connection timed out
xrdb: Can't open display '192.168.96.1:0'
Failed to connect to bus: No such file or directory
dbus-update-activation-environment: error: unable to connect to D-Bus: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
Unable to init server: Could not connect: Connection refused
xfce4-session: Cannot open display: .
Type 'xfce4-session --help' for usage.

$ env | grep -i dbus returns an empty result.

So I run $ export $(dbus-launch) and then:

$ env | grep -i dbus
DBUS_SESSION_BUS_PID=6069
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-LGwJ05xky5,guid=5d62e22c1553514e0ab605f65ef24f39

With that I got rid of the unable to connect to D-Bus error, but then I got another one:

$ startxfce4
/usr/sbin/startxfce4: X server already running on display 192.168.96.1:0
xrdb: Connection timed out
xrdb: Can't open display '192.168.96.1:0'
Failed to import environment: Process org.freedesktop.systemd1 exited with status 1
Unable to init server: Could not connect: Connection refused
xfce4-session: Cannot open display: .
Type 'xfce4-session --help' for usage.

Some other info:

$ systemctl --user status
Failed to read server status: Process org.freedesktop.systemd1 exited with status 1

$ systemctl --user show-environment
Failed to get environment: Process org.freedesktop.systemd1 exited with status 1

$ systemctl status -l --no-pager user@$(id -u).service
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

Any idea where the problem could be and how I can fix it?

/etc/dbus-1/session.conf file does not exist

I tried following your tutorial

just wanted to mention the path to the dbus config has been changed to '/usr/share/dbus-1/session.conf'
source

I also wanted to suggest to relocate the paths of the to-edit files to before what needs to be changed
e.g "In file /usr/share/dbus-1/session.conf, replace x with y"
just UX things
nice tutorial anyways

how to add sogoupinyin input method?

In xfce desktop envrionment, I can't setup a chinese input method such as sougou, do you have any suggestions? I have followed your instructions, but it seems not working.

Under the new Ubuntu 18.04, /etc/dbus-1/session.conf no longer exists

Hi,
I installed the new Ubuntu 18.04 from the Windows Store today. WSL works fine for me, and I followed your tutorial until it got to the point where I needed to edit dbus config. However, I can not find /etc/dbus-1/session.conf. There are instead two directories: session.d, which is empty, and system.d, which has a bunch of unrelated files. Performing a cat * | grep -i listen and cat * | grep -i auth turned up nothing. My graphical setup still works well, I can still run gedit and xeyes, but I keep getting complaints about dbus and connection refused. Any help appreciated.

Thanks,
Arjun

xrdp Can't open display.

kamey@DESKTOP-NN9F1DD:~$ startxfce4 /usr/bin/startxfce4: X server already running on display :0.0 xrdb: Connection refused xrdb: Can't open display ':0.0' Unable to init server: Could not connect: Connection refused xfce4-session: Cannot open display: . Type 'xfce4-session --help' for usage.

Does anyone know what is the problem?

GitHub Releases

Hey, I have this repository on watch so I just noticed you pushed information for WSL2, which is great, thanks for that work!

I wonder if you would be willing to start doing GitHub Releases with major changes to content so that people could select "Watch Releases" and get a notification when you do so? Creating a new release is simple through the GitHub web UI.

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.