From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Baines Subject: Re: A few questions about guix containers Date: Sat, 11 May 2019 23:25:16 +0100 Message-ID: <87y33cmxwz.fsf@cbaines.net> References: <87sgtlxea3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:42123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPaQr-0000Nu-1F for help-guix@gnu.org; Sat, 11 May 2019 18:25:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPaQp-0003NK-3K for help-guix@gnu.org; Sat, 11 May 2019 18:25:28 -0400 Received: from mira.cbaines.net ([2a01:7e00::f03c:91ff:fe69:8da9]:48772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPaQo-0003FA-JE for help-guix@gnu.org; Sat, 11 May 2019 18:25:27 -0400 In-reply-to: <87sgtlxea3.fsf@gmail.com> 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: alex.sassmannshausen@gmail.com Cc: help-guix --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlzXS8xfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XdXlQ//UEXT8Y/SNd5LwGZilW5E4T8WnEivCjHVjTJEjnDWSJnCStDEulMK4vLe SxTT4Xi83Vu6KERWulRoHU8Wt2htgdgKGgyG+MbTYhdDEXVvFvfNPk28nMRRjIct 05LihJtDvWSTxgxS0YaSUJna+iliatMOGfWEYVDNnDGG0ttVmnWg8aXiDZIVaRN7 eLlX9lWaEUdqDpGJy59Cjo3e+miJYefVrWiscWeQG9sU29721eBK1GBGeO2PU9ms 6SePTZrSmhYJoO6zGxrIc5KXWGb/KDeu9JSSbN/0VwGLQZPJeKu8chqMx72iH8W5 kNQmzcpZXN5HJN1RojZLGpnqyokbAwME2pH5YV/63UrnAToc4cUzHAhV1cypLSid 0cMfLioZ5aOoCfTgbMMyKnv8vuZXSrVGpOG+eHIkTgyznRLMP8nJ+q6/P/Vtc1Tw cRzW7oXpNd9oGyRom3gNFerdepU7mYZv0IFPnuaGNI1Wulsn51UcPVc4ywWaWgzu pkI03eGtElPUEfMXZc06Tk7Xw0THyhyQ0p78Xy55QZ3BhEcG7D9AaiidrrH55OlP 3PeH+9huaNMGHg/WzA4wNGhVhbd+0JWP1aut74zSPyjLtYUhQAgAANu5Bcw4iHRC LCMcMqFwaJl7UHvAucIR4Kh6ZCX2enILVy8l7yzo2MfUVzcy5hY= =UXvm -----END PGP SIGNATURE----- --=-=-=--