Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
unable to systemd-nspawn into containers
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1110

PostPosted: Tue Jun 07, 2016 7:22 am    Post subject: unable to systemd-nspawn into containers Reply with quote

g50-80 backups # systemd-nspawn .
Spawning container backups on /media/hdd/backups.
Press ^] three times within 1s to kill container.
execv() failed: Permission denied
Container backups failed with error code 1.
g50-80 backups # ls
backup.sh bin dev home lib32 lost+found media opt root sbin sys usr
backup.tar.gz boot etc lib lib64 make.conf mnt proc run srv tmp var
g50-80 backups #


chrooting works though:
g50-80 backups # chroot .
g50-80 / #

I can execute files:
g50-80 backups # bin/bash
g50-80 backups #
g50-80 backups # bin/ls
backup.sh bin dev home lib32 lost+found media opt root sbin sys usr
backup.tar.gz boot etc lib lib64 make.conf mnt proc run srv tmp var

g50-80 backups # pwd
/media/hdd/backups

there is a symbolic link involved for one of the parent directories if that makes any difference:
lrwxrwxrwx 1 root root 22 Jun 3 13:05 /media/hdd -> /media/root/media/hdd/
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1110

PostPosted: Thu Jun 09, 2016 7:47 pm    Post subject: Reply with quote

I'm getting a different message this time:
g50-80 backups # systemd-nspawn
Spawning container backups on /media/hdd/backups.
Press ^] three times within 1s to kill container.
Failed to fork inner child: Invalid argument
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1324
Location: Montréal

PostPosted: Fri Jun 10, 2016 2:45 am    Post subject: Reply with quote

When I do systemd-nspawn and chroot I do it from the root home directory and I specify a user. Try
Code:
cd
systemd-nspawn -D /media/hdd/backups -u root

or whatever user you want to login.
_________________
Paul
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1110

PostPosted: Fri Jun 10, 2016 6:57 am    Post subject: Reply with quote

unfortunately that did not work :(
g50-80 ~ # systemd-nspawn -D /media/hdd/backups -u root
Spawning container backups on /media/root/media/hdd/backups.
Press ^] three times within 1s to kill container.
Failed to fork inner child: Invalid argument
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1110

PostPosted: Mon Jun 13, 2016 5:44 pm    Post subject: Reply with quote

bump
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1110

PostPosted: Thu Jun 23, 2016 8:05 am    Post subject: Reply with quote

here's an strace of the spawning:
http://pastebin.com/3EbWNkz3

I see some problems(might not be related to this issue):
239: open("/sys/fs/kdbus/0-system/bus", O_RDWR|O_NOCTTY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
247: getsockopt(12, SOL_SOCKET, SO_PEERSEC, 0x5559e12be260, 0x7ffc25a049e4) = -1 ENOPROTOOPT (Protocol not available)
256: recvmsg(12, 0x7ffc25a038b0, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1110

PostPosted: Thu Aug 11, 2016 10:24 am    Post subject: Reply with quote

now it's
Spawning container root on /media/root.
Press ^] three times within 1s to kill container.
Host and machine ids are equal (3cb75e38bee26b705d6c85cf574ddab1): refusing to link journals
execv() failed: Permission denied
Container root failed with error code 1.


partition is mounted with exec
Back to top
View user's profile Send private message
dan2003
Apprentice
Apprentice


Joined: 11 May 2003
Posts: 257
Location: somewhere near london, UK

PostPosted: Fri Nov 10, 2017 9:45 am    Post subject: Reply with quote

Maybe not of any help to the OP anymore but in case anybody else has this issue and finds themselves here the following resolved it for me.

Quote:
You need support for namespaces and multiple devpts instances in your kernel:

CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y


Thanks to https://rich0gentoo.wordpress.com/2014/07/14/quick-systemd-nspawn-guide/
_________________
Too easy!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum