6

I'm trying to use flatpak enter to enter a sandboxed Steam client. To get a PID or instance ID I do like so:

$ flatpak ps
Instance   PID  Application             Runtime
2581746118 4294 com.valvesoftware.Steam org.freedesktop.Platform

However, doing flatpak enter as root doesn't work:

# flatpak enter 4294 bash
error: 4294 is neither a pid nor an application or instance ID
# flatpak enter 2581746118 bash
error: 2581746118 is neither a pid nor an application or instance ID
# flatpak enter com.valvesoftware.Steam bash
error: com.valvesoftware.Steam is neither a pid nor an application or instance ID

Also, using tab completion after flatpak enter only shows command line options, rather than any argument to enter.

1
7

The problem is you need to be root to use flatpak enter because it requires entering various container namespaces. What makes that more complex is that sudo changes environment variables making flatpak unaware of your application instances.

That results in this rather non-obvious usage:

sudo -E flatpak enter instance-id /bin/bash
1
  • Thanks. If you have sudoers whitelist environmental variables you just need to whitelist XDG_RUNTIME_DIR instead of passing -E to sudo. Mar 5 '19 at 19:22
2

I don't want to do it the jQuery way™, but as this, currently (at the beginning of the 2020s), still seems to be an unresolved problem, this should solve most use cases:

$ flatpak run --command=/bin/bash fake.application.Identity

It does not need root, it does not need workarounds.

I don't really know what the difference to flatpak enter is. Okay, the difference is, it spawns a new "instance", so you cannot directly interact with the other processes in the running flatpak. But as you likely just want to try out the sandbox or investigate some files or so inside of the sandbox, that should be fine™.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.