Skip to content

A systemd-based chroot done right #38768

@MagicMuscleMan

Description

@MagicMuscleMan

Component

No response

Is your feature request related to a problem? Please describe

On an amd64 system I am always frustrated when I need to chroot into a Raspberry Pi image. I need to remember copying qemu-arm-static over and mention it in the chroot command.

Then I realize, that I need to open another shell where I need to mount most of the pseudo file systems underlying /dev or /sys which is hard to remember and is still full of trouble.

Describe the solution you'd like

I am convinced that systemd could provide both a more convenient and a more secure command. This would be similar to run0 replacing sudo in a lot of cases.

Systemd can auto-detect when chrooting into a file system hierarchy which a non-native ABI. It can also automatically (bind)mount the pseudo file systems. There are probably different use cases for these features which can be made available via command line options.

I wouldn't be surprised if there were a lot more ways how to make chrooting more convenient and more secure.

Describe alternatives you've considered

A completely separate tool independent of systemd would be possible. However, systemd knows so much about file system mounts, container and basic system operations, that it really seems to be the natural environment to create such a tool.

The systemd version you checked that didn't have the feature you are asking for

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-reporter-feedback ❓There's an unanswered question, the reporter needs to answer

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions