Host can't see folder created inside toolbox

I have installed linuxbrew inside toolbox.
# /bin/bash -c "$(curl -fsSL".
After that it created a folder in /home/linuxbrew.
Now I can’t see the /home/linuxbrew folder from host file manager at /var/home. I can only access it from inside of toolbox. Any solution? How do I access /home/linuxbrew folder from host?
I am using Silverblue 37.

Toolbox creates a container, with its own view of the filesystem. Files and directories created in that container are not visible to the host unless they are created in a directory mounted from the host into the container.

Toolbox exposes a certain set of directories from the host ↔ toolbox. Aside from various system directories, it’s really only your home directory which is exposed/shared with the toolbox environment.

As far as I know, there’s no way to modify these set of shared directories, so there’s no way to add /home/linuxbrew. There are a couple options though:

  1. You could modify the Homebrew installation so that the prefix is not /home/linuxbrew, but a directory within your own home directory. However, it comes with some risks in that Homebrew expects the default prefix for some things and it may not work as expected for everything.

  2. Toolbox is sort of like a wrapper for Podman. You can create your own Podman container to install Homebrew, which you can expose the /home/linuxbrew directory to be shared between the host and container. The caveat here is that you lose some of the niceties that Toolbox takes care of for you; you’d have to manually configure all the options for your container.

Realistically though if your goal is to use Homebrew on the host system to install and update software, you should just install it on the host system and not mess with any containers at all. If you use a container to install Homebrew itself, you’ll also have to perform all future ‘brew’ operations inside that same container, even if you end up running the installed software outside the container. It will be a bit messy.

For the most part I agree. I’m not a user of Homebrew so I don’t know all the intricacies, but I think one benefit of running Homebrew inside a container would be to segregate all the build tools, and not have to install those on the host system. Once the packages are built, they’ll be written to the Homebrew prefix bin directory. One would just need to add that bin directory to the user’s PATH (on the host) to have access to those packages outside the container.

Though I don’t know how Homebrew handles package dependencies. There’s a chance that the packages within the container contain different versions from the host. If Homebrew brings in all of its own dependencies that might be fine, but I suspect it relies on some of the dependencies of the “host” environment. Here the “host” could be within the container or outside. But Homebrew would only know about packages inside the container, so there might be issues with conflicts with packages outside it when it’s not run in the container.

So yeah, it could get messy.

I tried to install homebrew in host system. It requires perl and other dependencies. So, I thought it’s not worth it to install it on the system.
My goal was to install homebrew inside toolbox. So, that I can access few tools like htop, ncdu from the system without layering.

Those are already in the Fedora repos, so you can run dnf install htop ncdu within toolbox to run them without resorting to Homebrew.

You can run them from “outside” the toolbox by running e.g. toolbox run htop

Caveat with ncdu is that programs that are in a container can’t access the entire host file system. So there may be places you can’t use it. It’ll work just fine for your home directory though.

what would be the podman command to achieve that?