Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/create: Handle read-only /boot #712

Merged

Conversation

HarryMichal
Copy link
Member

CoreOS recently made /boot read-only[0]. This caused an issue with starting containers because /boot was mounted only with option rslave but missed the ro option. This caused a permission issue.

This scenario is very similar to the one with /usr on Fedora Silverblue. The solution for this is to check mount options of the path and check if it uses the rw option or ro and then add it to the mount options in the --volume option in 'podman create'.

Fixes: coreos/fedora-coreos-tracker#734

coreos/fedora-coreos-config@1de21ff

Situation on CoreOS

This, sadly, does not fix existing containers on CoreOS because the configuration of existing containers can not be changed. The only way to get this fix is to recreate toolboxes.

@HarryMichal HarryMichal added 6. Minor Change Should not cause breakage 3. Bugfix Fixes a bug 2. Host Realm The issue is related to what happens on the host machine where Toolbox is executed labels Feb 25, 2021
@HarryMichal HarryMichal added this to the Release 0.1.0 milestone Feb 25, 2021
@HarryMichal HarryMichal added 2. Container Configuration Configuration of a container. Mounts, environmental variables, privileges. 6. Requires Toolbx Recreation This will take effect in new Toolbox containers and not in existing ones and removed 2. Host Realm The issue is related to what happens on the host machine where Toolbox is executed labels Feb 25, 2021
@softwarefactory-project-zuul
Copy link

Build succeeded.

@HarryMichal
Copy link
Member Author

In the future, we will likely take inspiration from https://github.com/cgwalters/coretoolbox and instead of cherry-picking parts of the host filesystem mount the whole /. I have a local branch where I already tried this and it seems to work without any refactoring of the code. But let's stick with the current approach until v0.1.0 is out, then we can start experimenting more :).

To explain, this change would allow us to make the code for the create command much more simple and give us more control over the mounts because they could be completely handled by the entry-point.

CoreOS recently made /boot read-only[0]. This caused an issue with
starting containers because /boot was mounted only with option rslave
but missed the ro option. This caused a permission issue.

This scenario is very similar to the one with /usr on Fedora Silverblue.
The solution for this is to check mount options of the path and check if
it uses the rw option or ro and then add it to the mount options in the
--volume option in 'podman create'.

Fixes: coreos/fedora-coreos-tracker#734

[0] coreos/fedora-coreos-config@1de21ff

containers#712
@HarryMichal HarryMichal force-pushed the fix/readonly-boot-coreos branch from c3bd4ce to e61aa47 Compare March 1, 2021 20:46
@softwarefactory-project-zuul
Copy link

Build succeeded.

@HarryMichal HarryMichal merged commit 7ec26a2 into containers:master Mar 1, 2021
@HarryMichal HarryMichal deleted the fix/readonly-boot-coreos branch March 1, 2021 22:31
Copy link
Member

@debarshiray debarshiray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this and getting it merged! One minor observation:

src/cmd/create.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. Container Configuration Configuration of a container. Mounts, environmental variables, privileges. 3. Bugfix Fixes a bug 6. Minor Change Should not cause breakage 6. Requires Toolbx Recreation This will take effect in new Toolbox containers and not in existing ones
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toolbox Error: failed to start container permission denied
2 participants