From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: guixsd in lxd container Date: Fri, 09 Jun 2017 23:54:23 +0200 Message-ID: <87h8zo3jzk.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJRrV-0006J0-LR for guix-devel@gnu.org; Fri, 09 Jun 2017 17:54:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJRrO-0002ui-Fv for guix-devel@gnu.org; Fri, 09 Jun 2017 17:54:31 -0400 In-Reply-To: (Eddy Pronk's message of "Wed, 7 Jun 2017 23:08:29 +1000") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Eddy Pronk Cc: guix-devel@gnu.org Hi Eddy, Eddy Pronk skribis: > I'm trying to run guixsd in an lxd container. > My lxd containers run on an Ubuntu server 16.04. > > I took the usb-installer image and imported in as an lxd image. > > When a container start it runs /sbin/init. You mean LXD expects to run /sbin/init, right? > In guixsd /proc/1 is shepherd, but a lot of stuff happens before shepherd > is started. > > I've set a few things in the environment matching values in /proc/1/envir= on. > The argument of --load in grub.cfg is a guile program. > > I found some details about the kernel loading guile here: > https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00704.html > > To be able to get some logging during startup of guixsd I'm trying to run > it from a shell script as root. > > =3D=3D=3D=3D > cat /sbin/start > export HOME=3D/ > export TERM=3Dlinux > export > BOOT_IMAGE=3D"/gnu/store/fqc2kg4lq1lz1ymk41080jzb5q90icg0-linux-libre-4.1= 1/bzImage > --root=3Dgnu-disk-image > --system=3D/gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system > --load=3D/gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system/boot" > export PATH=3D/gnu/store/crvb68g89b479n4h44r8l42hy39axhg2-shadow-4.4/sbin/ > cd $HOME > /gnu/store/sa7zrdfqglnb5rvvr11qdj0rspbs292v-profile/bin/ln -s > /gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system /run/current-system > /gnu/store/zk41gmzbibvpx9dpsm5gs8p0liz8shy0-guile-2.0.14/bin/guile > --no-auto-compile /gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system/boot > =3D=3D=3D > > When I run the start script I get the following output. > > $ lxc exec guixsd -- > /gnu/store/sa7zrdfqglnb5rvvr11qdj0rspbs292v-profile/bin/bash -c > "/sbin/start 2>&1" > /gnu/store/sa7zrdfqglnb5rvvr11qdj0rspbs292v-profile/bin/ln: failed to > create symbolic link > '/run/current-system/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system': File exists > making '#f' the current system... [...] > In ./gnu/build/activation.scm: > 456: 1 [activate-current-system #f] > In unknown file: > ?: 0 [symlink #f "/run/current-system.new"] > > ERROR: In procedure symlink: > ERROR: Wrong type (expecting string): #f The line that=E2=80=99s printed here comes from (gnu build activation): https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/activation.scm#= n442 As you can see, it takes the value of =E2=80=98system=E2=80=99 either from = the kernel=E2=80=99s =E2=80=98--system=E2=80=99 command-line argument (/proc/cmdline), or from t= he =E2=80=98GUIX_NEW_SYSTEM=E2=80=99 environment variable. So you=E2=80=99d have to set =E2=80=98GUIX_NEW_SYSTEM=E2=80=99 in your case= to fix this. > Service file-system-/tmp has been started. > failed to start service 'file-systems' <<=3D=3D first problem. > failed to start service 'file-system-/dev/pts' What =E2=80=98guix system container=E2=80=99 does to work around this is to= try to mount only file systems that can really be mounted inside a container, with the right options: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/linux-containe= r.scm#n37 https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/file-systems.s= cm#n325 HTH! BTW, did you consider using =E2=80=98guix system container=E2=80=99 directl= y instead of LXC? It=E2=80=99s not perfect but probably worth a try: https://www.gnu.org/software/guix/manual/html_node/Invoking-guix-system.h= tml Ludo=E2=80=99.