From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Sassmannshausen Subject: Re: A few questions about guix containers Date: Mon, 27 May 2019 14:52:45 +0200 Message-ID: <87y32s5aaq.fsf@gmail.com> References: <87sgtlxea3.fsf@gmail.com> <87y33cmxwz.fsf@cbaines.net> Reply-To: alex.sassmannshausen@gmail.com Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:56698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVF7e-00049V-7z for help-guix@gnu.org; Mon, 27 May 2019 08:53:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVF7d-0003ID-3z for help-guix@gnu.org; Mon, 27 May 2019 08:53:02 -0400 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]:46180) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVF7c-0003DH-S8 for help-guix@gnu.org; Mon, 27 May 2019 08:53:01 -0400 Received: by mail-ed1-x543.google.com with SMTP id f37so26535266edb.13 for ; Mon, 27 May 2019 05:53:00 -0700 (PDT) In-reply-to: <87y33cmxwz.fsf@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Christopher Baines Cc: help-guix Hi Chris, I wanted to thank you for your notes! As always, my "I'll write a long response with thoughts tomorrow" turned into "I'll write a response at some point in the future." I appreciated the pointers to the developments that have tentatively happened. Very interesting! Cheers, Alex Christopher Baines writes: > Alex Sassmannshausen writes: > >> Hello, >> >> I'm trying to get to grips with Guix's container support. >> >> Specifically, I can create containerised system using >> $ guix system container /path/to/sysconf.scm >> >> I should then be able to run commands in that container using >> $ guix container exec PID CMD >> >> But here's the rub: how do I find the PID of the container launched >> using 'guix system container'? > > I usually use htop or pgrep. I've been thinking recently about getting > the script that launches the container to write the PID out somewhere, > although I think you could also achieve this by sharing a directory > between the container and the host system, and having a process in the > container create a file in that directory. Then you could maybe use the > PID that owns that shared file... > >> Also, I can relatively straight forwardly map network ports to guix >> systems using >> $ guix system vm /path/to/sysconf.scm >> and qemu's -net user,hostfwd syntax >> >> Can I achieve similar mappings using 'guix system container'? >> >> Is anyone using containers to test complex networked services in system >> configurations? > > So I've been using guix system container with some success for a while > now, but I've been relying on this old patch I wrote to add shared > network support, in the same way that guix environment can do it [1] > > 1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28128 > > I haven't given it enough attention, but recently Arun Isaac looks to > have picked it up, so I'm hopeful that this functionality might be more > widely available soon. > > One thing I'd love to see in this area is to be able to do networking > similar to how libvirt/virt-manager does it. You can manage virtual > networks there, and I'm not knowledgeable enough about networking to > know what exactly it's doing, but I'd love to be able to run a > container, and have it's network namespace it on a separate IP address > on a virtual network. This would avoid port conflict problems with > sharing localhost with the host system. > > Chris