From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 5C8D25361B; Tue, 6 Dec 2022 20:25:51 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id 3C6B753598; Tue, 6 Dec 2022 20:25:49 +0000 (UTC) Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by atuin.qyliss.net (Postfix) with ESMTPS id BAFEC53614 for ; Tue, 6 Dec 2022 20:25:46 +0000 (UTC) Received: by mail-ed1-x542.google.com with SMTP id s5so21987621edc.12 for ; Tue, 06 Dec 2022 12:25:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unikie.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=2z7+BsJLjh8Syy0a7NOGVbLrBDUrTJC/MFk0HNhmz7k=; b=TyZk3NmwL70gZmZXqmBnu6EGaS7CMIRjyjjv+FM1tWUgVvT+kxE6mhMEf33+rDMA/6 JY51L/8N3FN6AaVrCJaqQ0a2tHpcM7nvLJn9pE5rmTQPvK85yuPOqNnt7J9rK03SrijX TW0kkqJpxxb2s1y64cObnNcpQbwth5jlEST/TvOWMaWi9s3C9dBHNxB2+yPixXkcBoFH p9PBjh6V44FQ8ek18geJajuXu6Gwx0z+r7BxEWr9QfV8Sasdy3uZ9CADUz+7R8LZ8tEz sC917Fb049wUHOxz0z4X9Sl6zt9ST9jCF8O36RUr2sxUgbG8sUk1lLIhMmXjnz/ehhGi EQag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2z7+BsJLjh8Syy0a7NOGVbLrBDUrTJC/MFk0HNhmz7k=; b=7bxnvHD9+CeCJ4aiOFYmVca8NRKLVYcF/chkec7gI5rlVkKDgdFaoyy6CxpigsvRl3 TWaYwqYZLpV5y62DsSlFf9AP0FGQvkjKmWmP2MhIQ8/m5U31eeWivE39myRsbwa7V2C0 i/ob4iaitti6t5eYGBcy9NxNu5T8425EDYfAmpLwJ7e2FDcJarD/2YntqhV5yJboYV+u 2h6hPZxkGx/BjnoWW3T+Aru1pPHCs4q3Zjtxb5FFDxe15EQXYjaJW8IViWL0Tvw85rO2 ST9yW0RMrsNjf3idCd/NBAuv1QklybiITM1zCNBVHEoqxKsAU0lR5mFmJtnh7SYPa6P7 bJWw== X-Gm-Message-State: ANoB5pnzKHBWDLOnH1BDjBu6gVCp6Mr2ZAyZPBTEzoZ2Uj35YUDr7C/I IeybIGs2CdV4qzERkTsahjcCRtXKFgpMo5EuGqw= X-Google-Smtp-Source: AA0mqf4xXIgjUDARcPiPn2Fb1G/ECVpAOtBmoAjfZ7twhFhzpvROuS62QuyYptDusUh8Dip5a5UWvA== X-Received: by 2002:aa7:d551:0:b0:468:fb2c:6c8c with SMTP id u17-20020aa7d551000000b00468fb2c6c8cmr77737145edr.340.1670358346259; Tue, 06 Dec 2022 12:25:46 -0800 (PST) Received: from x220.qyliss.net (p200300ed67055c010000000000000007.dip0.t-ipconnect.de. [2003:ed:6705:5c01::7]) by smtp.gmail.com with ESMTPSA id i20-20020aa7c9d4000000b00459f4974128sm1378849edt.50.2022.12.06.12.25.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 12:25:45 -0800 (PST) Received: by x220.qyliss.net (Postfix, from userid 1000) id 57C1D2BE; Tue, 6 Dec 2022 20:25:45 +0000 (UTC) Date: Tue, 6 Dec 2022 20:25:45 +0000 From: Alyssa Ross To: Vadim Likholetov Subject: Re: Firefox appVM patches and appVM refactoring Message-ID: <20221206202545.lb53nydhf7c2rd7i@x220> References: <20221206152011.lhk7jc64nqtkd7xo@x220> <20221206171022.5kwkddpjet3q7ks4@x220> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="njrmcoslw6vbghgp" Content-Disposition: inline In-Reply-To: Message-ID-Hash: GWGTXVQ7LUBHIZVDHYAFBDE4FFZ7TSXA X-Message-ID-Hash: GWGTXVQ7LUBHIZVDHYAFBDE4FFZ7TSXA X-MailFrom: alyssa.ross@unikie.com X-Mailman-Rule-Hits: header-match-devel.spectrum-os.org-0 X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1 CC: devel@spectrum-os.org X-Mailman-Version: 3.3.5 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --njrmcoslw6vbghgp Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 06, 2022 at 10:12:49PM +0200, Vadim Likholetov wrote: > I=E2=80=99ll try to explain =E2=80=94 running as user is not just droppin= g the priviledges, it is about preparing the environment - making home dire= ctory, fixing permissions, allocating pty-s in case of interactive sessions= , setting environment variables. > Many system daemons like dbus, pipewire , etc has their system-level and= user-level parts and we should manage this separately =E2=80=94 and it is = our nearest future if we want some complex user environments to run on Spec= trum, and possibly the packages for this daemons will extend this environme= nt transparent to the user. > > So it=E2=80=99s s another form of encapsulation like we discussed about = making a separate layer for wayland. Ah, thanks for the explanation. I understand now! You're quite right about running user daemons like PipeWire. I think to manage those, we'd want to run a user-level s6(-rc) instance, so that the services are supervised, and can therefore be restarted if they crash, and dependencies can be taken care of, and logs can be managed however that should work. Let's try adding PipeWire, D-Bus etc. daemons straight to the img/app image? It's intended to be the default image for running applications, so anything that an application is likely to expect to be running should be provided by that image by default. And then later on, when it comes up, we can figure out how to support adding extra services, or whether we should support removing default services from the image, etc. How does that sound? > I=E2=80=99ve published the cloud-hypervisor patches for extra user consol= e device in my repository under -userconsole branch. > I=E2=80=99ll test it (or anyone can) for side effects and then we can di= scuss if it worth to be used in Spectrum or pushed upstream of C-H. > Here is the URL =E2=80=94 https://github.com/vadika/cloud-hypervisor/tree= /userconsole > > > On 6 Dec 2022, at 19:10, Alyssa Ross wrote: > > > > On Tue, Dec 06, 2022 at 05:57:19PM +0200, Vadim Likholetov wrote: > >> I=E2=80=99ve done this =E2=80=94 I have patched cloud-hypervisor to = have > >> three console devices =E2=80=94 serial, console and user-console, but = than > >> decided that this patches will never go to C-H mainline so got back > >> with more traditional approach with tmux :) > > > > I'd be pretty optimistic about the chances of a patch that just made it > > so you could provide multiple consoles the same way you can provide > > multiple block devices. Like "--console pty file=3D/path/to/console.ou= t" > > on the command like to make two consoles, one going to a pty and the > > other to a file. > > > > In Spectrum, the way I'd see such an approach working is that by default > > there'd be a single console that gave you a shell inside the VM, and if > > you needed other consoles for other reasons (e.g. if you had an > > application running on the console, like Lynx) you'd configure another > > console in the VM configuration. But as we move more towards graphical > > applications, it will probably become rare to need a secondary console > > for application interaction like that. > > > > To get a non-root shell from the root console though, I think it > > should be enough to just: > > > > # s6-applyuidgid -u 1000 -g 1000 sh > > > > (Adding tmux to the VM in development to be able to hop between multiple > > shell sessions would be a reasonable thing to do, of course.) > > > >>> On 6 Dec 2022, at 17:20, Alyssa Ross wrote: > >>> > >>> On Mon, Dec 05, 2022 at 12:42:35AM +0200, Vadim Likholetov wrote: > >>>> Cloud-hypervisor has virtual hardware limitations -- it supports onl= y one > >>>> console device and only one serial device. > >>>> SpectrumOS is using serial device for kernel logs of appVM and conso= le > >>>> device as a console. > >>>> To have access both to root-executed part and to user-executed part = of the > >>>> VM payload, I installed a tmux on console. > >>>> Now, when you're running vm-console command you get access to the t= mux > >>>> and have the ability to switch between root and user consoles, > >>>> that can be useful during debugging VM payload. > >>> > >>> I wonder what it would take to make cloud-hypervisor support multiple > >>> virtio-console devices=E2=80=A6 I suspect it wouldn't be too hard, si= nce it > >>> already supports multiples of every other virtio device just fine=E2= =80=A6 > >> > >> > > --njrmcoslw6vbghgp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEH9wgcxqlHM/ARR3h+dvtSFmyccAFAmOPpUcACgkQ+dvtSFmy ccAOaxAAnHU58c/4IFQSvMc4V4c0i5JDRinGG9Bm9wZkhSSpQixIFwVj4GZjyf4U cuFem53uqnsU0XVECcq32iMo9UOK37bhbb9N5mPtw7Z/br2dvP0lD5VF7NB3i3tZ Xd3aD93+3meehpgvb/WE21w83bdiieW48hb5GNU9yledvQGTXKvzr891OB6uQqnV J1NeSMwa6g1Fbz8iblKYqLMAB/Wk/MkPM3Kv3SJwieJoHbuAPZ4p5Fgg3CIahWxD eVxF11wQKO718fs+yBISmObDstM0xCgr4dU0dCA7VFIdP2Z8fqBG2X2rNBLmDYNE RlLDfNd2PNtJqS4f1izjdueFDiJmArrtuk8/QrrNoTgJvFpjyzZO+NhTeR0Focsb 2Hm0K6r6F1YzVb7hsGtOtYH8qPnWLGtVxL4A4Y8kxwwuf4tmucC52nSTClXNcbT6 xnWhum//E1vZQma8Ax5YCrzTs789Gxw7vbp35rq61L1Sa0n4V1YbRPE4g1lr5Vgm j+dy8xlCU3WIm+p0EgCYV3kgAeFevIEMqHPLyIzLBDvNRhRvlgkDsSNhthvFsTVR AeVnbpCDKENq99y8Y84wMlq2Yu3hjUjxDpMrBcFijJaWxdDa6GPAs5/i+LYJUm3Z nJUMg15V7E0f/HPAzGj2yvUDG6C/LjycPTj0+N/SVpko9WfDiNY= =AgRh -----END PGP SIGNATURE----- --njrmcoslw6vbghgp--