FS#73384 - [systemd] machinectl shell fails with Ubuntu container

Attached to Project: Arch Linux
Opened by Andrew Lipscomb (ALTinners) - Monday, 17 January 2022, 02:01 GMT
Last edited by Toolybird (Toolybird) - Thursday, 15 June 2023, 07:05 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Creating a new Ubuntu container as per the instructions at https://wiki.archlinux.org/title/systemd-nspawn#Create_a_Debian_or_Ubuntu_environment does not allow the created container to have the `machinectl shell root@vm-focal /bin/bash` command run. Previously this has worked.

The container can be ran via `systemd-nspawn` without the `-b` option and seems intact and usable.

However any command run via `machinectl shell` for a running container causes a coredump - even simple ones like `ls`

Only an Ubuntu container seems to do this - an equivalently made arch container runs just fine. I have not tried Debian.
Checking the upstream systemd repo is not showing anything like this at the moment.

Additional info:
* systemd 250.2-2
* linux 5.16.arch1-1
* Systemd cat for the `systemd-nspawn@vm-ubuntu.service`
* Journal output for the `systemd-nspawn@vm-ubuntu.service`
* `SYSTEMD_LOG_LEVEL=debug machinectl shell vm-focal /bin/ls` output

Steps to reproduce:
* Create a container with a bootable ubuntu systemd `debootstrap --include=systemd-container --components=main,universe focal /var/lib/machines/vm-focal http://archive.ubuntu.com/ubuntu/`
* Set the password for root
```
systemd-nspawn -D /var/lib/machines/vm-focal
passwd
exit
```
* Start the container `machinectl start vm-focal`
* Attempt a trivial shell call ie: `machinectl shell vm-focal /bin/true`
This task depends upon

Closed by  Toolybird (Toolybird)
Thursday, 15 June 2023, 07:05 GMT
Reason for closing:  Works for me
Additional comments about closing:  See comments
Comment by Andrew Lipscomb (ALTinners) - Monday, 17 January 2022, 02:05 GMT
Reading through the manual for ways to not use machinectl - it seems `systemd-run` can also work here with a similar syntax.

This appears to work correctly.

```
andrew.lipscomb@andrew:~$ sudo systemd-run --machine vm-focal --pty /bin/bash
Running as unit: run-u10.service
Press ^] three times within 1s to disconnect TTY.
root@andrew:/#
```
Comment by Toolybird (Toolybird) - Thursday, 15 June 2023, 07:05 GMT
Just tried this with a "jammy" container and it works fine. Was likely a transient problem (since fixed). I cannot see how this is/was an Arch packaging bug anyway.

Loading...