Skip to content

RFE: add --hostname option (requires --unshare-uts) #10

Open

Description

@plaimbock

Neat project, thanks! Would it be possible to add bwrap's "--hostname" option? I like to set it to 'sandbox' so that its clear that the env is bubblewrapped. Setting the --hostname option requires --unshare-uts.

Activity

  1. jcoffland commented on Aug 27, 2026

    @jcoffland
    Member

    Good idea. What I've been doing is setting PS1 in .bashrc.

    export PS1="($SANDBOX) $PS1"
    
  2. jcoffland commented on Aug 27, 2026

    @jcoffland
    Member

    sbx actually uses the contents of /etc/skel to create sandboxed home dirs. You could add something like this to the end of /etc/skel/.bashrc:

    if [ -n "$SANDBOX" ]; then
      export PS1="($SANDBOX) $PS1"
    if

    This way every sandbox that has a home directory would show its name in the prompt without having to unshare UTS.

  3. plaimbock commented on Aug 27, 2026

    @plaimbock
    Author

    Thank you for your very quick solutions :-) I found another way to do it in global.yml:

    • args: [--clearenv, --unshare-pid, --unshare-uts, --hostname, sandbox]
      That's ugly but it works. --hostname sandbox does not work as it is quoted in the final bwrap command.
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