containers / containers/toolbox
/home inside toolbox should not be symlink even though outside ostree has it linked to /var/home
- Dominant language
- Go
- Stars
- 3.5k
- Forks
- 262
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 1
Description
I am using Kinoite (fully updated). Which has /home symlinked to /var/home. When I create a default toolbox, hence Fedora based, inside the toolbox /home is still symlinked to /var/home. Some software doesn't like symlinked /home. In my case, I was testing firejail within the toolbox, which does its own mounting over /home, and so expects /home to be a directory.
My attempted solution, which failed, was to rm /home, replace it with a dir to the user's home, and mount /var/home/user over that within the toolbox:
```
toolbox enter
sudo rm /home
sudo mkdir -p /home/user
sudo mount -B /var/home/user /home/user
```
This worked up until I rebooted the Kinoite machine and tried re-entering the toolbox. What happened is that the mount I set up persisted until I rebooted, then vanished and the toolbox was left with a vacant /home/user. At which point I got the following error:
```
Error: invalid entry point PID of container fedora-toolbox-36
```
and no way to re-enter the toolbox. I had to toss the toolbox and start over. I didn't expect such a bad result from an empty /home/user dir, but I guess toolbox was expecting something to be there?
So, my request is for a way around this problem. I think somehow toolbox itself should be responsible for arranging the internal / hierarchy to not look ostree-based with symlinks. After all, there probably is other software that people would like to use within a toolbox that expects a standard / hierarchy without symlinks.
Short of that (or until that happens), I have other ideas: maybe I need to setup something like /etc/rc.local within the toolbox to repair the mount? Would setting up /etc/fstab to do the mount within the toolbox work? I can't find any documentation on what happens on entrance into a toolbox. Anyone know what might work?
Contributor guide
Research direction
Start by reproducing the behavior with `toolbox enter` on a Kinoite host and inspect what happens to `/home` and `/var/home` after reboot. Compare the requested alternatives involving `/etc/rc.local` and `/etc/fstab`; done means a toolbox can be re-entered reliably while software that expects `/home` to be a directory works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100