Saturday, August 06

Geek

You Got Linux In My Windows!

[bumped with additional notes]

The Windows 10 Anniversary Update is out, and with it.... Linux!

More specifically, Windows Services for Linux and the Ubuntu command-line environment.  It looks like it's based on version 14.04, which isn't the latest release (Ubuntu's version numbers are year.month) but is an LTS release with 5-year support so it's a reasonable choice.

Much tinkering to follow as I build a production environment on my 2lb notebook...

Update 1: If you have a MySQL server running on the Windows side of Windows, you can't start one with default settings on the Linux side, because they will be trying to use the same port on the same IP address.  Obvious once you realise that, and easy to work around.

Update 2: Aha!  Windows drives are available under /mnt, so /mnt/c, /mnt/d, and so on.

Update 3: There are some quirks, which is to be expected.  I tried compiling Redis, and it wouldn't bind a socket.  But the Ubuntu Redis package works fine.  And MongoDB's WiredTiger storage engine doesn't work, but using the Percona version with their TokuFT storage engine does.

Update 4: It requires a little fiddling to get sshd working.  WSL (Windows Services for Linux) doesn't seem to support chroot jails yet, and sshd is configured to use them by default, so it rejects logins even before attempting authentication.  (Not to mention before logging the request - you need to run sshd in the foreground with debugging enabled to even see this.)

You will need to set

UsePrivilegeSeparation no

in /etc/ssh/sshd_config for it to work.  Since that makes it less secure, I also bound it explicitly to localhost (127.0.0.1) so that remote logins are impossible.

Also, since when did Windows have its own SSH server?  I was rather surprised to find it running, and turned it off, but it worked and allowed remote logins (with a password) to the Windows command prompt.

Update 5: Elasticsearch doesn't seem to like running in the Windows 10 Bash Shell Environment Thing.  It goes immediately to 200% CPU and stays there, doesn't respond to queries, and might have locked it up and required a reboot.  (I'm not sure of that; I was doing many other things at the same time.)  That's not fatal since Elasticsearch will run fine on Windows itself, but it's the only thing I've found so far that I couldn't quickly work around.

Update 6: Yrrg.  No, sorry, this is all a bit too beta at the moment.  I'm heading back to Virtualbox.  After running for a while, it either inevitably either grinds to a halt or locks up entirely.

Posted by: Pixy Misa at 09:50 PM | Comments (10) | Add Comment | Trackbacks (Suck)
Post contains 435 words, total size 3 kb.

1 Is this a Microsoft thing?

Posted by: Steven Den Beste at Saturday, August 06 2016 01:49 AM (+rSRq)

2 Yep.  Windows 10 now runs Linux programs.  You could do that before with third party programs like Cygwin, but for that you had to recompile, and not everything worked.

This new system from Microsoft works with existing code, including all command line apps bundled with or compiled for Ubuntu 14.04.  That's a very popular version of Linux, so barring bugs, just about anything I'd want to use should work, like Python and MongoDB and Redis and uWSGI.

GUI programs apparently can be coaxed into running, but it's more complicated and I don't care so much about that for the stuff I do.

Posted by: Pixy Misa at Saturday, August 06 2016 05:07 AM (PiXy!)

3 I felt a disturbance in the force, as millions of Linux purists screamed in agony and were silenced. (As they realized that there is nothing they can do to stop MS from doing this.)

Posted by: Steven Den Beste at Saturday, August 06 2016 11:56 AM (+rSRq)

4 Waiting for more and more Windows based services and background functions to transition to the Linux versions, until Windows and MacOS are both considered competing versions of Linux.

Posted by: Mauser at Saturday, August 06 2016 12:33 PM (5Ktpu)

5 MacOS is actually Unix.  (And so is iOS.)  Android and ChromeOS are Linux, and now Windows runs Linux.  

It is finally the year of the Linux/Unix desktop!  And also laptop, tablet, and phone and everything else. smile

Posted by: Pixy Misa at Saturday, August 06 2016 03:28 PM (PiXy!)

6 Steven, if you're a web developer with a Windows laptop, this is brilliant.  You get up-to-date drivers for your hardware, you can run Word and Excel and Photoshop natively, and you get your full Linux software stack so you can test locally.

And there are a lot more web developers these days than old-school Unix purists.  Enough that Microsoft thought it was worth spending the time to build this tool, even though it competes directly with their ASP.Net stack.

Posted by: Pixy Misa at Saturday, August 06 2016 03:40 PM (PiXy!)

7 The sshd service is turned on when you activate Developer Mode, so that your machine can be used as an install/debug target. There appears to be no way to disable this other than manually disabling the associated services. Apparently they haven't bothered to distinguish between "develop on" and "develop for".

I couldn't get Emacs (even the -nox package) to install, and a quick test shows that the window the bash shell runs in doesn't support the Windows IME or pasting kanji, so it's still got a ways to go to be as useful to me as a Mac. Even with Photoshop and Perl. :-)

-j

Posted by: J Greely at Sunday, August 07 2016 07:19 AM (ZlYZd)

8 Thanks J.  That certainly explains why I never noticed ssh running before!

I was able to install Emacs without a problem, but overall WSL doesn't seem to be very stable yet.  It is in beta, but it feels more like an alpha.  

I'll give it a try on a less cluttered machine (I have a notebook with a fresh Windows 10 install) and see if that helps, but I think it needs another six months of work before it's really ready for use.

Posted by: Pixy Misa at Sunday, August 07 2016 11:01 PM (PiXy!)

9 I had to nuke it and reinstall to get Emacs working. Somehow I'd gotten the package manager into a state where it refused to do anything. Between the official FAQ and the Fun with WSL blog entry, I got it sorted out on the second install.

Their Github issue tracker has some interesting things on it, including a promise to eventually provide offline installs, so you don't have to download from the Windows Store every time. That would be particularly useful when you've really hosed things.

Honestly, I think the best thing about it is that you don't have to deal with the Ubuntu team's attempts to emulate the Windows look and feel; you can just use Windows. :-)

-j

Posted by: J Greely at Monday, August 08 2016 03:52 AM (ZlYZd)

10 It got totally wedged for me as well, and I've done a forced reinstall.  (Had to manually delete the previous install files.)
I'm going to try something simpler now; all I really need is Python, Ruby, PHP, Lua, and uWSGI.

Posted by: Pixy Misa at Monday, August 08 2016 10:29 PM (PiXy!)

Hide Comments | Add Comment




Apple pies are delicious. But never mind apple pies. What colour is a green orange?




56kb generated in CPU 0.0175, elapsed 0.4229 seconds.
58 queries taking 0.4105 seconds, 338 records returned.
Powered by Minx 1.1.6c-pink.