Discussion:
WSLg update on 1-5-2021 - BSD / WSL
Chargen
2021-05-01 19:42:38 UTC
Permalink
Dear all

please note that I hope this message will be discussed to get this on the
roadmap for FreeBSD. Perhaps there is already talk about && work done on
that.
I would like to suggest having a BSD side for Microsoft FOSS ambitions and
get to know the BSD license. I hope the tech people here, know which nuts
and bolts would be ready to boot a *BSD subsystem kernel and make that
available on Windows 10 installations.

Dru Do "we" want that for FreeBSD? I think so I hope so...

Today I saw Window 10 doing a WSLg update, and with that, automatic
reinstalled Debian applications that can now use Wayland *compositor hooks
to serve graphics (xaos, rxvt, stellarium) it works, even pong.scr

I'm also on the Windows Insider team, "MacBethwin" for over 6 years. I
have seen so many GSOD Green Screens of Death that provoked by me, I have
that record of breaking stuff.

So I also know a bit about what went wrong, what is good, what was needed
.. to state that the guy Jamie (fame) from Xscreensavershould get paid for
losing business in the days I dare mention all the Bad juju of Microsoft
from the past. that I know of, I'm also honest when for ack the excellent
development at Redwood, developers have done a hell of a job

With FreeBSD subsystem and interops , windows should feel less monolithic

Best Regards

Edwin
(chargen at gmail dot com)
--
Deze e-mail en de inhoud is vertrouwelijk en uitsluitend bestemd voor de
geadresseerde(n). Indien u niet de geadresseerde bent van deze e-mail
verzoeken wij u dit direct door te geven aan de verzender door middel van
een reply e-mail en de ontvangen e-mail uit uw systemen te verwijderen. Als
u geen geadresseerde bent, is het niet toegestaan om kennis te nemen van de
inhoud, deze te kopieren, te verspreiden, bekend te maken aan derden noch
anderszins te gebruiken.

The information contained in this e-mail is confidential and may be legally
privileged. It is intended solely for the addressee. If you are not the
intended recipient, any disclosure, copying, distribution or any action
taken or omitted to be taken in reliance on it, is prohibited and may be
unlawful. Please notify us immediately if you have received it in error by
reply e-mail and then delete this message from your system.

Thanks,
_ _
(_)(_)
(,,)
=()=
((__)\
_|L\_______/
Save The Lab Rats
Rozhuk Ivan
2021-05-02 03:12:15 UTC
Permalink
On Sat, 1 May 2021 21:42:38 +0200
Post by Chargen
With FreeBSD subsystem and interops , windows should feel less
monolithic
Waste our resourses to increase MS money profit.
Pete Wright via freebsd-current
2021-05-03 21:37:07 UTC
Permalink
Post by Chargen
Dear all
please note that I hope this message will be discussed to get this on the
roadmap for FreeBSD. Perhaps there is already talk about && work done on
that.
I would like to suggest having a BSD side for Microsoft FOSS ambitions and
get to know the BSD license. I hope the tech people here, know which nuts
and bolts would be ready to boot a *BSD subsystem kernel and make that
available on Windows 10 installations.
I believe most of the effort make this happen lies with Microsoft - it
is their product after all.

WSL under the covers is Hyper-V which supports FreeBSD pretty well. I
believe most of the work would be on the Windows side to get the
plumbing in place to spin up a FreeBSD VM.  There are open discussions
on the WSL github system where people have asked for this but it has not
gained much traction by Microsoft.

-p
--
Pete Wright
***@nomadlogic.org
@nomadlogicLA
David Chisnall
2021-05-06 09:57:16 UTC
Permalink
Post by Pete Wright via freebsd-current
Post by Chargen
Dear all
please note that I hope this message will be discussed to get this on the
roadmap for FreeBSD. Perhaps there is already talk about &&  work done on
that.
I would like to suggest having a BSD side for Microsoft FOSS ambitions and
get to know the BSD license. I hope the tech people here, know which nuts
and bolts would be ready to boot a *BSD subsystem kernel and make that
available on Windows 10 installations.
I believe most of the effort make this happen lies with Microsoft - it
is their product after all.
WSL under the covers is Hyper-V which supports FreeBSD pretty well. I
believe most of the work would be on the Windows side to get the
plumbing in place to spin up a FreeBSD VM.  There are open discussions
on the WSL github system where people have asked for this but it has not
gained much traction by Microsoft.
[ Disclaimer: I work for Microsoft, but not on WSL and this is my own
opinion ]

WSL is actually two things. WSL1 is similar to the FreeBSD Linuxulator:
it is a Linux syscall ABI in the NT kernel that implements *NIX
abstractions that are not present in NT and forwards other things to
corresponding NT subsystems. Like the Linuxulator, it lacks a bunch of
features (e.g. seccomp-bpf support, which is required for things like
Docker and Chrome) and is always playing catch-up with Linux. I'd
personally love to see a FreeBSD version of this (though I'd be 90%
happy if ^T did the *BSD thing), but it's something that only Microsoft
can do and is currently quite difficult because the picoprocess
abstraction in the NT kernel only allows one kind of picoprocess and so
it would need to add a new abstraction layer to support both.

WSL2 is a lightweight Hyper-V VM that is set up to integrate tightly
with the host. This includes:

- Aggressively using the memory ballooning driver so that a VM can
start with a very small amount of committed memory and grow as needed.

- Using Hyper-V sockets to forward things between the guest and the host.

- Using 9p-over-VMBus (which, I hope, will eventually become
VirtIO-over-VMBus, but I don't know of any concrete plans for this) to
expose filesystems from the host to the fuest)

- Starting using the LCOW infrastructure, which loads the kernel
directly rather than going via an emulated UEFI boot process.

FreeBSD is currently missing the balloon driver, I believe, has a
Hyper-V socket implementation contributed by Microsoft (Wei Hu), and has
a 9p-over-VirtIO implementation that could probably be tweaked fairly
easily to do 9p-over-VMBus.

The WSL2 infrastructure is designed to make it possible to bring your
own kernel. I think FreeBSD would need to support the Linux boot
protocol (initial memory layout, mechanism for passing kernel arguments
in memory) to fit into this infrastructure, but that wouldn't require
any changes to any closed-source components.

Whether Microsoft or the FreeBSD project should do the work really comes
down to who has more to gain. Windows 10 is installed on around a 1.3
billion devices and any of these users can run Ubuntu with a single
click in the Microsoft Store, so it feels as if the FreeBSD project has
a lot to gain from being able to reach them. If you believe that
FreeBSD provides a better experience (I certainly believe it provides a
better developer experience) than Ubuntu, then making it easy to reach
every Windows users is of huge value to the FreeBSD project and community.

Microsoft, in contrast, is driven by requests from customers who spend
money on our products and services. Around a hundred people commented
on the WSL issue to add FreeBSD support. If you assume that 1% of
people who want the feature commented, then this gives around 10,000
folks who really want a FreeBSD equivalent of WSL. It's pretty hard to
justify a feature in Windows that only 0.001% of Windows users will use.
If you want to change that arithmetic, then next time your
organisation is renewing M365 or Azure service subscriptions, tell your
sales rep that FreeBSD support is important to your company. If, for
example, a large company is spending a lot with a different cloud
provider because they have better FreeBSD support than Azure, then
that's the kind of thing that can be used to justify investing in
FreeBSD. Currently, from what I know of FreeBSD deployments in Azure,
Microsoft is already investing a disproportionate amount in FreeBSD
relative to the number of users.

WSL makes it easy for folks to develop on Windows and deploy in Azure.
A lot of people are running Linux in Azure and so there's a big
incentive to make this seamless. If a load of people are deploying
FreeBSD on Azure and can't develop on Windows as easily, that's an
incentive for Microsoft to improve the FreeBSD client-side integration.

David
Rozhuk Ivan
2021-05-07 10:17:41 UTC
Permalink
On Thu, 6 May 2021 10:57:16 +0100
Post by David Chisnall
Whether Microsoft or the FreeBSD project should do the work really
comes down to who has more to gain. Windows 10 is installed on
around a 1.3 billion devices and any of these users can run Ubuntu
with a single click in the Microsoft Store, so it feels as if the
FreeBSD project has a lot to gain from being able to reach them.
Make job for free - make more money for MS.
Make win10 to support more features to increase windows value...
Post by David Chisnall
If you believe that FreeBSD provides a better experience (I certainly
believe it provides a better developer experience) than Ubuntu, then
making it easy to reach every Windows users is of huge value to the
FreeBSD project and community.
Manipulation detected.
Post by David Chisnall
Microsoft, in contrast, is driven by requests from customers who
spend money on our products and services.
Around a hundred people
commented on the WSL issue to add FreeBSD support.
Ok, do you job and add FBSD support to WSL.
Post by David Chisnall
If you assume
that 1% of people who want the feature commented, then this gives
around 10,000 folks who really want a FreeBSD equivalent of WSL.
They give money to MS, they ask MS to do job for money.
Post by David Chisnall
It's pretty hard to justify a feature in Windows that only 0.001% of
Windows users will use. If you want to change that arithmetic, then
next time your organisation is renewing M365 or Azure service
subscriptions, tell your sales rep that FreeBSD support is important
to your company.
There is many other hosting services that have FBSD support.
So this is MS/azure problem.
David Chisnall
2021-05-07 13:31:39 UTC
Permalink
Post by Rozhuk Ivan
On Thu, 6 May 2021 10:57:16 +0100
Post by David Chisnall
Whether Microsoft or the FreeBSD project should do the work really
comes down to who has more to gain. Windows 10 is installed on
around a 1.3 billion devices and any of these users can run Ubuntu
with a single click in the Microsoft Store, so it feels as if the
FreeBSD project has a lot to gain from being able to reach them.
Make job for free - make more money for MS.
Make win10 to support more features to increase windows value...
How much money? 'Making money' doesn't just mean money coming in, it
means more money coming in than is going out. Adding features to a
product costs money. How many people will buy Windows 10 if it has a
good FreeBSD compatibility layer who wouldn't buy it without one? I
very much doubt that this is a sufficient number to cover the cost of
the engineering work.
Post by Rozhuk Ivan
Post by David Chisnall
Microsoft, in contrast, is driven by requests from customers who
spend money on our products and services.
Around a hundred people
commented on the WSL issue to add FreeBSD support.
Ok, do you job and add FBSD support to WSL.
First, this is nowhere near even related to my job. I don't work on
Windows, let alone WSL.

Second, I have already explained why this is not a sufficiently large
market to impact engineering decisions.
Post by Rozhuk Ivan
Post by David Chisnall
If you assume
that 1% of people who want the feature commented, then this gives
around 10,000 folks who really want a FreeBSD equivalent of WSL.
They give money to MS, they ask MS to do job for money.
They give money to MS, they get a Windows 10 license in return. They
are happy to buy Windows without a FreeBSD compat layer. They are
buying Windows on the basis of some subset of a large number of
features. The lack of a FreeBSD compat layer is not preventing them
from buying Windows, they have not shown that this is the deal-breaker
feature.

Microsoft, like any other POTS software vendor, will prioritise features
that impact the most customers. There are things on User Voice with
tens or hundreds of thousands of votes and these tend to be prioritised.
Something with under a hundred votes is so niche that it's only going
to be a target of investment if it impacts another product or service.
Post by Rozhuk Ivan
Post by David Chisnall
It's pretty hard to justify a feature in Windows that only 0.001% of
Windows users will use. If you want to change that arithmetic, then
next time your organisation is renewing M365 or Azure service
subscriptions, tell your sales rep that FreeBSD support is important
to your company.
There is many other hosting services that have FBSD support.
So this is MS/azure problem.
Azure already officially supports FreeBSD and we have contributed a load
of code to improve that support over the years. From the numbers I've
seen, I strongly suspect that we've spent more on it than we've gained
in revenue.

You are asking Microsoft to throw money at a thing that will definitely
cost time and money (and comes with the associated opportunity cost,
because developer time spent on this features is developer time not
spent on other features) but with no clear indication that it will
increase revenue. Effectively, you are asking us to do work for free
and you're also doing so quite rudely.

Personally, I'd love to have a FreeBSD compat layer. The license would
even make it possible to embed the FreeBSD kernel in Windows and so get
the best aspects of WSL1 and WSL2. From a business perspective;
however, I can't argue that this would be a great use of engineer time.
There are a load of features that would positively impact a lot more
users that would be higher priority.

If you want this to happen and you want Microsoft to do it, then you
need to help people inside the company provide this business case.
Things that don't help include:

- I want it.
- You suck for not doing it.
- It would make you money in unspecified ways.

Things that do help include:

- We are a FreeBSD shop with 1,000 workstations, we would switch to
Windows on the desktop with this feature.
- We are a large cloud customer with 10,000 VMs deployed, we would
switch to Azure with this feature.
- We are a Windows shop with a load of desktops but are planning to
switch to Macs because we want a BSD-style userland.

If you just want it to happen, then you don't need Microsoft to do
anything. All of the code required to build a Linux system that
integrates with WSL2 is open source and you can implement something
compatible for FreeBSD. You can probably even skip a bunch of the boot
requirements by using Linux as a bootloader and having a tiny Linux
image that just kexecs a FreeBSD kernel.

David
Rozhuk Ivan
2021-05-07 17:45:47 UTC
Permalink
On Fri, 7 May 2021 14:31:39 +0100
Post by David Chisnall
Post by Rozhuk Ivan
Post by David Chisnall
Whether Microsoft or the FreeBSD project should do the work really
comes down to who has more to gain. Windows 10 is installed on
around a 1.3 billion devices and any of these users can run Ubuntu
with a single click in the Microsoft Store, so it feels as if the
FreeBSD project has a lot to gain from being able to reach them.
Make job for free - make more money for MS.
Make win10 to support more features to increase windows value...
How much money? 'Making money' doesn't just mean money coming in, it
means more money coming in than is going out. Adding features to a
product costs money. How many people will buy Windows 10 if it has a
good FreeBSD compatibility layer who wouldn't buy it without one? I
very much doubt that this is a sufficient number to cover the cost of
the engineering work.
This is MS management problems.
Adding support WSL code will not make FBSD users happy, there is mush more
actual issues that require attention. IMHO.
Post by David Chisnall
Post by Rozhuk Ivan
Post by David Chisnall
If you assume
that 1% of people who want the feature commented, then this gives
around 10,000 folks who really want a FreeBSD equivalent of WSL.
They give money to MS, they ask MS to do job for money.
They give money to MS, they get a Windows 10 license in return. They
are happy to buy Windows without a FreeBSD compat layer. They are
buying Windows on the basis of some subset of a large number of
features. The lack of a FreeBSD compat layer is not preventing them
from buying Windows, they have not shown that this is the
deal-breaker feature.
Because MS is monopoly on OS market.
For most peolpes there is no other way to buy PC/notebook without windows,
and no other way to use some software that was written for windows only.
Post by David Chisnall
Microsoft, like any other POTS software vendor, will prioritise
features that impact the most customers. There are things on User
Voice with tens or hundreds of thousands of votes and these tend to
be prioritised. Something with under a hundred votes is so niche that
it's only going to be a target of investment if it impacts another
product or service.
From mine experience MS listen only custommers from big b2b and b2gov.
Millions of users hate post win7 gui - see no reaction from ms.
Post by David Chisnall
Post by Rozhuk Ivan
Post by David Chisnall
It's pretty hard to justify a feature in Windows that only 0.001%
of Windows users will use. If you want to change that arithmetic,
then next time your organisation is renewing M365 or Azure service
subscriptions, tell your sales rep that FreeBSD support is
important to your company.
There is many other hosting services that have FBSD support.
So this is MS/azure problem.
Azure already officially supports FreeBSD and we have contributed a
load of code to improve that support over the years. From the
numbers I've seen, I strongly suspect that we've spent more on it
than we've gained in revenue.
Ok, thanks!
Post by David Chisnall
You are asking Microsoft to throw money at a thing that will
definitely cost time and money (and comes with the associated
opportunity cost, because developer time spent on this features is
developer time not spent on other features) but with no clear
indication that it will increase revenue. Effectively, you are
asking us to do work for free and you're also doing so quite rudely.
No, I do not ask MS for anything.
If MS want something - patches/pull requests/sponsoring are welcome!
Post by David Chisnall
Personally, I'd love to have a FreeBSD compat layer. The license
would even make it possible to embed the FreeBSD kernel in Windows
and so get the best aspects of WSL1 and WSL2. From a business
perspective; however, I can't argue that this would be a great use of
engineer time. There are a load of features that would positively
impact a lot more users that would be higher priority.
Same for FBSD.
FBSD have very limited peoples power and more prioritized tasks, at least
from my point of view.

May be you luck to find some one who can, have time and motivation to do this.
Post by David Chisnall
If you want this to happen and you want Microsoft to do it, then you
need to help people inside the company provide this business case.
- I want it.
- You suck for not doing it.
- It would make you money in unspecified ways.
- We are a FreeBSD shop with 1,000 workstations, we would switch to
Windows on the desktop with this feature.
- We are a large cloud customer with 10,000 VMs deployed, we would
switch to Azure with this feature.
- We are a Windows shop with a load of desktops but are planning to
switch to Macs because we want a BSD-style userland.
This is examples of negative motivation for this community. :)
Oleksandr Tymoshenko
2021-05-07 19:06:58 UTC
Permalink
Post by David Chisnall
Post by Pete Wright via freebsd-current
Post by Chargen
Dear all
please note that I hope this message will be discussed to get this on the
roadmap for FreeBSD. Perhaps there is already talk about &&  work done on
that.
I would like to suggest having a BSD side for Microsoft FOSS ambitions and
get to know the BSD license. I hope the tech people here, know which nuts
and bolts would be ready to boot a *BSD subsystem kernel and make that
available on Windows 10 installations.
I believe most of the effort make this happen lies with Microsoft - it
is their product after all.
WSL under the covers is Hyper-V which supports FreeBSD pretty well. I
believe most of the work would be on the Windows side to get the
plumbing in place to spin up a FreeBSD VM.  There are open discussions
on the WSL github system where people have asked for this but it has not
gained much traction by Microsoft.
[ Disclaimer: I work for Microsoft, but not on WSL and this is my own
opinion ]
it is a Linux syscall ABI in the NT kernel that implements *NIX
abstractions that are not present in NT and forwards other things to
corresponding NT subsystems. Like the Linuxulator, it lacks a bunch of
features (e.g. seccomp-bpf support, which is required for things like
Docker and Chrome) and is always playing catch-up with Linux. I'd
personally love to see a FreeBSD version of this (though I'd be 90%
happy if ^T did the *BSD thing), but it's something that only Microsoft
can do and is currently quite difficult because the picoprocess
abstraction in the NT kernel only allows one kind of picoprocess and so
it would need to add a new abstraction layer to support both.
WSL2 is a lightweight Hyper-V VM that is set up to integrate tightly
- Aggressively using the memory ballooning driver so that a VM can
start with a very small amount of committed memory and grow as needed.
- Using Hyper-V sockets to forward things between the guest and the host.
- Using 9p-over-VMBus (which, I hope, will eventually become
VirtIO-over-VMBus, but I don't know of any concrete plans for this) to
expose filesystems from the host to the fuest)
- Starting using the LCOW infrastructure, which loads the kernel
directly rather than going via an emulated UEFI boot process.
FreeBSD is currently missing the balloon driver, I believe, has a
Hyper-V socket implementation contributed by Microsoft (Wei Hu), and has
a 9p-over-VirtIO implementation that could probably be tweaked fairly
easily to do 9p-over-VMBus.
The WSL2 infrastructure is designed to make it possible to bring your
own kernel. I think FreeBSD would need to support the Linux boot
protocol (initial memory layout, mechanism for passing kernel arguments
in memory) to fit into this infrastructure, but that wouldn't require
any changes to any closed-source components.
Hi David,

Do you have links to the documentation on how to replace the kernel
and the boot protocols? Or any documentation for WSL2 internals?

Thanks
--
gonzo
Daniel Nebdal
2021-05-09 03:55:42 UTC
Permalink
Post by David Chisnall
[ Disclaimer: I work for Microsoft, but not on WSL and this is my own
opinion ]
(...)
David
Just as a counterpoint to Rozhuk's take, that all sounds sensible
enough to me - FreeBSD would probably gain more from this than MS.

So the WSL2 TODO would be something like this:
* Ballooning driver. Seems like a proof of concept would be doable
enough - could you model it as an unkillable task (userland or kernel)
that wants to allocate a lot of memory, and anything it gets it hands
back to the host?
* Some sort of boot support. Maybe as a shim that chainloads an
unmodified kernel? Probably finicky, but also self-contained.
* File systems. Is / also 9p-over-HyperV-channels? If so that's kind
of crucial and perhaps the hardest part.

Oh, and how does the terminal work? You support multiple ttys, so I
guess it's not straight emulated serial?
--
Daniel
David Chisnall
2021-05-10 08:28:55 UTC
Permalink
Post by Daniel Nebdal
Post by David Chisnall
[ Disclaimer: I work for Microsoft, but not on WSL and this is my own
opinion ]
(...)
David
Just as a counterpoint to Rozhuk's take, that all sounds sensible
enough to me - FreeBSD would probably gain more from this than MS.
* Ballooning driver. Seems like a proof of concept would be doable
enough - could you model it as an unkillable task (userland or kernel)
that wants to allocate a lot of memory, and anything it gets it hands
back to the host?
There's an in-tree Xen balloon driver that works in this way: it
allocates pages of memory from the kernel and then returns them to the
hypervisor.

It appears that Hyper-V actually supports two kinds of dynamic memory,
the balloon interface and a mechanism based on hotplug. The balloon
mechanism effectively defines a maximum amount of physical memory and
lets the guest return some of it. The hotplug mechanism boots with a
smaller amount of memory but can dynamically add and remove physical
memory. I don't know which is used in WSL2.
Post by Daniel Nebdal
* Some sort of boot support. Maybe as a shim that chainloads an
unmodified kernel? Probably finicky, but also self-contained.
To start, you could kexec the FreeBSD kernel from a minimal Linux install.
Post by Daniel Nebdal
* File systems. Is / also 9p-over-HyperV-channels? If so that's kind
of crucial and perhaps the hardest part.
I think WSL2 provides a block device for /, which is why Linux-native
filesystem performance is faster than WSL1. It would be great to have a
ZFS image instead of ext4 here!
Post by Daniel Nebdal
Oh, and how does the terminal work? You support multiple ttys, so I
guess it's not straight emulated serial?
I believe that WSL2 uses SSH connections, rather than exposing the
serial terminal.

David

Loading...