* Ubuntu 18.04 LTS Bionic - Installing Guix in an LXC
[not found] <CAL7_Mo_cdV7T2iF6eyTmOX2ci=u319m5w_RiGLJuYG7hQupMYA@mail.gmail.com>
@ 2018-10-16 10:57 ` Amirouche Boubekki
2018-10-16 17:17 ` Amirouche Boubekki
2018-10-17 12:12 ` Ludovic Courtès
0 siblings, 2 replies; 3+ messages in thread
From: Amirouche Boubekki @ 2018-10-16 10:57 UTC (permalink / raw)
To: help-guix
[-- Attachment #1: Type: text/plain, Size: 2039 bytes --]
To install guix (the package manager) inside an ubuntu LXC on Ubuntu you
can do the following:
$ sudo apt install lxc
$ sudo lxc-create -t download -n schemer -- --dist ubuntu --release bionic
--arch amd64
That will create a lightweight virtulal machine with ubuntu bionic as a
distribution.
To connect to it, use the following command:
$ sudo lxc-start -n schemer
$ sudo lxc-attach -n schemer
This will open a bash prompt inside the LXC container.
It's recommended to install emacs-no-x (!) and openssh-server:
# apt install emacs-no-x
# apt install openssh-server
Then change the configuration of sshd to allow to connect as root:
# emacs /etc/ssh/sshd_config
You must have a line in that file that says:
PermitRootLogin yes
Restart ssh daemon:
# /etc/init.d/sshd restart
Use the following command to know the IP of the container:
# ip a
Set a password for the root login:
# passwd
Now type 'exit' to exit the container and return to the host. You can a now
connect using ssh:
$ ssh root@$IP_OF_SCHEMER
Now, you are connected to the LXC using ssh, you can follow the usual steps
to install guix from the manual:
http://www.gnu.org/software/guix/download/
Now you might try to do:
# guix package -i hello
And it will fail with the following error:
> build failed: while setting up the build environment: unable to make ?/?
private mount: Permission denied
If you look at 'dmesg' output you will see something like:
> audit: type=1400 audit(1539605833.825:115): apparmor="DENIED"
operation="mount" info="failed flags match" error=-13
profile="lxc-container-default-cgns" name="/" pid=13543 comm="guix-daemon"
flags="rw, rprivate"
That's where it gets ugly. I only know how to disable apparmor for that lxc
container.
Go to /var/lib/lxc/schemer/config and add somewhere in that file the
following command:
lxc.apparmor.profile = unconfined
You might need to restart the lxc container:
$ lxc-stop -n schemer
$ lxc-start -n schemer
$ ssh root@$IP_OF_SCHEMER
# guix package -i hello && hello
Happy hacking!
[-- Attachment #2: Type: text/html, Size: 3383 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Ubuntu 18.04 LTS Bionic - Installing Guix in an LXC
2018-10-16 10:57 ` Ubuntu 18.04 LTS Bionic - Installing Guix in an LXC Amirouche Boubekki
@ 2018-10-16 17:17 ` Amirouche Boubekki
2018-10-17 12:12 ` Ludovic Courtès
1 sibling, 0 replies; 3+ messages in thread
From: Amirouche Boubekki @ 2018-10-16 17:17 UTC (permalink / raw)
To: help-guix
[-- Attachment #1: Type: text/plain, Size: 2533 bytes --]
There is still an issue with the locale that is C.UTF-8.
To fix it, you can add:
lxc.environment = LC_ALL=en_US.UTF-8
To the file /var/lib/lxc/schemer/config
Le mar. 16 oct. 2018 à 12:57, Amirouche Boubekki <
amirouche.boubekki@gmail.com> a écrit :
> To install guix (the package manager) inside an ubuntu LXC on Ubuntu you
> can do the following:
>
> $ sudo apt install lxc
> $ sudo lxc-create -t download -n schemer -- --dist ubuntu --release bionic
> --arch amd64
>
> That will create a lightweight virtulal machine with ubuntu bionic as a
> distribution.
>
> To connect to it, use the following command:
>
> $ sudo lxc-start -n schemer
> $ sudo lxc-attach -n schemer
>
> This will open a bash prompt inside the LXC container.
>
> It's recommended to install emacs-no-x (!) and openssh-server:
>
> # apt install emacs-no-x
> # apt install openssh-server
>
> Then change the configuration of sshd to allow to connect as root:
>
> # emacs /etc/ssh/sshd_config
>
> You must have a line in that file that says:
>
> PermitRootLogin yes
>
> Restart ssh daemon:
>
> # /etc/init.d/sshd restart
>
> Use the following command to know the IP of the container:
>
> # ip a
>
> Set a password for the root login:
>
> # passwd
>
> Now type 'exit' to exit the container and return to the host. You can a
> now connect using ssh:
>
> $ ssh root@$IP_OF_SCHEMER
>
> Now, you are connected to the LXC using ssh, you can follow the usual
> steps
> to install guix from the manual:
>
> http://www.gnu.org/software/guix/download/
>
> Now you might try to do:
>
> # guix package -i hello
>
> And it will fail with the following error:
>
> > build failed: while setting up the build environment: unable to make ?/?
> private mount: Permission denied
>
> If you look at 'dmesg' output you will see something like:
>
> > audit: type=1400 audit(1539605833.825:115): apparmor="DENIED"
> operation="mount" info="failed flags match" error=-13
> profile="lxc-container-default-cgns" name="/" pid=13543 comm="guix-daemon"
> flags="rw, rprivate"
>
> That's where it gets ugly. I only know how to disable apparmor for that
> lxc container.
>
> Go to /var/lib/lxc/schemer/config and add somewhere in that file the
> following command:
>
> lxc.apparmor.profile = unconfined
>
> You might need to restart the lxc container:
>
> $ lxc-stop -n schemer
> $ lxc-start -n schemer
> $ ssh root@$IP_OF_SCHEMER
> # guix package -i hello && hello
>
>
> Happy hacking!
>
[-- Attachment #2: Type: text/html, Size: 4068 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Ubuntu 18.04 LTS Bionic - Installing Guix in an LXC
2018-10-16 10:57 ` Ubuntu 18.04 LTS Bionic - Installing Guix in an LXC Amirouche Boubekki
2018-10-16 17:17 ` Amirouche Boubekki
@ 2018-10-17 12:12 ` Ludovic Courtès
1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2018-10-17 12:12 UTC (permalink / raw)
To: Amirouche Boubekki; +Cc: help-guix
Hello,
Amirouche Boubekki <amirouche.boubekki@gmail.com> skribis:
>> build failed: while setting up the build environment: unable to make ?/?
> private mount: Permission denied
>
> If you look at 'dmesg' output you will see something like:
>
>> audit: type=1400 audit(1539605833.825:115): apparmor="DENIED"
> operation="mount" info="failed flags match" error=-13
> profile="lxc-container-default-cgns" name="/" pid=13543 comm="guix-daemon"
> flags="rw, rprivate"
>
> That's where it gets ugly. I only know how to disable apparmor for that lxc
> container.
>
> Go to /var/lib/lxc/schemer/config and add somewhere in that file the
> following command:
>
> lxc.apparmor.profile = unconfined
Thanks for sharing the trick!
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-17 12:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAL7_Mo_cdV7T2iF6eyTmOX2ci=u319m5w_RiGLJuYG7hQupMYA@mail.gmail.com>
2018-10-16 10:57 ` Ubuntu 18.04 LTS Bionic - Installing Guix in an LXC Amirouche Boubekki
2018-10-16 17:17 ` Amirouche Boubekki
2018-10-17 12:12 ` Ludovic Courtès
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.