There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

distrobox question...

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!

somethingsomethingidk ,

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


<span style="color:#323232;">dbxcreate () {
</span><span style="color:#323232;">ALL_CONTAINER_HOME=${HOME}/dbx
</span><span style="color:#323232;">
</span><span style="color:#323232;">CONTAINER_NAME="$1"
</span><span style="color:#323232;">
</span><span style="color:#323232;">export DBX_CONTAINER_CUSTOM_HOME="${ALL_CONTAINER_HOME}/${CONTAINER_NAME}"
</span><span style="color:#323232;">
</span><span style="color:#323232;">distrobox create --name "${CONTAINER_NAME}"
</span><span style="color:#323232;">}
</span>

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

indigomirage OP ,

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!

oh_gosh_its_osh ,
@oh_gosh_its_osh@lemmy.ml avatar

I think what you are looking for is

${DBX_CONTAINER_HOME_PREFIX} or container_home_prefix=…

See also

github.com/89luca89/distrobox/…/distrobox-create#…

indigomirage OP ,

I’ve got that, but I want the container home prefix to be named, dynamically, after the container upon creation as a subdirectory of a container home prefix ‘parent’ directory I’ve already created.

Desired outcome -> All dbxs get homes in a subfolder of ~/dbx in turn, named after the container name I provide upon creation.

So… a container called ‘utility’ would automatically home itself in ~/dbx/utility, and one called ‘archtest’ would go in ~/dbxarchtest, etc.

As it stands, the config gives each container the same home directory (albeit separate from the host, so at least I’ve got that…)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines