From owner-freebsd-current@freebsd.org Fri May 7 19:07:07 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04F736393B0 for ; Fri, 7 May 2021 19:07:07 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FcKgt28tmz3FTX; Fri, 7 May 2021 19:07:06 +0000 (UTC) (envelope-from gonzo@bluezbox.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bluezbox.com; s=mail; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=wvSRWl6lw0F0px+g9mCsPXSfMFYBhyoWi+qtASLvc9o=; b=YU/un1L058URqcnN4dY3gYrCuU wfHLvp+AumwCxGa7Wj1rCgzps+lohlDrpELuTWJVyJYod1Koc0Oepwy2+Prz/LqvdKt3Sjm8DR0M/ 4RIVsmwRuB2N7EV9HESIPWBq+GTZNSnsyjxJ6HrGUdSdp8RrUHe1OivSBfc2bGT566gA=; Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94 (FreeBSD)) (envelope-from ) id 1lf5oR-000GTJ-1N; Fri, 07 May 2021 12:06:59 -0700 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id 147J6wh1063320; Fri, 7 May 2021 12:06:58 -0700 (PDT) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Fri, 7 May 2021 12:06:58 -0700 From: Oleksandr Tymoshenko To: David Chisnall Cc: freebsd-current@freebsd.org Subject: Re: WSLg update on 1-5-2021 - BSD / WSL Message-ID: <20210507190658.GA63309@bluezbox.com> References: <0b3d6049-f6eb-f9d4-5f20-f09ac666e949@nomadlogic.org> <92a81582-7bd4-b9f1-04b6-cbcd5eb77893@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <92a81582-7bd4-b9f1-04b6-cbcd5eb77893@FreeBSD.org> X-Operating-System: FreeBSD/11.2-RELEASE-p10 (amd64) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: David Chisnall (theraven@FreeBSD.org) wrote: > On 03/05/2021 22:37, Pete Wright via freebsd-current wrote: > > On 5/1/21 12:42 PM, Chargen wrote: > >> Dear all > >> > >> please note that I hope this m [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Rspamd-Queue-Id: 4FcKgt28tmz3FTX X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bluezbox.com header.s=mail header.b=YU/un1L0; dmarc=none; spf=pass (mx1.freebsd.org: domain of gonzo@bluezbox.com designates 45.55.20.155 as permitted sender) smtp.mailfrom=gonzo@bluezbox.com X-Spamd-Result: default: False [-3.50 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bluezbox.com:s=mail]; FREEFALL_USER(0.00)[gonzo]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[bluezbox.com]; R_SPF_ALLOW(-0.20)[+mx]; SPAMHAUS_ZRD(0.00)[45.55.20.155:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DKIM_TRACE(0.00)[bluezbox.com:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-0.999]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[45.55.20.155:from]; ASN(0.00)[asn:14061, ipnet:45.55.0.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-current] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 May 2021 19:07:07 -0000 David Chisnall (theraven@FreeBSD.org) wrote: > On 03/05/2021 22:37, Pete Wright via freebsd-current wrote: > > On 5/1/21 12:42 PM, Chargen wrote: > >> 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. 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