Qubes User Data - utilize `vm.config` to execute scripts at Qube launch, even in DispVMs

Thank you for @ddevz for the inspiration to write this tiny, general-purpose utility!

This script is a more “generic” version of what is presented in this thread: Customize a named disposable using the vm-config feature

It allows you to add any* script to any VM (including DispVMs) and have it executed at every start. The script can be plaintext or base64-encoded, like in AWS EC2 user-data.

More information here: GitHub - Atrate/qubes-user-data: Execute dom0-configured scripts in Disposable VMs (and other VMs) in QubesOS

* Unsure if there’s length limits, but that’s quite possible.

3 Likes

On my dom0, the bash command-line length limit is:

[user@dom0 ~]$ getconf ARG_MAX
2097152

… which is exactly 2 Mib. You have to deduct another 20-30 bytes for the rest of the command-line, but all in all, that is AMPLE space for your startup script! :smile:

Edit: there may be other, more stringent, restrictions for the qvm-features command :thinking:

You could compress the args and uncompress before use :melting_face:

Yeah, well … I was thinking about the command-line used by qvm-features to store the script (see the git repo) :
qvm-features QUBENAME vm-config.user-data ONELINER/BASE64ENCODEDSCRIPT

And the base64 encoded script is not compressible while staying command-line friendly.