Private.img not following through from templates

/etc/skel is a Linux mechanism to populate new /home directories. If you put something into the /etc/skel of the template it will be in the /home/user directory of any newly created qube that is based on that template.

The copy takes place at the time the qube is created. If you change it in the template after the qube was created it has no effect.

This works perfectly. I use it with all my templates to put GTK config files and custom scripts in place.

1 Like

Strictly speaking, the copy from /etc/skel on the ‘root’ volume to e.g. /home/user on the ‘private’ volume happens when the qube is booted up for the first time, as part of the systemd qubes-mount-dirs.service started inside the qube.

4 Likes

I can confirm this. If you do things in the following sequence, it works. (And I apologize if this is too much detail for @AWhite, but it might benefit others.)

Copy files to /etc/skel in the template.

Then, create a new appvm (and it can be either a “regular” appvm or a dvm template) based on the template.

The /home/user directory of the appvm will have your files set up analogously to where they were in /etc/skel. In other words if you put file “foo” in /etc/skel/bin (i.e., the path is /etc/skel/bin/foo) then it will end up in /home/user/bin/foo.

But the key thing is the appvm must be created (not just run, but created) after you put your files in /etc/skel. So if you already have an appvm with a bunch of data in that directory, you’ll have to back it up somewhere, delete and recreate the appvm, and copy your data back to the new appvm. [Edit to add: This is true even if the appvm is a disposable template. Just running a new disposable off the dvm template is not sufficient; the dvm template itself must be re-created.]

One advantage to using disposables is that you never really have any hassle with recreating the disposable templates, because there’s no data accumulating in the AppVM (the one that is the disposable template) that you have to worry about saving. Very rarely do you need to set things up in the disposable template, since almost all setup is done in the “real” template itself.

5 Likes

Well, skel directory isn’t working unfortunately.

The lack of detail here is extremely unhelpful.
What template did you use?
What files did you place in /etc/skel in the template?
What steps did you take in creating the template based qube?

Since use of /etc/skel works for a number of other users it would be
helpful to understand why it does not work for you.

Affected all templates.
I put a file into the skel folder, and none of the virtually had that file in it.

I don’t know why a lot of things don’t work, or why they were completely removed and not just left as an option instead of just being removed…

What extra detail do you want?
Maybe asking question or two may get the details you seek as I have no idea what you are looking for?

Hope that you can help Add you always seem to be able to.

Are you talking about already existing VMs or about newly created ones as well?
Files from /etc/skel will be copied into the /home directory only on VM creation:

Just the new ones… I start with bland installation.

It works for me on Qubes OS 4.2:

  • open debian-12 template
  • create file in /etc/skel:
    sudo touch /etc/skel/test
  • shutdown debian-12 template
  • create new appvm based on debian-12 template
  • open newly created appvm and check if the test file exists:
user@testqube:~$ ls -la /home/user/test 
-rw-r--r-- 1 user user 0 Nov 18 06:23 /home/user/test

Okay, so now or makes sense.
So there is no global skeleton folder, even though that is what I was led to believe because that is what I was asking for and was told to use the skel folder, so I did…

But now you are saying it is inside each template, so why is the private image stopped cloning over but the skeleton working?

That makes no sense for that decision by some 12 year old child to make…

But such as life.

Thanks for that Appar.

I am not sure what your objection is, so I’ll list some facts in the hopes that one of them is relevant.

When you clone a template, you make an exact copy of it (but with a new name, obviously). From that point forward, they’re independent of each other. If you make a change in the original template, it will not appear in the copy. If you make a change in the copy, it will not appear in the original.

When you create an AppVM (including disposable templates), /etc/skel on the template is copied into /home/user on the AppVM. It will not be done again; if you change /etc/skel on the template you must either manually do the copying on your AppVM, or delete it and recreate the AppVM. (This is true if the AppVM is a disposable template, too.) [It is also possible if you were to create a new user account on the AppVM, it would copy, but I’ve never tried to do that and am not even sure it would work well in a Qubes context.]

One other thing to note: /home/user on the template doesn’t appear on the AppVM, they’re different things. Or to put it another way, if you put a file in /home/user on the template, it will NOT appear in /home/user on the appvm, not even if you delete and recreate the AppVM.

2 Likes