unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: yasu <yasu@yasuaki.com>
To: zimoun <zimon.toutoune@gmail.com>,
	bug-guix@gnu.org,  pgarlick@tourbillion-technology.com,
	Pjotr Prins <pjotr.public12@thebird.nl>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: BUG: Re: guix environment: error: cannot create container: unprivileged user cannot create user namespaces
Date: Mon, 07 Dec 2020 05:51:05 +0900	[thread overview]
Message-ID: <382923d762cf018ae9d75b3408db75abf296e543.camel@yasuaki.com> (raw)
In-Reply-To: <86eek2an53.fsf@gmail.com>

Hi Zimoun,

I tried as you suggested but it didn't work...


   root@guix ~# echo "kernel.unprivileged_userns_clone = 1" >
   /etc/sysctl.d/local.conf
   -bash: /etc/sysctl.d/local.conf: No such file or directory
   root@guix ~# sysctl --system
   root@guix ~# logout
   ~$ guix environment -C
   guix environment: error: cannot create container: unprivileged user
   cannot create user namespaces
   guix environment: error: please set
   /proc/sys/kernel/unprivileged_userns_clone to "1"


Now, if this posting were to be belived, I think this term
   kernel.unprivileged_userns_clone

   is specific to Debian Linux, and does not exist outside of that circle.
       
   It disables a bit of "hardening" that Debian patches into their 
   distribution kernel. If you're not running such a kernel, it will
   fail 
   and not do anything, as such a setting doesn't even exist in the
   mainline Linux kernel.

    
   I wonder how this term came in to Guix in the first place?

   -Yasu


   On Sun, 2020-12-06 at 17:56 +0100, zimoun wrote:
   > Hi,
> 
> Please try the recommendation. Have you tried it?
> 
>   please set /proc/sys/kernel/unprivileged_userns_clone to "1"
> 
> As root, you just do:
> 
>   echo 1 > /proc/sys/kernel/unprivileged_userns_clone
> 
> then “guix environment -C” should work as expected.  To do the trick
> automatically with Sheperd, I do not know, but I am sure that the
> systemd equivalent 
> 
>   echo "kernel.unprivileged_userns_clone = 1" >
> /etc/sysctl.d/local.conf
>   sysctl --system
> 
> seems doable with Guix System.
> 
> 
> On my system, and I need explanations if it does not work similarly
> on
> yours, I simply do:
> 
> --8<---------------cut here---------------start------------->8---
> $ guix environment -C --ad-hoc hello -- hello 
> guix environment: error: cannot create container: unprivileged user
> cannot create user namespaces
> guix environment: error: please set
> /proc/sys/kernel/unprivileged_userns_clone to "1"
> 
> $ su -
> Password:
> # echo 1 > /proc/sys/kernel/unprivileged_userns_clone 
> # logout
> 
> $ guix environment -C --ad-hoc hello -- hello 
> Hello, world!
> --8<---------------cut here---------------end--------------->8---
> 
> Hope that helps,
> simon



  reply	other threads:[~2020-12-06 20:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <e5c86d238ca5174b745b8ea6cb0cb6ad6b20aa5e.camel@yasuaki.com>
     [not found] ` <CAJ3okZ19V7jh8SEOSKR+kMw_9qCWupjiHecNi+0v2A_fKH2EKQ@mail.gmail.com>
     [not found]   ` <20201204185537.qhapfbyaq7cr5lkr@thebird.nl>
     [not found]     ` <4556420c9440a6c34df93213e3934176e214483f.camel@yasuaki.com>
2020-12-06 12:41       ` BUG: Re: guix environment: error: cannot create container: unprivileged user cannot create user namespaces yasu
2020-12-06 16:16         ` bug#45069: " Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-12-06 16:56         ` zimoun
2020-12-06 20:51           ` yasu [this message]
2021-01-06 10:49             ` raingloom
     [not found]           ` <CADdvwM-h6q9BvO5ZWxgUbHfdzDRc-Sj899ZPgrwqV5o1XUVnDg@mail.gmail.com>
2020-12-07 11:57             ` bug#45069: " Pierre Neidhardt
     [not found]               ` <1f56aef4d7b707826f34413672408e33385bbc6a.camel@tourbillion-technology.com>
2020-12-07 12:41                 ` Yasuaki Kudo
     [not found]                 ` <87tusxwncj.fsf@ambrevar.xyz>
2020-12-07 19:50                   ` Paul Garlick
     [not found]                     ` <87im9dwe07.fsf@ambrevar.xyz>
2020-12-07 21:09                       ` zimoun
2020-12-07 13:26               ` zimoun

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=382923d762cf018ae9d75b3408db75abf296e543.camel@yasuaki.com \
    --to=yasu@yasuaki.com \
    --cc=bug-guix@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=pgarlick@tourbillion-technology.com \
    --cc=pjotr.public12@thebird.nl \
    --cc=zimon.toutoune@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).