From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iCUwNoMxCl/ZXgAA0tVLHw (envelope-from ) for ; Sat, 11 Jul 2020 21:39:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 0HsOMoMxCl+wbgAA1q6Kng (envelope-from ) for ; Sat, 11 Jul 2020 21:39:15 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5E66D940225 for ; Sat, 11 Jul 2020 21:39:15 +0000 (UTC) Received: from localhost ([::1]:50700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1juNDE-00015J-VX for larch@yhetil.org; Sat, 11 Jul 2020 17:39:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1juND4-000152-CY for bug-guix@gnu.org; Sat, 11 Jul 2020 17:39:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33437) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1juND4-00038I-43 for bug-guix@gnu.org; Sat, 11 Jul 2020 17:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1juND4-0003Wf-2F for bug-guix@gnu.org; Sat, 11 Jul 2020 17:39:02 -0400 Subject: bug#42252: Not possible to reliably port forward with "guix system vm" anymore Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-To: bug-guix@gnu.org Resent-Date: Sat, 11 Jul 2020 21:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 42252 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Christopher Lemmer Webber , 42252-done@debbugs.gnu.org Mail-Followup-To: 42252@debbugs.gnu.org, marius@gnu.org, cwebber@dustycloud.org Received: via spool by 42252-done@debbugs.gnu.org id=D42252.159450352413522 (code D ref 42252); Sat, 11 Jul 2020 21:39:01 +0000 Received: (at 42252-done) by debbugs.gnu.org; 11 Jul 2020 21:38:44 +0000 Received: from localhost ([127.0.0.1]:44982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1juNCm-0003W2-GM for submit@debbugs.gnu.org; Sat, 11 Jul 2020 17:38:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1juNCj-0003Vm-MG for 42252-done@debbugs.gnu.org; Sat, 11 Jul 2020 17:38:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60326) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1juNCe-00037Z-5o; Sat, 11 Jul 2020 17:38:36 -0400 Received: from 84-52-226.102.3p.ntebredband.no ([84.52.226.102]:49462 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1juNCd-0005P3-OK; Sat, 11 Jul 2020 17:38:35 -0400 From: Marius Bakke In-Reply-To: <87r1tnf496.fsf@dustycloud.org> References: <87r1tnf496.fsf@dustycloud.org> Date: Sat, 11 Jul 2020 23:38:26 +0200 Message-ID: <87lfjpd965.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -0.61 X-TUID: VBVT3YuqCAtJ --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello! Sorry for this breakage, and thanks for the analysis! Christopher Lemmer Webber writes: > In commit 5379392731b52eef22b4936637eb592b93e04318, the following change > was introduced: > > modified gnu/system/vm.scm > @@ -941,6 +941,7 @@ with '-virtfs' options for the host file systems li= sted in SHARED-FS." > '()) >=20=20=20=20 > "-no-reboot" > + "-nic" "user,model=3Dvirtio-net-pci" > "-object" "rng-random,filename=3D/dev/urandom,id=3Dguixsd-vm-rng" > "-device" "virtio-rng-pci,rng=3Dguixsd-vm-rng" > > Unfortunately, this means that in our docs where we suggest doing the > following: > > `guix system vm config.scm` -nic user,model=3Dvirtio-net-pci,hostfwd=3D= tcp::10022-:22 > > Since we now provide our own similar "-nic" field this creates a > *second* network interface at the same address and there is a race as in > terms of which handles connections. Depending on the race result, > connections to the forwarded port may hang indefinitely. > > Ironically, this regression was introduced to solve another regression! >>>From the commit message: > > This fixes a regression introduced in 8e53fe2b91d2776bc1529e7b34967c8f1= d9edc32 > where 'guix system vm' would no longer be using virtio. > > What's the right solution? One could be that "guix system vm" itself > could take an argument that sets up port forwarding in the generated > shell script. Eg: > > guix system vm config.scm --hostfwd=3Dtcp::10022-:22 --hostfwd=3Dtcp::8= 888-:80 > > kind of ugly, but it could work. WDYT? My motivation for the breaking commit was just that 'guix system vm' and system tests would use virtio by default. Without it, system tests with forwarded ports used a different driver than those without forwardings. It's a very minor issue and can be solved in other ways. :-) If no -nic parameter is specified on the QEMU command line, QEMU will create one, emulating an Intel NIC. I did not consider the discrepancy this caused with the documentation when we unconditionally pass a -nic parameter! I think we should revert the commit, so that '`guix system vm` -nic foo' works as expected for end users. In fact I just did so. :-) Fixed in 1abf205d11c8b941d7d89855cb55a9cfde078838, thanks! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl8KMVIACgkQoqBt8qM6 VPqYngf+KupcZWHqayN+HYOBw9nxfh5e08NR05ZY0TZIIXg6wgObVZqKZ/KBiOOP QP3BWtVMrNNBVySi9HzQqI1V1j2tCcAWgD8luxoSqbTjX5+zUCZ4R/xzB8A++BLF g29wqjAKmqzb46TQZXQIzJluCKVFeQvfLdGtI+dRR5zu/M6Yk8xVAqdet6dQ931k LZiOkL/ryPhNexEYyAy0CKcFaSZg6AMS/7J/CV2JOrpL0WntsELQmIEoWFiMijxU CYg0Zem1SZoieAU+8qygStqKEo0gVZLLG9/p+xMGF/ief0FHFhJ/+M7+fRtSajKo YVwnTuD5utR2Y6DozZsLKVELIFeOLg== =wuhF -----END PGP SIGNATURE----- --=-=-=--