LoginSignup
60
68

More than 3 years have passed since last update.

windows10で快適なCUI環境を構築する

Last updated at Posted at 2017-09-08

(追記)
この記事は古いのでWSL2対応版を参照してください。
https://qiita.com/vitway/items/c0383f701f14997e052a

windows10で快適なCUI環境を構築する

  • Bash on Ubuntu on Windows環境を構築する
  • AWS上のサーバーにはこの環境からsshする
  • 脱cygwin

Bash on Ubuntu on Windows本体の導入

ターミナルがcmd.exeだとつらい

  • 伝統的なDOS窓ではとても快適とは言えない
  • mintty経由で使えるらしい

wsl-terminalを使う

wsl-terminalから最新版を入手して、適当なディレクトリに展開するだけ
以下では c:\wsl-terminal に展開したものとする

参考: Bash on Ubuntu on Windows + オールインワンmintty

使い方

c:\wsl-terminal\open-wsl.exeを実行するのみ

起動後のカレントディレクトリが起動時のカレントディレクトリになる件

c:\wsl-terminal\open-wsl.exe -l として実行する
または、c:\wsl-terminal\etc\wsl-terminal.conf を設定する

\wsl-terminal\etc\wsl-terminal.conf
[config]
title="        "
shell=bash -l
use_cbwin=0
use_tmux=0
attach_tmux_locally=0

起動時にbashではなく、zshを使いたい

\wsl-terminal\etc\wsl-terminal.conf
[config]
title="        "
shell=/usr/bin/zsh
use_cbwin=0
use_tmux=0
attach_tmux_locally=0

事前に一旦bashでログインしてから、apt-get install zshしておく必要あり

Ubuntu on Windows内での環境設定

aptのproxy設定

社内ネットワークなどでproxyを通さないと外部に出られない場合、/etc/apt/apt.conf にproxyの設定を書く

/etc/apt/apt.conf
Acquire::ftp::proxy "http://proxy.example.com:8080/";
Acquire::http::proxy "http://proxy.example.com:8080/";
Acquire::https::proxy "http://proxy.example.com:8080/";

これでapt-get installで好きなパッケージを導入できるようになる

よく使うものを導入

sh
$ apt-get install git zsh screen

あとはsshするだけ

sh
$ ssh user@your_server
60
68
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
60
68