You are not logged in.

#1 2021-05-18 17:10:58

7thCore
Member
Registered: 2018-06-09
Posts: 75

[SOLVED] Systemd-Nspawn containers giving "exec format error"

Long story short I have a few services in their own nspawn containers (Nextcloud, Plex, Transmission...). The os is running on a 500G ssd and because i want to have system snapshots with btrfs I had to resize the boot partition (systemd-boot) Before I wnt on this venture I hooked up an external ssd drive and transfered the btrfs subvolumes (root,home and /var/lib/machines) to it using btrfs send | btrfs receive.

After resizing the partitions, transfering the os back on to the ssd and reinstalling systemd-boot the system booted on the first go. The problem however are the nspawn containers. None of them start no matter what.

Here is the error i get from all of them if I try to start them:

root@Rocinante machines]# systemd-nspawn --boot --link-journal=try-guest --network-veth -U --settings=override --machine=Rocinante-Con-Transmission
Spawning container Rocinante-Con-Transmission on /var/lib/machines/Rocinante-Con-Transmission.
Press ^] three times within 1s to kill container.
Selected user namespace base 568197120 and range 65536.
Using default interface naming scheme 'v247'.
Network interface name 'vb-Rocinante-Con-Transmission' has been changed to 'vb-RocinantceXX' to fit length constraints.
execv(/usr/lib/systemd/systemd, /lib/systemd/systemd, /sbin/init) failed: Exec format error
Container Rocinante-Con-Transmission failed with error code 1.

Here is the .nspawn file i usually run with machinectl:

[Exec]
Boot=yes
PrivateUsers=568197120:65536
NotifyReady=yes
Hostname=Rocinante-Con-Transmission
Timezone=symlink
LinkJournal=try-guest
ResolvConf=copy-host

[Files]
PrivateUsersChown=true
BindReadOnly=/var/cache/pacman/pkg:/var/cache/pacman/pkg-host
BindReadOnly=/var/lib/machines/Rocinante-Con-Repo/var/cache/pacman/rocinante-repo:/var/cache/pacman/rocinante-repo
Bind=/nas/transmission:/transmission

[Network]
Private=yes
VirtualEthernet=yes
Bridge=nic0-bridge

Systemd status and journalctl throw out the same error and I can't find anything significant to indicate what the problem is.

Here is an ls -alis just so you know each container has it's own private user and group:

   256 0 drwx------ 1 root       root       216 maj 18 19:08 .
   262 0 drwxr-xr-x 1 root       root       206 maj 18 17:13 ..
272501 0 drwxr-xr-x 1  116129792  116129792 122 maj  4 22:22 Rocinante-Con-Games
   258 0 drwxr-xr-x 1 1181679616 1181679616 186 apr 28 03:02 Rocinante-Con-Nextcloud
   259 0 drwxr-xr-x 1  433782784  433782784 134 apr 28 12:28 Rocinante-Con-Plex
   257 0 drwxr-xr-x 1  296484864  296484864 122 apr 28 01:59 Rocinante-Con-Repo
   260 0 drwxr-xr-x 1  568197120  568197120 138 apr 28 23:34 Rocinante-Con-Transmission

If you need additional info let me know.

Last edited by 7thCore (2021-05-24 17:27:44)


The Linux philosophy is 'Laugh in the face of danger'. Oops. Wrong One. 'Do it yourself'. Yes, that's it.

Offline

#2 2021-05-24 07:13:28

7thCore
Member
Registered: 2018-06-09
Posts: 75

Re: [SOLVED] Systemd-Nspawn containers giving "exec format error"

Found out that most of the system libs in the containers ware empty files after the move. Probably because I didn't realise that /var/lib/machines was a loopback volume of btrfs. That's the reason why I couldn't chroot in or fix it with pacman. Ended up rebuilding all of the containers and I made myself a proper machines subvolume and bootable snapshot/backup pacman hook for pre updating.

Marking as closed.

Last edited by 7thCore (2021-05-24 07:17:36)


The Linux philosophy is 'Laugh in the face of danger'. Oops. Wrong One. 'Do it yourself'. Yes, that's it.

Offline

#3 2021-05-24 10:36:38

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,635
Website

Re: [SOLVED] Systemd-Nspawn containers giving "exec format error"

Please do not use 'closed', use e.g. 'solved' or 'fixed'.

https://gitlab.archlinux.org/archlinux/ … ow-to-post


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2021-05-24 17:26:34

7thCore
Member
Registered: 2018-06-09
Posts: 75

Re: [SOLVED] Systemd-Nspawn containers giving "exec format error"

Understood. Thanks for letting me know.


The Linux philosophy is 'Laugh in the face of danger'. Oops. Wrong One. 'Do it yourself'. Yes, that's it.

Offline

Board footer

Powered by FluxBB