Help us understand the problem. What is going on with this article?

Installation of WSL on Windows 10 Pro

More than 1 year has passed since last update.

Setting of WSL

This article was written in 2019-03-09.

Please note that version of Windows, WSL, and other installed applications on Ubuntu may differ when you are reading this article; there is no guarantee to success those installation.

Install Ubuntu 18.04 from Windows Store

Install Ubuntu 18.04 by GUI. Google it for instructions.

Windows settings

Install VcXsrv from
see installation process

bash on Ubuntu

start bash by clicking Windows' start menu -> Ubuntu 18.04. Then,

$ sudo apt update && sudo apt upgrade -y


$ cat << EOF >> .bashrc
export DISPLAY=localhost:0.0

# check
$ source .bashrc # need reload
$ sudo apt install x11-apps
# check launch
$ xeyes

Then install other x11s

$ sudo apt install x11-utils x11-xserver-utils dbus-x11


Set Japanese.

$ sudo apt install language-pack-ja
$ sudo update-locale LANG=ja_JP.UTF-8
# check
$ echo $LANG
$ locale


# selected Asia/Tokyo
$ sudo dpkg-reconfigure tzdata

Japanese input on Xapp

I tried to install ibus-mozc, but it didn't work. So decided to use uim-anthy. See fcitx-mozc installation at



$ sudo apt install leafpad uim uim-xim uim-anthy
# font for x11
# $ sudo apt install fonts-ipafont
$ sudo apt install fonts-noto-cjk fonts-noto-color-emoji
# check Ctrl-Space or 半角/全角 ボタン
$ echo << EOF >> .bashrc
# for uim input
export XIM=uim
export XMODIFIERS=@im=uim
export UIM_CANDWIN_PROG=uim-candwin-gtk
# export UIM_CANDWIN_PROG=uim-candwin-qt
export GTK_IM_MODULE=uim
export QT_IM_MODULE=uim
if [ $SHLVL -eq 1 ]; then
          uim-xim &

# for Japanese keyboard
$ echo << EOF >> .uim
(define default-im-name 'anthy)
(define-key generic-on-key? '("Henkan_Mode" "zenkaku-hankaku" "<Control> " "<Control>\\"))
(define-key generic-off-key? '("Muhenkan" "zenkaku-hankaku" "<Control> " "<Control>\\"))
(define-key anthy-extend-segment-key? '("<Control>o"))
(define-key anthy-shrink-segment-key? '("<Control>i"))

$ source .bashrc
$ leafpad

Desktop -> LXDE

$ sudo apt install lxde
$ startlxde


$ sudo apt install lxpanel
$ lxpanel --profile LXDE &

Change default directory names from Japanese to English like デスクトップ -> desktop

sudo apt install xdg-user-dirs-gtk
LANG=C xdg-user-dirs-gtk-update


Note: snap command is not working on WSL now.

Interacting with snapd is not yet supported on Windows Subsystem for Linux.
This command has been left available for documentation purposes only.

Unofficial Debian / Ubuntu packages of IntelliJ IDEA from JetBrains.
Note: It is your responsibility to use unofficial installer

sudo add-apt-repository ppa:mmk2410/intellij-idea
sudo apt update
sudo apt install intellij-idea-community

IDE -> プログラミング -> IntelliJ IDEA Community Edition

docker on WSL

Note: Ubuntu 18.04 on WSL with Windows 10 1803 does not support latest docker of version 18.
You need to update windows 10 from 1803 to 1809.


$ uname -a
Linux *** 4.4.0-17763-Microsoft #253-Microsoft Mon Dec 31 17:49:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/lsb-release

The below operation is bad installation, showing only for demostrate purpose

# install (fails)
sudo apt update && sudo apt upgrade
sudo apt install -y
sudo apt-get install -y
# restart bash as Admin priviledge (meaning cmd or other console runs as Admin and typo `bash`)
sudo usermod -aG docker $USER
sudo cgroupfs-mount
sudo service docker start
docker run hello-world

Error occurs. Need to downgrade (see

$ docker run hello-world
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:301: running exec setns process for init caused \"exit status 23\"": unknown.
ERRO[0009] error waiting for container: context canceled

Install docker-ce, not

sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs)  stable"
# check previous version
apt-cache madison docker-ce
sudo apt-get install docker-ce=18.06.1~ce~3-0~ubuntu # this version works

# service
sudo usermod -aG docker $USER

sudo cgroupfs-mount
sudo service docker start
docker version

If docker service is resistered, you do not need run bash as Admin.
Restart your windows shell as normal user.

$ docker run -it --rm hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:

For more examples and ideas, visit:

That's all.

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away