Windows_10_Bash - bootstraponline/meta GitHub Wiki
Known Issues
- Bash on Windows issue tracker
- zsh & agnoster is slow on large git repos. multiple second delay after pressing enter.
- fix agnoster bash?
nano ~/.profile. "$HOME/agnoster.bash"- same perf issues. underlying reason appears to be
giton Bash for Windows is slow. - Slow Bash on Windows terminal themes
- Slow Bash on Windows file system performance
Windows Searchservice generates excessive activity (fix: stop viaservices.msc)- Windows Defender generates excessive activity (fix: temp disable real time scanning)
Enable
Search for Turn Windows Features On or Off then enable Windows Subsystem for Linux (Beta)
Add user
# adduser surface# usermod -aG sudo surfacelxrun /setdefaultuser surface- Run incmd.exeafter creating the user via bash
Paths
Path to Bash filesystem: %localappdata%\Lxss
Windows file system is at: /mnt/c
Install Ruby
# code from https://github.com/instructure/dockerfiles/blob/master/ruby/2.3/Dockerfile
sudo -i
apt-add-repository -y ppa:brightbox/ruby-ng \
&& apt-get update \
&& apt-get install -y \
ruby2.3 \
ruby2.3-dev \
make \
imagemagick \
libbz2-dev \
libcurl4-openssl-dev \
libevent-dev \
libffi-dev \
libglib2.0-dev \
libjpeg-dev \
libmagickcore-dev \
libmagickwand-dev \
libmysqlclient-dev \
libncurses-dev \
libpq-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
libxslt-dev \
libyaml-dev \
zlib1g-dev
Update RubyGems
sudo gem update --system
Install Git
sudo add-apt-repository ppa:git-core/ppa; \
sudo apt-get update; sudo apt-get upgrade -y; sudo apt-get dist-upgrade -y; \
sudo apt-get autoremove -y; \
sudo apt-get install -y git
Configure Git
git config --global core.autocrlf true
Oh My ZSH
sudo apt-get install -y zshsh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"git clone https://github.com/powerline/fonts.git powerline_fonts- Double click to install
fonts/Meslo/Meslo LG M DZ Regular for Powerline.otf
- Double click to install
- Install latest release of ConEmu
- Configure font. Settings → Main → Main console font

- Configure style. Settings → Features → Colors → Schemes →
<Solarized (Luke Maciak)>
- Configure font. Settings → Main → Main console font
- Edit
~/.zshrcand set theme toagnoster
- Uncomment
DISABLE_LS_COLORS="true"in~/.zshrc- By default all permissions are 777 which makes the folders difficult to read when using ls coloring.
- Edit
~/.bashrcto start withexec zsh. This will launch ZSH by default.nano ~/.bashrc- Ctrl+O then Ctrl+X
- Set
bashas the default startup terminal.- Settings → Startup → Command line

- Settings → Startup → Command line
- Add custom method to go to code directory.
nano ~/.oh-my-zsh/custom/custom.zsh
# c loads the code directory
alias c="/mnt/c/Users/surface/code"
alias zshconfig="nano ~/.zshrc"
alias zshcustom="nano ~/.oh-my-zsh/custom/custom.zsh"
alias zshreload=". ~/.zshrc"
Update Ubuntu Release
- Set update mode (normal or LTS)
nano /etc/update-manager/release-upgrades
- Start dbus before installing apt packages
sudo service dbus start
- Activate interactive sudo to prevent terminal from asking for a password.
sudo -i
sudo apt-get update; sudo apt-get upgrade -y; sudo apt-get dist-upgrade -y; sudo apt-get autoremove -ysudo do-release-upgrade -f DistUpgradeViewNonInteractive -d- Wait a while. Ignore any errors. May have to Ctrl+C and then invoke dpkg to finish package config.
echo 'yourpassword' | sudo -S dpkg --configure -asudo apt-get update; sudo apt-get upgrade -y; sudo apt-get dist-upgrade -y; sudo apt-get autoremove -y
Verify Ubuntu version
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
Set default user on ZSH
- Hide the user@hostname by modifying
zshconfig
export DEFAULT_USER="`whoami`"
Sudo issues
sudo: unable to resolve host SURFACEsudo nano /etc/hosts- Update with
127.0.0.1 localhost SURFACE
sudo: no tty present and no askpass program specified- Run
zshcustomand add:alias sudo="sudo -S"
- Run
pbcopy / pbpaste
Xclip is currently broken on Windows due to lack of display emulation.
Error: Can't open display: (null)
sudo apt-get install -y xclip
$ zshcustom
alias pbcopy="xclip -selection clipboard"
$ zshreload
Reset Ubuntu (from cmd.exe)
lxrun /uninstall /full
lxrun /install /y
Fix bundler error
find ~/.bundle/cache -type d -exec chmod 0755 {} +- https://github.com/bundler/bundler/issues/4599
Notes
- ZSH from Source. Easier to just update Ubuntu to get newer packages.
- Images stored here