all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marius Bakke <marius@gnu.org>
To: Christopher Lemmer Webber <cwebber@dustycloud.org>,
	42252-done@debbugs.gnu.org
Subject: bug#42252: Not possible to reliably port forward with "guix system vm" anymore
Date: Sat, 11 Jul 2020 23:38:26 +0200	[thread overview]
Message-ID: <87lfjpd965.fsf@gnu.org> (raw)
In-Reply-To: <87r1tnf496.fsf@dustycloud.org>

[-- Attachment #1: Type: text/plain, Size: 2313 bytes --]

Hello!

Sorry for this breakage, and thanks for the analysis!

Christopher Lemmer Webber <cwebber@dustycloud.org> 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 listed in SHARED-FS."
>                '())
>    
>         "-no-reboot"
>   +     "-nic" "user,model=virtio-net-pci"
>         "-object" "rng-random,filename=/dev/urandom,id=guixsd-vm-rng"
>         "-device" "virtio-rng-pci,rng=guixsd-vm-rng"
>
> Unfortunately, this means that in our docs where we suggest doing the
> following:
>
>   `guix system vm config.scm` -nic user,model=virtio-net-pci,hostfwd=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 8e53fe2b91d2776bc1529e7b34967c8f1d9edc32
>   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=tcp::10022-:22 --hostfwd=tcp::8888-: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!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

      parent reply	other threads:[~2020-07-11 21:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 20:40 bug#42252: Not possible to reliably port forward with "guix system vm" anymore Christopher Lemmer Webber
2020-07-07 21:00 ` Christopher Lemmer Webber
2020-07-07 22:21   ` Christopher Lemmer Webber
2020-07-08  9:46 ` Bengt Richter
2020-07-11 19:49   ` Christopher Lemmer Webber
2020-07-11 21:38 ` Marius Bakke [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lfjpd965.fsf@gnu.org \
    --to=marius@gnu.org \
    --cc=42252-done@debbugs.gnu.org \
    --cc=cwebber@dustycloud.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.