News for hackers. Stuff that matters.
Re:Microsoft's Linux Kernel by mtzet on Saturday June 29, 2019 @03:33AM (#20311301)
This is really Microsoft catching up to the Mac in terms of integration with the open-source ecosystem which importantly drives the web.

In the mid 2000's the Mac really took off due to being a good-enough Linux replacement on the command line, while taking care of all the hardware integration and providing a sleek desktop experience. This really helped the Mac take off among hackers. This system wasn't as open-source as Linux, but it was good enough: Most of us don't want to mess about with the desktop stack. If the stack we care about is open-source and runs across many systems, then we still have the freedom. I find it fairly easy to work on both Mac OS X, Linux and WSL2 -- but not pre-WSL Windows.

The inclusion of a Linux kernel really seems to cause a lot of confusion. No, Microsoft is not about to remove the NT kernel. No, they're not about to supplant Linux. WSL1 did what the guys from Illumos and FreeBSD have also done: since the Linux syscall interface is quite stable, the NT kernel can simply implement these syscalls and handle them appropriately. The was that the NT kernel was still sufficiently different that the filesystem performance was quite poor and complex applications like Docker required more kernel features than was provided by just the syscall API.

Including a Linux kernel is really the nuclear option: rather than trying to fit Linux applications in Windows, they're running in their own world and providing integrations into this world. This means you can now run Docker on WSL2 for instance, but it's also complicated: Kernels really like to think that they own the world, for instance they keep memory around to use for later. WSL2 dynamically grows the amount of RAM allocated to the VM, which is quite clever, but I don't know how/if they're going to handle freeing memory again -- here the NT kernel really needs to communicate with the Linux kernel.

Anyways, the upshot is that no, Microsoft is not going to take over the world, but perhaps it will be easier to use a Windows laptop which supports all the stupid Enterprise software I need but still have a Linux shell for actual work.

Re:Microsoft's Linux Kernel by rbanffy on Saturday June 29, 2019 @07:49AM (#20312046)
> I find it fairly easy to work on both Mac OS X, Linux and WSL2 -- but not pre-WSL Windows

The thing that annoys me most on Windows is Windows itself. After using Linuxes for almost two decades now, the notion of the OS taking tens of minutes to self update when all I wanted was to quickly reboot it is unbearable.

> I don't know how/if they're going to handle freeing memory again -- here the NT kernel really needs to communicate with the Linux kernel

Usually "free" memory only happens when a Linux machine starts. During normal usage most of the memory is being used to cache things and, when some large app frees its own memory (such as when Slack quits) it'll eventually be used for other things.

Not sure how that would work. Memory doesn't stay unused in Linux for long - whatever programs free will end up being used to cache information that's slow to access.

Re:Microsoft's Linux Kernel by ex3xu on Saturday June 29, 2019 @11:28AM (#20313098)
> The thing that annoys me most on Windows is Windows itself. After using Linuxes for almost two decades now, the notion of the OS taking tens of minutes to self update when all I wanted was to quickly reboot it is unbearable.

This is definitely a problem especially considering that the shotgun approach to some Windows updates actually hurt the performance of some machines, even breaking Windows on occasion [0]. However, in fairness I would say that I've spent just as much or more time fixing rolling release issues on Arch/Manjaro, or troubleshooting the package stopping me from sudo apt upgrade. The worst experience for me was having to reformat after the update from Ubuntu 14.04 crashed.

What annoys me most about Microsoft's overarching paternalistic philosophy is is how creepy their telemetry initiatives are. Granted plenty of companies do this now, for the same profit-driven motivations, but Microsoft goes above and beyond in terms of disabling or even ignoring opt out options [1]. I've found the Winaero blog [2] to be a good source of tools to stop some of the Windows telemetry shenanigans.

[0]: https://www.forbes.com/sites/daveywinder/2019/05/19/microsof...

[1]: https://www.reddit.com/r/Windows10/comments/a4lpg0/windows_1...

[2]: https://winaero.com/

Re:Microsoft's Linux Kernel by delusional on Saturday June 29, 2019 @01:43PM (#20313790)
> In fairness I would say that I've spent just as much or more time fixing rolling release issues on Arch/Manjaro.

That doesn't even matter much to me. Obviously, less time spent is better, but what really matters is the timing.

When I have to spend time upgrading my linux box, I have set time aside. I decide that I have a bit of time, and if it turns out to be a bigger job than expected, I can decide to abort and continue some other time.

On Windows the upgrade is always inconvenient, because you have no way of controlling it. Microsoft decides when the best time for you to upgrade is, and once it starts you have no means of punting on it.

Although the telemetry is certainly a problem too.

Re:Microsoft's Linux Kernel by rbanffy on Saturday June 29, 2019 @02:20PM (#20313971)
> That doesn't even matter much to me. Obviously, less time spent is better, but what really matters is the timing.

That too. When I update MacPorts, it can, sometimes, take ages. I don't care - I just continue working.

Re:Microsoft's Linux Kernel by ex3xu on Saturday June 29, 2019 @02:12PM (#20313941)
> Obviously, less time spent is better, but what really matters is the timing... On Windows the upgrade is always inconvenient, because you have no way of controlling it.

True, very good point in favor of user control. Linux has the added benefit of teaching the discipline and foresight to understand that "Hey... maybe I shouldn't run sudo pacman -Syu and reboot until I have some time set aside". Though in recent years I've found Arch to be way more stable with very few updates causing major problems.

Re:Microsoft's Linux Kernel by bscphil on Sunday June 30, 2019 @10:34PM (#20322049)
> Though in recent years I've found Arch to be way more stable with very few updates causing major problems.

Can confirm. I've had the same Arch install for nearly 6 years now. I've borked it only once in that time, and that one was my fault for not reading the news first. Fixed it in < 5 minutes.

And I've made considerable changes in that time, including moving the entire installation from one hard disk to another.

Re:Microsoft's Linux Kernel by gambiting on Saturday June 29, 2019 @12:09PM (#20313324)
So after a very long hiatus I have decided to try installing linux on a raspberry pi - and wow, the results were amazing. Using my decade-old knowledge of using fstab I added some drives to /etc/fstab and rebooted. Oooops. Raspbian would fail boot with a message "root account locked, couldn't open console".

Fantastic - so if any of the fstab entries are missing, the entire system effectively bricks itself. The only way to fix it was to remove the SD card, put it in another machine, and manually remove the offending entries from the fstab file. Fantastic. I Don't think I have ever managed to get windows to self-brick itself with something so simple.

Re:Microsoft's Linux Kernel by gorio on Saturday June 29, 2019 @01:42PM (#20313781)
I think you are being unfairly downvoted. On of the major downsides to Linux is that while you can, and often have to, tinker to make it work you can break it on many levels. Sometimes it's even hard to know if it is working properly, until you realize it doesn't. Many developers uses virtualization just for those reasons alone. It might even be a major upside to using WSL, if they do it well.
Re:Microsoft's Linux Kernel by smilliken on Saturday June 29, 2019 @01:48PM (#20313828)
Our tools are either too powerful or too weak. To each their own. I can cope with a tool that is too powerful, but I can't cope with a tool that is too weak.
Re:Microsoft's Linux Kernel by gorio on Saturday June 29, 2019 @03:55PM (#20314442)
I don't think that is the general problem. More so inconstancy. It's almost harder to quit vi then to delete your boot record. I am not sure many tools are even that powerful. Which often means you have to use many different ones, making it even more confusing. Linux lacks abstraction and makes you do things manually as root, it isn't very robust.
Re:Microsoft's Linux Kernel by ajford on Monday July 01, 2019 @04:24PM (#20329364)
I've had a windows update brick my laptop. It failed to complete an update, would roll back, reboot, then try again. Nothing I did fixed it. I spent almost a week with it in a boot loop, trying various fixes and such before giving up and reformatting. Put linux on it and added it to my pile of linux laptops.
Re:Microsoft's Linux Kernel by neop1x on Monday July 01, 2019 @04:46AM (#20323545)
You probably haven't tried changing windows partition and messing with Windows bootloader's registry file...
Re:Microsoft's Linux Kernel by ex3xu on Saturday June 29, 2019 @01:27PM (#20313703)
With great power comes great responsibility, I guess. I agree it would have been nice for Linux to come with a few more sanity checks by default, like maybe a warning flag for rm -rf /* and dd commands...
Re:Microsoft's Linux Kernel by dredmorbius on Sunday June 30, 2019 @05:30PM (#20320650)
Standard rm (coreutils) has included rootfs protections since at least 2012:

    --no-preserve-root
        do not treat '/' specially
    --preserve-root
        do not remove '/' (default)
https://manpages.debian.org/stretch/coreutils/rm.1.en.html

Mind that if your rm comes from elsewhere (say, Busybox), it may not have that protection.

Very careful use of rm as root is an excellent habit to cultivate.

As are backups.

Re:Microsoft's Linux Kernel by Dylan16807 on Monday July 01, 2019 @02:26AM (#20322904)
What about it? I don't think that does anything for "/*"
Re:Microsoft's Linux Kernel by ex3xu on Sunday June 30, 2019 @11:03PM (#20322151)
Interesting, I didn't know that and I stand corrected.
Re:Microsoft's Linux Kernel by gambiting on Saturday June 29, 2019 @01:57PM (#20313867)
I'm just more offended that the default behaviour on an extremely popular distro is failed boot = brick. You don't even get a basic command prompt to fix something, the default behavior is to lock everything down and forbid access, making it impossible to repair the machine from itself. Windows will reboot a few times and then automatically start in safe mode when this happens, you don't need to extract the drive to manually edit some text files before the system can boot again.
Re:Microsoft's Linux Kernel by rbanffy on Saturday June 29, 2019 @02:24PM (#20313990)
> I'm just more offended that the default behaviour on an extremely popular distro is failed boot = brick

If you can't properly start the OS, that's correct behavior. You don't want the OS to start writing things to /var when it can't mount the filesystem that should be mounted to /var.

In any case, the fix with an RPi is easy - pop out the microSD, mount it on the other computer and fix whatever is broken (which should be in the logs). If the RPi is the only computer, put a microSD with a plain install of the OS, mount the other microSD through an USB dongle and fix it the same way you'd do with a laptop.

Re:Microsoft's Linux Kernel by majewsky on Saturday June 29, 2019 @05:10PM (#20314799)
FWIW, you're using the word "brick" incorrectly. Bricking is when the only fix is to throw the device away and buy a new one, which clearly is not the case here.
Re:Microsoft's Linux Kernel by namibj on Sunday June 30, 2019 @06:20PM (#20320941)
Distinguish Hard Brick and Soft Brick.
Re:Microsoft's Linux Kernel by gambiting on Saturday June 29, 2019 @05:20PM (#20314846)
I don't think I am. I've been fixing hardware for years and any device that doesn't switch on is "bricked" - its utility has dropped down to zero, it has turned into a literal brick. Just because you can revive it through some arcane procedure doesn't make it any less bricked to the end user.
Re:Microsoft's Linux Kernel by majewsky on Saturday June 29, 2019 @06:04PM (#20315077)
Flashing a new OS onto the SD card is not "some arcane procedure" for the RPi's target audience.
Re:Microsoft's Linux Kernel by JudgeWapner on Sunday June 30, 2019 @04:14PM (#20320243)
you're getting downvoted, but as a 19-year Linux fanboi, I actually agree with you. If the system has booted at least once, then it knows how to successfully boot. i.e. it knows of a string of modules, kernel, initrd image, etc that worked. As you upgrade, the OS should have a courtesy feature where it doesn't simply delete these files (unless you do the equivalent of issue a "-rf" force command). For instance, we currently have (kernel, initrd, filesystem, and modules that exist on our fs). All we would need to make it (nearly) brick-proof is to add one more thing: fallback-rd that has all the previous shit that worked last time. This would save so many users' asses at hardly any cost since storage is so cheap these days.
Re:Microsoft's Linux Kernel by grumpydba on Sunday June 30, 2019 @04:50PM (#20320420)
Use a gui if you don't know your way around the shell. I'm pretty sure Debian provides one.
Re:Microsoft's Linux Kernel by gambiting on Sunday June 30, 2019 @05:18PM (#20320582)
I wanted to setup a headless Samba server - so after the reboot I didn't even have any way of knowing why the system wouldn't appear on the network anymore. I had to find the right HDMI adapter to see if the system even attempts to start as it was completely dead by all other indications.

And no, I'm sorry but I hate the argument of "you should have known better" - the system first and foremost shouldn't have defaults set up in such a way that not only the SSH server doesn't come up in case of an issue during boot, but the local console is entirely disabled for any access. That's a crazy default.

Re:Microsoft's Linux Kernel by pcollins123 on Monday July 01, 2019 @08:54PM (#20331172)
Check your video card chipset and call support :P
Re:Microsoft's Linux Kernel by dsr_ on Saturday June 29, 2019 @09:30AM (#20312451)
Send a hotplug notification that a region of memory is going to be disconnected. The kernel will stop making allocations there, and eventually it won't be in use. (This could take a while for a heavy system with long-running processes.) Then you send the hotplug physical disconnect notification. If it fails, you'll need to wait longer. If it succeeds, the host system can reclaim the memory.
Re:Microsoft's Linux Kernel by gorio on Saturday June 29, 2019 @09:12AM (#20312377)
I don't see how that is a specific problem. All operating systems have annoyances. But if you are for example an engineer you won't find a competitive range of software on Linux. For someone in need of doing software engineering a similar situation have been developing on Windows. WSL changes that.
Re:Microsoft's Linux Kernel by rbanffy on Saturday June 29, 2019 @02:26PM (#20313994)
> All operating systems have annoyances

But not all annoyances are created equal

Re:Microsoft's Linux Kernel by gorio on Saturday June 29, 2019 @03:47PM (#20314394)
I don't find that annoyance particularly grave or different from other annoyances. I just updated and rebooted my Windows machine I haven't used for a month, took maybe 5 seconds longer than usual. Regardless if that happens every day that isn't something I am going to base my choice of operating system on. This is one of the problems with desktop Linux, caring about some detail (even though it might affect some a lot) rather than the big picture which affects everyone.
Re:Microsoft's Linux Kernel by northwest65 on Sunday June 30, 2019 @04:50PM (#20320421)
>The thing that annoys me most on Windows is Windows itself. After using Linuxes for almost two decades now, the notion of the OS taking tens of minutes to self update when all I wanted was to quickly reboot it is unbearable.

I find the same thing with electric cars. Eight hours to charge when I've spent two decades filling in minutes is absurd.

Re:Microsoft's Linux Kernel by noufalibrahim on Saturday June 29, 2019 @01:57PM (#20313868)
> Most of us don't want to mess about with the desktop stack. If the stack we care about is open-source and runs across many systems, then we still have the freedom.

A tangential point but a relevant one nonetheless. I owe most of my tech. skills to the fact that it was hard to get a Linux distribution running on a cheap PC. I had to read up about hardware, learn how to fix installation issues, sometimes recompile the kernel with different options (and hence study them) and a number of other things simply because it didn't "just work". It gave me an intimate comfort with Linux that I just don't have with any other system (including MacOS which I used for about 2.5 years).

I completely get the notion that when one is a professional he or she shouldn't need to meddle with system level quirks to get a productive environment and a desktop and thankfully, modern Linux is more or less there. I haven't had any major trouble in a long time with it. However, during college or early years, having a system that demands some amount of work to get it working has, atleast to me, be crucial in honing my skills. I wouldn't change that even if I could. I'd vigourously defend it.

Re:Microsoft's Linux Kernel by johanneswu on Saturday June 29, 2019 @03:52AM (#20311365)
There is a technique called "memory ballooning" http://www.vmwarearena.com/vmware-memory-management-part-3-m..., which is probably also used by HyperV to free memory again.
Re:Microsoft's Linux Kernel by acqq on Saturday June 29, 2019 @07:26AM (#20311974)
> rather than trying to fit Linux applications in Windows, they're running in their own world and providing integrations into this world.

It is effectively their way to have an "integrated Linux virtual machine" inside of Windows. The WSL1 on Windows was relatively similar (but not enough for me) to Wine on Linux. The WSL2 is in some ways "more integrated" than the typical VM would be, but otherwise still similar to that.

Not enough: my greatest disappointment up to now is that the "VM-like" behavior was present even in WSL1, if I understood correctly, the files "inside" were more special than the files inside Cygwin folders would be.

Another disappointment was: it was not easy to install WSL on previous Windows 10 versions. Specifically, it was "in app store" but you weren't supposed to "click to install" -- it resulted in something weird. There were recipes what to do from the command line with hoops to take care of, so at the end... I've installed Cygwin, which I knew will work. Does anybody know, did WSL get better now?

(Edit: in the last sentence: s/ it / WSL /)

Re:Microsoft's Linux Kernel by shigawire on Saturday June 29, 2019 @09:01AM (#20312334)
I think you can do it all from powershell if you want or there are really only 2 GUI steps.

Yesterday I:

1. Enabled the Windows Subsystem for Linux option from the control panel

2. Downloaded Ubuntu from the windows store

3. Open Ubuntu and it worked.

Re:Microsoft's Linux Kernel by acqq on Saturday June 29, 2019 @09:42AM (#20312517)
Good. The last time I tried it was like "you just click... and then the problems just start":

https://www.reddit.com/r/bashonubuntuonwindows/comments/7smf...

Regarding the problems between the "different filesystems" it was like:

https://www.reddit.com/r/bashonubuntuonwindows/comments/9dkl...

Which was especially bad: what's the point in having it "there" if you aren't allowed to access the files inside.

Also problems with making a backup of that etc. In that aspects using a real VM (e.g. VirtualBox) the situation was much clearer.

So from my perspective it was both worse than Cygwin and worse (or at least not better) than real VMs... I would really like to read if/how WSL improved.

The similar experience was when I've tried to "just install ssh server". The things I've expected to "just work" didn't. Again at the end I've just used Cygwin.

Re:Microsoft's Linux Kernel by FrankHB on Sunday June 30, 2019 @12:11AM (#20316277)
MSYS2 can do something better than Cygwin.

I'm disappoint to "VM-like" behavior too, so I don't expect they would be totally replaced by WSL.

But this is similar in the other direction. Many applications just rely on such "VM-like" behavior, even though they can be (re)built for Win32 and/or they do not need a real VM for functionality. Note WSL1 can already do something more, e.g. hosting programs as X clients working with VcXsrv. I don't think WSL2 will be necessarily better than WSL1 in many of such cases. (In particular, when I have to reserve VT-x for some other hypervisors, I have no other choice.)

Re:Microsoft's Linux Kernel by rbanffy on Saturday June 29, 2019 @07:50AM (#20312051)
> I've installed Cygwin, which I knew will work. Does anybody know, did it get better better now?

I really like Cygwin. With the MinTTY terminal, it was very nice. Slower than native Linux (or Windows), but enough of an environment to make me happy and productive.

Re:Microsoft's Linux Kernel by znpy on Saturday June 29, 2019 @08:32AM (#20312213)
> If the stack we care about is open-source and runs across many systems, then we still have the freedom.

No we do not.

Re:Microsoft's Linux Kernel by fetbaffe on Saturday June 29, 2019 @09:06AM (#20312364)
Correct, every spying bureau, organization or company runs open source & that probably takes away freedom.
Re:Microsoft's Linux Kernel by fortran77 on Saturday June 29, 2019 @10:56AM (#20312932)
From the very start, the NT micro kernel was designed with multiple OS APIs in mind. They implemented a Posix subsystem decades ago.
Re:Microsoft's Linux Kernel by cmiles74 on Saturday June 29, 2019 @11:02AM (#20312968)
I think it's a little sad that they are going this route (wrapping a running Linux kernel) rather than working to improve Windows disk performance and continuing to improve their WSL 1.x product. It looks like they are missing out on an opportunity to improve the NT kernel for what looks like short-term gain.
Re:Microsoft's Linux Kernel by ryl00 on Saturday June 29, 2019 @11:50AM (#20313238)
From what I understand (which is very, very little!), fundamental NT vs Linux architecture differences wrt their respective file systems prevent much more performance improvement in WSL 1.x.
Re:Microsoft's Linux Kernel by sterlind on Sunday June 30, 2019 @12:57PM (#20319125)
They do, but NT file performance over many files scales abysmally. The two major reasons are a legacy of bad decisions: deleting files is forbidden if there are open write handles, and filter drivers are allowed to be placed between other drivers in the file I/O stack.

There's not much Windows can do about this, which causes tons of issues with e.g. git clone. Erick Smith is ludicrously smart, he just couldn't squeeze better FS perf out of WSL1 due to these issues.

Re:Microsoft's Linux Kernel by tracker1 on Monday July 01, 2019 @03:26AM (#20323181)
I wouldn't say bad decisions so much as different decisions. Given WSL would abstract out file system access anyway, why didn't they just bridge WSL's FS similarly to how they did with WSL2 anyway? Though, I'm not sure there's much advantage left at that point.
Re:Microsoft's Linux Kernel by Sangeppato on Saturday June 29, 2019 @12:45PM (#20313509)
I don't think they could improve I/O speed without modifying NTFS itself (unlikely). This new approach is certainly easier to maintain and develop
Re:Microsoft's Linux Kernel by grumpydba on Sunday June 30, 2019 @04:52PM (#20320437)
You could implement ext4 on the nt kernel and have wsl1 run on it
Re:Microsoft's Linux Kernel by trollied on Saturday June 29, 2019 @01:48PM (#20313830)
> I find it fairly easy to work on both Mac OS X, Linux and WSL2 -- but not pre-WSL Windows.

Cygwin really helped me with the Windows part of that for many years. I switched to a Powerbook about a year before the Intel switch & haven't looked back since. Linux has never been a good enough desktop all-rounder to make me switch to it as a desktop OS. Maybe I should take another look.

Re:Microsoft's Linux Kernel by tracker1 on Monday July 01, 2019 @03:28AM (#20323191)
I'm planning a desktop upgrade (now sometime later this year), eyeing an r7-3950x or next gen threadripper. I'll probably go Linux as my primary desktop again, and VM for windows and macos as needed. I feel it's there enough at this point. Probably been 5-6 years since I've tried it as my primary OS. Though I did keep my grandmother on Ubuntu for about a decade before she passed (her old game ran under wine, and no worries about windows viruses/scams).
Re:Microsoft's Linux Kernel by zaarn on Monday July 01, 2019 @02:51AM (#20323020)
The Linux Kernel can free memory; the balloon driver included in all kernels allows it to dynamically shrink and grow memory with a variety of urgency levels and the kernel can (optionally) shrink memory itself once it's not needed based on various parameters. It's fairly reliable and works well.
Re:Microsoft's Linux Kernel by StreamBright on Saturday June 29, 2019 @07:06AM (#20311908)
> a good-enough Linux replacement on the command line

nit picking but it was more of a good enough bsd/unix than linux.

Re:Microsoft's Linux Kernel by reaperducer on Saturday June 29, 2019 @12:30PM (#20313425)
Not really a nit pick, considering that OSX is certified full-fledged Unix.
Re:Microsoft's Linux Kernel by robertAngst on Saturday June 29, 2019 @08:41AM (#20312253)
>In the mid 2000's the Mac really took off due to being a good-enough Linux replacement on the command line, while taking care of all the hardware integration and providing a sleek desktop experience. This really helped the Mac take off among hackers. This system wasn't as open-source as Linux, but it was good enough: Most of us don't want to mess about with the desktop stack.

Who are you to claim this?

The closed off nature of Apple is very dangerous to trust, and I don't know any 'hackers' who are willing to risk unchecked/vulnerable OSes.

I have no idea if Apple has a backdoor to the FBI. We do know on Linux there is no hidden backdoor.

Re:Microsoft's Linux Kernel by scarface74 on Saturday June 29, 2019 @09:26AM (#20312429)
As long as you some assume that there are no unpublished exploits in Linux. The Heartbleed bug was in open source code for a year and a half before it was found.