Distrobox Permission Denied

No description
33 Replies
Raevenant
RaevenantOP•2w ago
I'm sure there's a simple explaination, I just don't understand distrobox all that well yet
[rust]
image=registry.fedoraproject.org/fedora-toolbox:40
pull=true
replace=true
start_now=true
no_entry=true
# unshare_devsys=true
# unshare_groups=true
# unshare_ipc=true
# unshare_process=true
home=/var/home/nathaniel/Boxes/rust/
init=false
additional_packages="fish"
init_hooks=curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
init_hooks=curl -sS https://starship.rs/install.sh | sh -s -- -y
init_hooks=echo "starship init fish | source" >> ~/.config/fish/config.fish
init_hooks=echo "source \"$HOME/.cargo/env.fish\"" >> ~/.config/fish/config.fish
[rust]
image=registry.fedoraproject.org/fedora-toolbox:40
pull=true
replace=true
start_now=true
no_entry=true
# unshare_devsys=true
# unshare_groups=true
# unshare_ipc=true
# unshare_process=true
home=/var/home/nathaniel/Boxes/rust/
init=false
additional_packages="fish"
init_hooks=curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
init_hooks=curl -sS https://starship.rs/install.sh | sh -s -- -y
init_hooks=echo "starship init fish | source" >> ~/.config/fish/config.fish
init_hooks=echo "source \"$HOME/.cargo/env.fish\"" >> ~/.config/fish/config.fish
I also don't know why .cargo .config .profile, and .rustup are root owned, but it seems to be related and bash also does not have this issue. Only fish for some reason Hey @tulip, you seen this error before?
tulip🌷
tulip🌷•2w ago
seems like selinux is being really mad at you
Raevenant
RaevenantOP•2w ago
Oh huh But it's in my home dir?
tulip🌷
tulip🌷•2w ago
try doing find . -maxdepth 1 > myfiles.txt on your host and on your distrobox then run delta myfiles.txt myfiles-on-distrobox.txt brew install git-delta you'll see what its so mad about
Raevenant
RaevenantOP•2w ago
What's that do?
tulip🌷
tulip🌷•2w ago
gets all your files as a list and saves it to a file then you can compare which ones show up and which ones dont the missing ones on the distrobox file list is what is getting permission denied oooooh @Raevenant
tulip🌷
tulip🌷•2w ago
No description
tulip🌷
tulip🌷•2w ago
something is wrong on ur fish config
tulip🌷
tulip🌷•2w ago
Stack Overflow
Fish Shell: "error: Unable to open universal variable file '/': Per...
I am using the Fish shell (version 3.3.1) on MacOS. Every time I run a command it shows this error multiple times: error: Unable to open universal variable file '/': Permission denied The commands
tulip🌷
tulip🌷•2w ago
try clearing it up then re-add stuff and see what breaks it
Raevenant
RaevenantOP•2w ago
Hmmmmm But it happens I think because the config is root Like, fish works fine if I remove the init_hooks bit
tulip🌷
tulip🌷•2w ago
also highly recommend not putting this stuff on init_hooks
Raevenant
RaevenantOP•2w ago
Oh What instead?
tulip🌷
tulip🌷•2w ago
try making a custom distrobox image with boxkit
Raevenant
RaevenantOP•2w ago
Oh 😂
tulip🌷
tulip🌷•2w ago
then put a Justfile in /usr/share/yourthing/Justfile and some alias for it or something myboxjust then BAM you have the same functionality its just "optional"
Raevenant
RaevenantOP•2w ago
Honestly that works for me lmao a few of the things I want to add need like, API keys n stuff
tulip🌷
tulip🌷•2w ago
i think the thing is that the init_hooks part is being run as root on the container and its making it so your regular user bound to the container doesnt get read access to the fish config
Raevenant
RaevenantOP•2w ago
Yuuuuuup
tulip🌷
tulip🌷•2w ago
or dunno
Raevenant
RaevenantOP•2w ago
I'll give this a shot and get back to you 😄
tulip🌷
tulip🌷•2w ago
just know you cant modify /home on the containerfile
tulip🌷
tulip🌷•2w ago
GitHub
GitHub - tulilirockz/treats: My distroboxes for personal development
My distroboxes for personal development. Contribute to tulilirockz/treats development by creating an account on GitHub.
tulip🌷
tulip🌷•2w ago
was testing out some stuff so its all broken but there you go
Raevenant
RaevenantOP•2w ago
meaning I would still need to do a distrobox assemble create with a modification to the home?
tulip🌷
tulip🌷•2w ago
youd need to do something like putting a justfile in /usr or /etc on the container its better than doing it via an init_hook but its manual, as in you need to run just -f /etc/Justfile to get ur stuff for example
Raevenant
RaevenantOP•2w ago
I'm confused running that inside the container? or as in using just to build the image? just is like make right?
tulip🌷
tulip🌷•2w ago
just whenever you are running the distrobox like on ur host not on the container build
Raevenant
RaevenantOP•2w ago
oh would this replace the normal distrobox commands? i.e. the terminal wouldn't have a dropdown for it?
tulip🌷
tulip🌷•2w ago
i guess you can just put like a script on your $HOME and do whatever you wanna do? it would be like:
distrobox enter mything
# then you run just inside the container to set it up
just -f /etc/justfile
distrobox enter mything
# then you run just inside the container to set it up
just -f /etc/justfile
Raevenant
RaevenantOP•2w ago
oh gotcha. I went through your repo, and it makes sense to me how would you handle needing an API key or secrets in your image deployment?
tulip🌷
tulip🌷•2w ago
i think the same way you'd do that with any other docker image github secrets and maybe a private registry?
Raevenant
RaevenantOP•2w ago
I was a little distracted when I was asking this all before, buy why is it not recommended to do init_hook stuff? (I'm still going to do the custom image approach I think) It looks cleaner

Did you find this page helpful?