fsquillace / junest

The lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro.
GNU General Public License v3.0
2.08k stars 110 forks source link

Using shell installed by junest cannot find executables on host OS #338

Closed jubgjf closed 1 year ago

jubgjf commented 1 year ago

Hi, I'm using junest on a server. The zsh on host OS is too old so I use zsh installed by junest instead. I exec zsh by a tiny shell script:

# JuNest
export PATH=$PATH:~/.junest/usr/bin_wrappers
export PATH=$PATH:~/.local/share/junest/bin

# zsh functions
export FPATH=$FPATH:~/.junest/usr/share/zsh/functions/Calendar:~/.junest/usr/share/zsh/functions/Chpwd:~/.junest/usr/share/zsh/functions/Completion:~/.junest/usr/share/zsh/functions/Exceptions:~/.junest/usr/share/zsh/functions/MIME:~/.junest/usr/share/zsh/functions/Math:~/.junest/usr/share/zsh/functions/Misc:~/.junest/usr/share/zsh/functions/Newuser:~/.junest/usr/share/zsh/functions/Prompts:~/.junest/usr/share/zsh/functions/TCP:~/.junest/usr/share/zsh/functions/VCS_Info:~/.junest/usr/share/zsh/functions/Zftp:~/.junest/usr/share/zsh/functions/Zle

# start zsh
~/.junest/usr/bin_wrappers/zsh -l

But this will cause me to be unable to use the original apps on the host os, and some software requires very complicated configuration (currently the most important are slurm tools such as sinfo/sbatch, but I think there should be others), so I cannot install it in junest.

I can probably guess that this is because zsh knows nothing about the host os, it only knows the environment in junest and the content in /usr/bin is completely different in host os and junest. I tried bash in junest and proot mode, same result.

My question is how to make zsh in junest run apps in host OS.

fsquillace commented 1 year ago

this is a use case not covered by JuNest. It was not designed for such things. However, you could try to bind the host /usr/bin directory such that JuNest can access to it. If you use ns mode, it should be something like: junest ns --backend-args "--bind /usr/bin /usr/bin-host".

/usr/bin-host will contain the host executables.

This may not guarantee it works on all cases though. Closing.