Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passthrough some directory under /home #331

Closed
Fatmice opened this issue Nov 15, 2019 · 12 comments
Closed

Passthrough some directory under /home #331

Fatmice opened this issue Nov 15, 2019 · 12 comments

Comments

@Fatmice
Copy link

Fatmice commented Nov 15, 2019

I would like to passthrough a directory under /home to the container. How do I go about doing this? Is there some config files that I can edit for each container?

@maxwell-k
Copy link

maxwell-k commented Nov 15, 2019

Did you check in /var/run/host/var/home? On Fedora Silverblue 30 this contains the home directory.

@Fatmice
Copy link
Author

Fatmice commented Nov 15, 2019

I'm on Fedora 31, the path /var/run/host/var/home is not found. There are various things under /var/run/host/var but not the home directory. I have intel compiler installed under /home/intel and to use it normally one must source the file psxevars.sh when lauching a shell, which is located under /home/intel/parallel_studio_xe__/

@maxwell-k
Copy link

Sorry I am a version behind, all I can suggest is having a look around in /var/run/host. From the docs I still think /home should be a symlink to /var/home; but I can't test at the moment. Good luck.

@debarshiray
Copy link
Member

debarshiray commented Nov 19, 2019

The definition of /home depends on whether you are on Silverblue or not. On Silverblue /home is a symbolic link to /var.

Containers created with recent versions of Toolbox make the host's /var available at /run/host/var inside the container. So, if you use /var/intel on the host, instead of /home/intel, then what @maxwell-k suggested should work.

@markstos
Copy link

This relates to #183, which is a feature request not mount /home by default and instead support mounting just specific directories in the container.

@debarshiray
Copy link
Member

I am tentatively closing this based on the idea of using /var/intel instead of /home/intel.

@Fatmice
Copy link
Author

Fatmice commented Jan 11, 2020

Sorry, but I disagree with that notion. /var should not be a dumping place for programs and tool-chains...And honestly, I should get to decide where I want to put my tool-chains...They were installed to /home, many years ago before I came to use podman or toolbox. Normally, I would have opted to put them under /opt but did not due to partition layout.

@markstos
Copy link

@Fatmice One of Red Hat's own developers suggested that there be an option to add additional mount points under / on Silverblue over a year ago, but the idea was never acted on:

coreos/rpm-ostree#1711

I gave up and moved on to Arch Linux. Silverblue is too inflexible and a key issue like this is seeing little progress. Maybe in another couple years I'll check back in and see what progress there's been.

Maybe there's merit to having just one r/w partition and have that be named "/var", but there are multiple decades of software built on the assumption that "/home" physically exists.

For Silverblue to gain traction faster it seems prudent to support some kind of transition or compatibility solution where other mount points can be supported, as one their own team members suggested.

@Fatmice
Copy link
Author

Fatmice commented Jan 13, 2020

@markstos I personally do not mind if there is only one r/w partition and it must be /var but at least allow mounting something else read-only, like /home/intel... Or at least someway to pass an abitrary link through that's read-only. I could maybe understand why they find this slippery as it might somehow introduces backdoors where one could escape, but then again I don't think that alone should make this thing so limiting.

@debarshiray debarshiray closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2022
@debarshiray
Copy link
Member

Containers created with recent versions of Toolbox make the host's
/var available at /run/host/var inside the container.

Even more recent versions of Toolbx (newer than 0.0.99.3, to be precise) make the entire / from the host available at /run/host. So, containers created with Toolbx >= 0.0.99.3 will have /run/host/home regardless of whether it's Fedora Silverblue or Workstation.

@Fatmice
Copy link
Author

Fatmice commented Aug 6, 2022

This is very good to hear

@markstos
Copy link

markstos commented Aug 8, 2022

Even more recent versions of Toolbx (newer than 0.0.99.3, to be precise) make the entire / from the host available at /run/host.

Where is this document? I don't see it in the main README or in the docs for the create command:

https://github.com/containers/toolbox/blob/main/doc/toolbox-create.1.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants