Sometimes you need tools from Linux like compiling c, cpp in gcc, grep, git.
Alternatives for Windows are available but all are not efficient.
Sometimes you need to try these tools, what you do is installing Ubuntu in VMWare or Virtual Box. Another alternative is Multiboot.
But what if we had all these tools/Ubuntu in Windows itself? It will make it super easy to work with. You can edit files in your favorite editor and then compile in that Ubuntu, without VM, without Multi boot.
It is possible with Bash on Ubuntu on Windows, which brings the Terminal (Bash) on your Windows 10. π
It is called Windows Subsystem for Linux (WSL).
Currently it is in the insider preview builds, if you don’t want to wait for the final update (probably it will take 1 or 2 months)
just install the insider builds, slow ring has also these feature now.
Check out this, how to enable it and use it.
http://www.techrepublic.com/article/windows-10-how-to-add-ubuntu-bash-to-the-start-menu/
If it asks for username after install just give root for now.
After enabling it when you run lxrun /install
in cmd it downloads one tar file which has untouched Ubuntu files by Canonical.
and extracts it to C:\Users\Username\AppData\Local\lxss\rootfs
.
The tar file is downloaded in %tmp%
and gets deleted after extraction.
Most of the tools are working you can apt-get packages (installing apps).
All drives are mounted at /mnt/c
, /mnt/d
…
apt-get update
apt-get install gcc g++
cd /mnt/d/file.c
gcc file.c
./a.out
Socket programming also works perfectly π
If the apt-get update just keep on showing updating package list, check your connection first.
If you are using Bitdefender then make the current adapter trusted in firewall.
If you want color prompts than white text ones
cd
vim .bashrc
force_color_prompt=yes
Don’t edit any files from lxss directory with any other editor than Notepad, doing that will make the files disappear from WSL.
Other editors erase the extra attributes which are needed for WSL.
It’s not a VM nor a ported bash like other programs available.
In Computers OS has a software part called Kernel which is the intermediate between other softwares and Hardware.
To implement WSL they have a driver called LXSS Core in Windows NT Kernel.
This driver works as kernel for the Linux Subsystem. For communication softwares use SYSCALLS.
When an software from Linux Subsystem communicates with Kernel, the call goes to LXSS Core, if possible it handles the Call on it’s own. Sometimes LXSS Core have to call similar SYSCALL from NT Kernel (like opening a file).
This video from channel9 explains this in detail,
If you want more detail on how it works and how file system and SYSCALLS are implemented, watch all these videos,
Windows Subsystem for Linux: Process Architecture
Windows Subsystem for Linux - Syscall Translation
Windows Subsystem for Linux: File System
More information, updates, report bugs here -
https://github.com/Microsoft/BashOnWindows
Get it and play around with it π, comment down below the softwares you tried on WSL.
Comments are not enabled on this site. The old comments might still be displayed. You can reply on one of the platforms listed in βPosted onβ list, or email me.
I got Bash on Ubuntu on my Laptop. Thanks for the information.