From: ludo@gnu.org (Ludovic Courtès)
To: Eddy Pronk <epronk@muftor.com>
Cc: guix-devel@gnu.org
Subject: Re: guixsd in lxd container
Date: Fri, 09 Jun 2017 23:54:23 +0200 [thread overview]
Message-ID: <87h8zo3jzk.fsf@gnu.org> (raw)
In-Reply-To: <CAErGuQguW9qJGBeAn1QjiUYdakON2gSzhqZQYL4Eis6TNgy20g@mail.gmail.com> (Eddy Pronk's message of "Wed, 7 Jun 2017 23:08:29 +1000")
Hi Eddy,
Eddy Pronk <epronk@muftor.com> 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/environ.
> 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.
>
> ====
> cat /sbin/start
> export HOME=/
> export TERM=linux
> export
> BOOT_IMAGE="/gnu/store/fqc2kg4lq1lz1ymk41080jzb5q90icg0-linux-libre-4.11/bzImage
> --root=gnu-disk-image
> --system=/gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system
> --load=/gnu/store/kq71yhydfgc0nksvmmn66cbvbj5a3mvf-system/boot"
> export PATH=/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
> ===
>
> 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’s 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 ‘system’ either from the kernel’s
‘--system’ command-line argument (/proc/cmdline), or from the
‘GUIX_NEW_SYSTEM’ environment variable.
So you’d have to set ‘GUIX_NEW_SYSTEM’ in your case to fix this.
> Service file-system-/tmp has been started.
> failed to start service 'file-systems' <<== first problem.
> failed to start service 'file-system-/dev/pts'
What ‘guix system container’ 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-container.scm#n37
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/file-systems.scm#n325
HTH!
BTW, did you consider using ‘guix system container’ directly instead of
LXC? It’s not perfect but probably worth a try:
https://www.gnu.org/software/guix/manual/html_node/Invoking-guix-system.html
Ludo’.
next prev parent reply other threads:[~2017-06-09 21:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-07 13:08 guixsd in lxd container Eddy Pronk
2017-06-09 21:54 ` Ludovic Courtès [this message]
2017-06-10 4:53 ` Eddy Pronk
2017-06-10 5:30 ` Jan Nieuwenhuizen
2017-06-11 20:26 ` Ludovic Courtès
2017-06-16 12:21 ` Eddy Pronk
2017-06-19 11:41 ` Ludovic Courtès
2017-06-20 12:35 ` Eddy Pronk
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=87h8zo3jzk.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=epronk@muftor.com \
--cc=guix-devel@gnu.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.