I was wondering if there is a known way or potential quick hack to get incus to match the project name agains the unix account that created it? Please see the picture below… for my usecase, since every unix account created on my platform is guaranteed to be unique - it would be ideal if the incus project that gets created when that user first enters an incus command matched the username. So, instead of “project-1000” as the project name, it would just be “james” as the project name.
I guess i could script the project name change after creation, but was hoping for something a little cleaner. Thanks!
ah… actually i don’t think its possible to change project name after creation, so that option is out. That said, if there is still a hacky way to rename just the project name itself, i don’t care about networks or devices maintaining the old format. Ideally theres a way to hook into the project creation event and just have it pass the unix account name at that point (prior to creation) instead.
It’s not very clear to me what exactly you want to achieve.
If you want all instances for a specific user to go into a specific Incus project, then it’s a one-shot command that would run upon login. Like, adding a few lines in ~/.bashrc that checks if there’s an Incus project with name $USER, and if not, create it and switch to it. The current project is stored in ~/.config/incus/config.yaml. You just need to set it once if you do not plan to switch back and forth.
If you want something else, have a look at incus alias. These are command aliases for the Incus CLI tool.
Thanks for responding… let me try to clarify: I’m already taking advantage of the dynamic incus project creation happening when adding a unix account to the incus group (detailed at the bottom of this page: How to confine projects to specific users - Incus documentation)
I’m asking if there is a known way to FORCE convert the actual incus project name created to match the unix account name that the project has been created for.
Currently, it seems incus projects created in this way follow a naming convention of user-1000, user-2000, ect in sequential order. I’m saying, if the unix account username is “James” or “simostheninja100” - I’m wanting the incus project names created with those users (who would first be added to the incus group) to match. So instead of project name “user-1000” and “user-2000” I would add the unix account user “simostheninja100” to the incus group and then when the incus project gets created, that project name would also be “simostheninja100”.