Skip to content

bwrap: Can't mkdir parents for /run/host/usr: Permission denied #1357

Closed

Description

I've got the error message in the title when I tried to run two flatpaks:

I've installed them from flathub on a 64bit manjaro. Deleting their folders from ~/.var/app doesn't help.

Activity

  1. mwleeds commented on Feb 3, 2018

    @mwleeds
    Contributor

    @trialism Did you build flatpak yourself or use your distro's package?

  2. jvanraaij commented on Nov 14, 2018

    @jvanraaij

    This issue is old, but I ran into the same problem. It seems to be caused by having a symlink in / that points to /, like ln -s / /breakeverything. I replicated this on my rather hacked-together Gentoo install as well as on an updated stock Fedora Workstation 29 VM (flatpak 1.0.5-2.fc29):

    // added flathub via discover, installed org.vim.Vim (though any app does it)
    [testuser@localhost ~]$ flatpak run org.vim.Vim --version | head -n1
    VIM - Vi IMproved 8.1 (2018 May 18, compiled Nov 12 2018 10:22:42)
    [testuser@localhost ~]$ sudo ln -s / /breakeverything
    [testuser@localhost ~]$ flatpak run org.vim.Vim --version | head -n1
    bwrap: Can't mkdir parents for /run/host/usr: Permission denied
    

    If you give your regular user write rights to /run in the host, it appears to succeed at making /run/host inside of the host OS and bwrap will start complaining about being unable to create various "files" that are actually already-existing wayland/systemd/dbus/pulseaudio sockets inside of the host /run. Not sure what's happening there, all I know is that it seems to be breaking things in the host when it should be setting up the namespace.

  3. ppavacic commented on Feb 11, 2020

    @ppavacic

    Same problem on UnityHub. I've accidently ran
    "sudo flatpak run com.unity.UnityHub"

    since then I can't run it without sudo.

  4. mwleeds commented on Feb 11, 2020

    @mwleeds
    Contributor

    Hmm, I guess we can have flatpak run refuse to work as root, but e.g. Kali Linux used to run everything as root, so I wonder if we need a more nuanced check than that.

  5. TingPing commented on Feb 12, 2020

    @TingPing
    Member

    Can check if its ran under sudo (it sets a few env vars), but still allow it ran as root otherwise.

  6. ppavacic commented on Feb 12, 2020

    @ppavacic

    Why not just have warning till it's fixed. "Flatpaks shouldn't be ran as root. Run 'sudo flatpak my.app.id --allow-root' if you want to run it anyway".

  7. RobLoach commented on Feb 12, 2020

    @RobLoach

    Why not....

    "Why not" questions are the worst. It alleviates any ownership, and shifts responsibility.... Why not just fix the whole thing?!

    A better statement would be....

    I believe having a warning until it's fixed could be helpful. Something like "Flatpaks shouldn't be ran as root. Run 'sudo flatpak my.app.id --allow-root' if you want to run it anyway".

    😉

  8. TingPing commented on Feb 12, 2020

    @TingPing
    Member

    I've pushed a commit that handles the sudo case.

  9. asmexcaliburwoods commented on Jun 21, 2021

    @asmexcaliburwoods

    Regarding #1357 (comment) - there is an obvious workaround of deleting that symlink:

    • I had /ROOT symlink pointing to /;
    • I deleted it (rm -v /ROOT)
    • Flatpak now works like a charm!
  10. 23 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions