Windows Subsystem for Linux (WSL)

Kaiser Soze

Johtaja
Liittynyt
18.10.2016
Viestejä
4 961
Täällä keskustelua tästä uuden Windowsin ehkä parhaasta(oma mielipide) ominaisuudesta! Aihe tulee aina vain mielenkiintoisemmaksi koska tuohon panostetaan nyt kovasti ja uudessa Creators Updatessa tuli vaikka mitä herkkuja:

Windows 10 Creators Update: What’s new in Bash/WSL & Windows Console
★★★★★
★★★★
★★★
★★


avatar.jpg
Rich Turner [MSFT]April 11, 20170


When Windows 10 Anniversary Update (AU) was shipped, the Windows Subsystem for Linux (WSL) was still far from complete, and was known to have many incompatibilities, especially with popular developer tools like node.js, Java, etc.

However, it was important to get this exciting new feature into the hands of real users so that we could learn from them – YOU! – what WSL needed to run, what worked, and what didn’t, etc.

And ***wow!*** did you, our community respond!

This release was built by and for YOU!
On behalf of the WSL & Console engineering teams, a very sincere and grateful THANK YOU to all of you who’ve tried and used Bash/WSL over the last 12+ months, and especially to all of you who filed issues on our GitHub issues repo, contacted me on Twitter, submitted/voted for asks on our UserVoice, asked questions on StackOverflow, AskUbuntu, Reddit, our Command-Line Blog, the WSL Team Blog and elsewhere.

The massively improved Bash/WSL & Windows Console that we’re shipping in Windows 10 Creators Update is due largely to all of you!

What’s New in WSL?
During the Windows 10 Creators Update (CU) development cycle, the WSL engineering team implemented hundreds of fixes and improvements, most of which were catalogued in the WSL release notes. While we highlighted some of the more visible features of Console & WSL in our Command-Line Blog, we thought a consolidated list of the most important features and improvements would be useful.

So, read on to find out, what’s new in Bash/WSL & Console in Windows 10 Creators Update:

More compatibility
A key goal for Win10 CU was to dramatically improve WSL’s depth and breadth of compatibility with the Linux System Call Interface (SCI). By expanding and improving our syscall implementations, we increase the tools, platforms, runtimes, etc. that our users need to run.

The result? In Win10 CU, most mainstream developer tools now work as expected, including:

  • Core tools: apt, sed, grep, awk, top, tmux, ssh, scp, etc.
  • Shells: Bash, zsh, fish, etc.
  • Dev tools: vim, emacs, nano, git, gdb, etc.
  • Languages & platforms: Node.js & npm, Ruby & Gems, Java & Maven, Python & Pip, C/C++, C# & .NET Core & Nuget, Go, Rust, Haskell, Elixir/Erlang, etc.
  • Systems & Services: sshd, Apache, lighttpd, nginx, MySQL, PostgreSQL
  • And many, MANY others!
Note: Some of you may also have been following along with some intrepid explorations into running X/GUI apps and desktops on WSL. While we don’t explicitly support X/GUI apps/desktops on WSL, we don’t do anything to block/prevent them from running. So if you manage to get your favorite editor, desktop, browser, etc. running, GREAT but know that we are still focusing all our efforts on delivering a really solid command-line experience, running all the command-line developer tools you need.

Ubuntu 16.04 support
While Win10 Anniversary Update delivered Ubuntu 14.04 support, in Win 10 Creators Update, WSL now supports Ubuntu 16.04. Any new Bash instances installed on Win10 CU will now install Ubuntu 16.04.

If you’d like to find out what version of Ubuntu you’re running, enter the following at your Bash on Ubuntu on Windows Console:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
Important Note: Existing Ubuntu 14.04 instances are NOT automatically upgraded to 16.04: You must manually upgrade your instance to Ubuntu 16.04 in one of two ways:

  1. Remove & Replace (recommended)
  2. Upgrade In-Place
Remove & replace
If you’re currently running an Ubuntu 14.04 instance, we recommend removing and replacing your existing instance with a fresh new Ubuntu 16.04 instance.

WARNING: The instructions below will delete your existing distro and any of the files you’ve stored in the Linux filesystem. Therefore, be sure to copy/move any Linux files you want to keep, for example, to a Windows folder (e.g. /mnt/c/temp/wslbackup/…) BEFORE removing and replacing your instance!

To remove and re-install your Ubuntu instance, run the following commands from a Cmd/PowerShell Console.

C:\> lxrun /uninstall /full /y
...
C:\> lxrun /install
The lxrun /install command above will then download and install a fresh new copy of Ubuntu 16.04 onto your machine.

Upgrade In-Place
If your Ubuntu instance is particularly complex to configure, you can opt to upgrade it in-place, though this may not result in an optimal instance.

If you opt to upgrade your instance in-place, use Ubuntu’s instructions for upgrading an existing instance:

$ sudo do-release-upgrade
Ifconfig & network connection enumeration support
One of Win10 AU’s biggest annoyances was that it lacked the ability to enumerate network connections which prevented tools like ifconfig, gulp, npm and others from running correctly.

This has been fixed in Win10 CU and you can use ifconfig to enumerate and examine the configuration of your available network adapters:



Ping & ICMP network support
Another issue that users quickly bumped into in Win10 AU was the fact that non-administrators could not ping a network endpoint. This has now been fixed in Win10 CU:



File change notification support (INOTIFY)
Another much-requested improvement is the ability for a tool to register for notifications when a file is changed. This is an essential capability used frequently by web, Node.js, Ruby and Python developers, and many others.

For example, if you were working on a node.js website project, editing your source in vim, Emacs, Sublime Text, VS Code, etc., whenever you save your code, you might want your website server to reload your newly changed page source so that you can refresh your browser and see your changes reflected immediately.

Well, now you can! WSL supports inotify which allows apps to register for filesystem change notifications, which can then trigger actions, like rebuilding a project, or restarting a local web server. This works for both DrvFS and internal LXFs locations.

Importantly, this file change notification support also supports file change notifications for files in the Windows filesystem. This means that you can edit your project source stored on your Windows filesystem using a Windows GUI editor such as VSCode, Visual Studio, SublimeText, Notepad++, etc. and have node.js running in Bash/WSL serving your website locally, and picking up your changes as you save your files!



Windows <-> Linux Interop
A key goal of building WSL was to reduce the “gaps” experienced when running Windows tools alongside Linux command-line tools and environments. When we shipped WSL in Windows 10 AU, we brought Linux and Windows alongside one another, but there was still a large “gap” – while both systems could share some of the same files, each environment was pretty isolated from one another.

Users often told us that they wanted to be able to invoke Windows applications from within Bash, and to invoke Linux applications from within Windows. So, we added this feature!

In Windows 10 Creators Update, you can now launch Windows apps & tools from within Bash …



… and you can launch Linux binaries/commands/scripts from within Windows:



Read our blog post on this feature for more details:

UNIX and Netlink Socket improvements
Some aspects of UNIX sockets and Netlink sockets were not supported in Anniversary Update.

In Creators Update, UNIX datagram sockets and Netlink sockets, options & properties were added to WSL, enabling various forms of IPC that allow many modern tools to run on WSL.

For more details, review the WSL Release Notes.

TCP socket & IPv6 improvements
In Creators Update, the WSL team and Windows Core Networking teams worked together to enable WSL to support several additional IPv6 & TCP socket options & properties. This enables a broad range of tools and technologies that rely upon various network socket features, improved IPv6 support, etc.

For more details, review the WSL Release Notes.

Miscellaneous WSL Improvements
The WSL improvements listed above are just a selection of the most visible and noteworthy changes, but there are many hundreds of other WSL improvements included in Creators Update. Below are a few more, and don’t forget to dig through the release notes for more detail.

Windows Console & Command-Line Improvements:
The Windows Console is one of the most fundamental pieces of the entire Operating System and has been part of Windows for several decades. Around 2 years ago, a new Windows Console team was formed to own give the Console its biggest overhaul in more than 30 years!

One of the key drivers for the Console overhaul was the need to enable the Console to render the output of Linux command-line tools & applications running on WSL. The team are also performing some much needed surgery & modernization to the Console’s underpinnings and internals, which will allow for far more rapid and exciting feature development in the future.

So, what’s new in the Console in Win10 CU?

Many VT Sequence Improvements
Because the Windows Console was not originally built to support *NIX, it was unable handle the different behaviors and output formatting codes (ANSI Escape Codes & VT sequences) generated by *NIX command-line tools & applications.

But, no longer:

In Windows 10 Anniversary Update, the Console was improved with the ability to handle most common VT Sequences, enabling it to correctly render the majority of simple text formatting. However, it lacked support for several advanced scenarios.

In Windows 10 Creators Update, Windows Console’s VT Sequence support was further improved to correctly handle several more advanced VT Sequences, enabling the Console to light-up many rich text-UI features in vim, emacs, Midnight Commander, tmux, htop, etc:



24-bit color support
Another frequent ask from the community was for the Console to support > 16 colors. Support for 256+ colors is increasingly important when working with today’s increasingly rich and sophisticated command-line tools, shells, etc.

In Win10 Creators Update, the Console has been updated to support full, glorious 24-bit color!



For more details, read the accompanying blog post announcing 24-bit color support in the Console.

Mouse support
With the number of rich, text-based UI’s ever increasing, users wanted mouse support for tools like Midnight Commander, Htop, etc., so we added mouse support in Win10 CU.




* Author’s artistic rendition for illustrative purposes



Symlinks in Windows without Admin Rights
Symlinks are an important tool used comprehensively in Linux, but less so in Windows since admin rights were required to create symlinks, and the Console in which the symlinks were created had to be run elevated as admin – something users rarely do.

In Windows 10 Creators Update, the admin-rights restriction has been lifted for users who have enabled developer mode, allowing symlinks to be created from an un-elevated Console.

Read the release announcement for more symlink details & examples.

What’s Next?
So, are we done yet? Noooo! Far from it!

Both WSL and Windows Console have backlogs stuffed full of improvements, features and new capabilities that we’re eager to get working on.

In addition, while Console and WSL have been significantly improved in Creators Update, it is important to note that WSL remains a beta feature in Win10 Creators Update while we shave-off some rough edges and improve some core features and capabilities.

We continue to forge ahead with many planned improvements and exciting new features. Stay tuned for lots more exciting features coming in future releases of Windows 10: If you want to be among the first to access and experience improvements planned for the next Windows 10 release, be sure to sign up to the Windows Insider program and set your Windows Insider Update Ring to “Fast”!

And, as always, PLEASE KEEP YOUR FEEDBACK COMING: Let us know if you find issues when using WSL on the WSL GitHub issues repo, feel free to ask questions on Twitter, suggest new features on UserVoice, carry on all the great discussions on Reddit, StackOverflow, SuperUser, etc, and keep the comments coming on this Command-Line Blog, and the WSL Team Blog.

Onwards!



Minkäslaisia virityksiä on tecciläiset kyhänneet Ubuntuun? Omassa käytössä tuo on päivittäin kun bash vain on se minkä osaan parhaiten ja Linuxille löytyy paljon käteviä työkaluja joita ei Windowsille ole(omasta mielestä toim huom).
 
Hyvä summaus. Itse en vielä ole tuota uusinta updatea ajanut sisään, mutta tämä päivitys on erittäin tervetullut. Käytännössä korjaa kaikki ne rajoitteet joihin itsellä on moni asia jäänyt ja palannut Cygwin puolelle. Nyt näyttäisi siltä, että WSL pystyy täysin korvaamaan Cygwinin.

Vielä jos pääsisi käsiksi levyihin suodaan fdisk, dd tms niin sitten olisi jo melko harvassa että tarvitsisi mennä VMWaren puolelle yleensäkään.
 
Ainakin tuntuisi hieman bugaavan ruudun päivitys. SSH serverille ja nanolla kun muokkaa vaikka crontabia jossa tabeja tms niin sotkee ruudun. Pitää tutkia onko tuohon jotain ratkaisua, voipi olla ihan muuttuja shellissä tms.
 
Tosiaan graafista puolta ei ole tuettu mutta "sen käyttämistä ei estetä". Eli seuraavalla hyvin yksinkertaisella prosessilla pitäisi graafiset ohjelmat lähteä tulille:

- Ensin asenna X windowsille ja käynnistä se: Xming X Server for Windows

Koodi:
export DISPLAY=:0

Sitten vain käynnistät normaalisti haluamasi ohjelman.
 
Noniin saatana, saatiinhan tämäkin kikkare rikki.

Koodi:
bash: /root/.bashrc: I/O-Error

Asensin paskan uudelleen lxrunilla ilman virheitä mutta kyseinen virhe pysyy.

edit. Rikkinäinen käyttäjähän se siellä. Laitetaan vielä Googlea varten loitsu jolla komentokehotteesta tai powershellistä luot uuden käyttäjän:
Koodi:
lxrun /setdefaultuser käyttäjänimi
 
Viimeksi muokattu:
Jokos tämä kikkare toimii edes joten kuten kunnolla?
 
Itse en mitään major ongelmia ole havainnut, mutta tässä edellisellä viikolla tuli huomattua että rootfs systeemiin ei voi Windows -puolelta kopioida tiedostoja lennosta muuta kuin tekemällä linkin jonnekin Windowsin kansioon. Tekee Linux -puolen debuggaamisesta hieman hankalaa kun Windows puolen IDE:stä siirtelee tiedostoja.

Cygwin tässä suhteessa siis vielä parempi.
 
Itse en mitään major ongelmia ole havainnut, mutta tässä edellisellä viikolla tuli huomattua että rootfs systeemiin ei voi Windows -puolelta kopioida tiedostoja lennosta muuta kuin tekemällä linkin jonnekin Windowsin kansioon. Tekee Linux -puolen debuggaamisesta hieman hankalaa kun Windows puolen IDE:stä siirtelee tiedostoja.

Cygwin tässä suhteessa siis vielä parempi.

Itse huomasin että nmap yms verkon sorkkimis työkalut ei tykkää toimia.
 
Itse huomasin että nmap yms verkon sorkkimis työkalut ei tykkää toimia.

No sekin on totta. En niitä ole edes jaksanut koettaa käyttää. Cygwin toimii onneksi hyvin, mutta on siinäkin omat rajoitteensa. Siihen pitäisi päästä että voisi ajaa kaiken mitä VMwaren kautta Ubuntu bashissa, niin olisi kyllä täydellinen tooli.
 
Itse huomasin että nmap yms verkon sorkkimis työkalut ei tykkää toimia.

No sekin on totta. En niitä ole edes jaksanut koettaa käyttää. Cygwin toimii onneksi hyvin, mutta on siinäkin omat rajoitteensa. Siihen pitäisi päästä että voisi ajaa kaiken mitä VMwaren kautta Ubuntu bashissa, niin olisi kyllä täydellinen tooli.

Se on ihan tiedossa että netlink socketit implementoidaan/tiin myöhässä jne. Kyseessä ei ole virtuaalikone. Täyttä Linux-järjestelmää tarvitsevat käyttävät jotain muuta kuin WSL:ää. Windows Subsystem for Linux – The underlying technology enabling the Windows Subsystem for Linux GitHub - Microsoft/WSL: Issues found on WSL setsockopt(fd, IPPROTO_IP, IP_MTU_DISCOVER, ...) fails · Issue #170 · Microsoft/WSL · GitHub


PS. Oisko muuten kellään jakaa kivaa bashrc:tä?
 

Statistiikka

Viestiketjuista
261 347
Viestejä
4 535 699
Jäsenet
74 790
Uusin jäsen
anykanen

Hinta.fi

Back
Ylös Bottom