LoginSignup
5
5

More than 5 years have passed since last update.

Bash on Ubuntu on Windows

Last updated at Posted at 2016-09-09

Overview

Windows10 Anniversary Updateから、公式にBash(UbuntuのBashシェル)がWindowsに取り入れられた。(但しまだBeta)

BoW.png

技術的なことについては、以下にいろいろ書いてある。

Bash on Ubuntu on Windowsとは? そのインストールと使い方
http://www.buildinsider.net/enterprise/bashonwindows/01

インストール&初期設定

このあたりを参考に。
大前提として「Windows10 Anniversary Update(Version 1607)」が適用済みであること。
なお、Anniversary Updateは1時間ぐらいかかるので注意が必要。
また、Windows Updateでうまく適用できない場合はMicrosoftのサイトから直接Updateファイルを落としてきたほうが早い。

Windows 10 の更新履歴
https://support.microsoft.com/ja-jp/help/12387/windows-10-update-history

Bash on Ubuntu on Windowsをインストールしてみよう!
http://qiita.com/Aruneko/items/c79810b0b015bebf30bb

【シェル芸人への道】Bash on Windowsを探検する
http://qiita.com/t_nakayama0714/items/9d7cfc5029a9b2ea423d

不具合関連

日本語表示

2016/09の時点で日本語の表示がいまいちなので、
インストール後に下記のコマンドで言語設定を「en-US.UTF8」にしたほうが便利。

$ sudo update-locale LANG=en_US.UTF8

ネットワーク関連

ネットワーク回りがまだいまいちでNETLINK Socketの対応などもまだ。
また、pingを打つには管理者権限でbashを起動する必要がある。

Add NETLINK Socket support.
https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/14605521-add-netlink-socket-support

WSL - Frequently Asked Questions
https://msdn.microsoft.com/commandline/wsl/faq

Why does the ping command require bash to be started with admin privileges?

This is a known issue that has to due with differences between the way the Linux and the Windows kernel handle the ICMP request that makes ping possible. We plan to address this in future releases.

Tips

パスワードを忘れたのでリセットしたい

久しぶりに起動してsudoしようとしたりすると、パスワードを忘れていたりする。。
その場合には、以下のようにしてリセット可能。

1. コマンドプロンプトから下記を実行し、BoWのデフォルトユーザをrootにする。

cmd
lxrun /setdefaultuser root

2. BoWを起動するとrootになっているので、自分のユーザのパスワードをリセットする。

BoW
# passwd [パスワードを忘れたユーザ名]

3. 再度コマンドプロンプトからBoWのデフォルトユーザを元に戻す。

cmd
lxrun /setdefaultuser [パスワードを忘れたユーザ名]
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5