Hi There - I’m starting to make use of distrobox, but I have a question about creating custom home directories.

In my ~/.config/distrobox/distrobox.conf file, I’ve added a line ->

container_user_custom_home=“$HOME/dbx”

This ensures that all new containers, by default, have their homes set to ~/dbx .

This is good, however, I’m looking for a way to default new container homes to ~/dbx/<<containername>>. Is there a way to do this? I’ve tried setting the line in distrobox.conf to

container_user_custom_home=“$HOME/dbx/$DBX_CONTAINER_NAME” but it doesn’t work. Any help would be appreciated.

(Basically, I want to err on the side of a bit of isolation between containers by default so that I can more easily track what each is doing separately.

Thanks!

You are viewing a single thread.
View all comments
6 points
*

I would make a bash function to do this. I’m on my phone so idk how this will look lol

dbxcreate () {
ALL_CONTAINER_HOME=${HOME}/dbx

CONTAINER_NAME="$1"

export DBX_CONTAINER_CUSTOM_HOME="${ALL_CONTAINER_HOME}/${CONTAINER_NAME}"

distrobox create --name "${CONTAINER_NAME}"
}

I would add some checks/more arguments and error messages but thats the idea

You may also have to make that home dir but then its as easy adding a mkdir line

permalink
report
reply
2 points

Thank you - it seems that this will only be possible with a wrapper script (which was going to be my next course of action). I can definitely use what you’ve written here as an accelerator, though!

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 8.3K

    Monthly active users

  • 6.3K

    Posts

  • 173K

    Comments