/usr/local/bin not copied from TemplateVMs to TemplateBasedVMs

I placed a script in /usr/local/bin on a TemplateVM. I had expected this to appear in the associated TemplateBasedVMs.

But they don’t. I have tried this from the Fedora30 template and also the Debian10 template.

The script in /usr/local/bin does not appear in the VMs based upon these templates, such as personal, sys-net, sys-firewall, the disposable VMs.

Perhaps I have misunderstood.

Please see https://www.qubes-os.org/doc/templates/#inheritance-and-persistence.

1 Like

Thanks for your post.

I read that page before posting. I don’t think it answers my question.

What is says about /usr/local does not answer my question. It says that after creating the TemplateBasedVM any changes in that TemplateBasedVM will be persistent.

It doesn’t say whether or not subsequent changes in on the TemplateVM in /usr/local get propagated to the child TemplateBasedVMs.

How do I have something in /usr/local on one of the disposable VMs? Surely, it has to come from the TemplateVM?

I expected that files appear in the TemplateBasedVM when you add files to theTemplateVM file system, just like when you add apps to TemplateVMs and they appear in the TemplateBasedVMs.

A TemplateBasedVM’s private storage is mounted at /rw., only /rw is persistent.

/home is persistent because it is the bind-mountpoint for /rw/home. /usr/local is persistent because it is the bind-mountpoint for /rw/usrlocal.

If you want to have custom software in the template show up in TemplatebasedVMs, you can install it in /opt or another place that isn’t treated specially.

1 Like

Great, thanks,

I put my script into /opt on my TemplateVMs. This was successfully propagated into TemplateBasedVMs.

I created a .profile file, adding this path to the path for logged in users, and placed this in /etc/skel. This is successfully propagated into TemplateBasedVMs, including disposable VMs.

It is a simple script to tell me which IP address a terminal is logged into:

IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
LOCATION=$(geoiplookup $IP)

echo "Public IP address [$IP] $LOCATION"

I would like to have it change the gnome terminal title, but that turns out to be a bit of drama.

Please follow up this new issue on a separate post so each topic. But it seems like it may not be qubes-specific. By looking at how to solve this on linux in general, you may find your answer.

1 Like