20160414 bash on ubuntu on windows 10 - plembo/onemoretech GitHub Wiki

title: Bash on Ubuntu on Windows 10 link: https://onemoretech.wordpress.com/2016/04/14/bash-on-ubuntu-on-windows-10/ author: phil2nc description: post_id: 11078 created: 2016/04/14 10:37:25 created_gmt: 2016/04/14 14:37:25 comment_status: closed post_name: bash-on-ubuntu-on-windows-10 status: publish post_type: post

Bash on Ubuntu on Windows 10

This was announced at the end of last month. I've now had a chance to kick the tires on the Beta for Bash on Ubuntu for Windows in the latest Preview build of Windows 10. It's a huge step forward for Microsoft. But beware early adopters: there be dragons there! First, to get the Windows Subsystem for Linux (hereinafter, "WSL"), you need to be on the latest Windows Insider program Preview build for Windows 10. This is a brand new feature  for Windows that is not now, and probably never will be, available for previous versions of Windows. What you get after enabling WSL is a mostly functional Ubuntu Linux userland in a terminal session. From my testing there are still some pieces missing, like its inability to handle raw network sockets (there are a few perl programmers out there who will be sad to hear that). That means that many networking tools like ping and dig won't work. In addition, you may need to create your own /etc/resolv.conf and list your local nameserver in it. I and others found that WSL doesn't always set this up automatically. Fortunately the initial environment includes vim, so making that fix is easy enough once you've dug through the issues forum far enough to find it. By and large the apt package system works well, as do most of the software that can be installed with it. It's actually an educational experience to watch some of my favorites, like nmap, fail with a "route_dst_netlink: cannot create AF_NETLINK socket: invalid argument". Buy hey, "cat /proc/cpuinfo" works! Although I enjoy the novelty of this new feature and am happy to toy with it on my Windows 10 test instance, at this point packages like Git for Windows are a lot more useful to me (the latest builds of MSYS2, on which Git for Windows is based, not so much -- but that's a story for another day). Those alternatives still require hunting down and installing native Windows binaries for important things like dig (available in BIND for Win64) and nmap, but that's the legacy 20 years of Microsoft defending its walled garden at all costs. Of course if you've got the CPU (an i3 or above) and RAM (at least 8GB ) to support it, your best bet if you have to run Windows would be to install Oracle's free VirtualBox and run a Linux virtual machine inside it (allocating 1 CPU core and 4GB RAM to it). VirtualBox lets you share resources like disk folders and clipboards pretty seamlessly between machines and I've found that arrangement is probably best for heavy system administration.

Copyright 2004-2019 Phil Lembo