This script is designed for QubesOS. It makes use of the vm.config
feature to
execute scripts in any type of Qube, even DisposableVMs. The script's content is
configured from dom0
directly. Inspired by this forum
thread.
Naming inspired by a similar AWS EC2 feature. The script accepts plaintext or
base64-encoded input.
- Download
qubes-user-data.service
and copy it over to your TemplateVM(s) - Inside your TemplateVM copy the file to
/etc/systemd/system
- Also inside that VM, execute
sudo systemctl daemon-reload && sudo systemctl enable qubes-user-data
- Shut your TemplateVM down
- Enable the
qubes-user-data
service for your named DispVM (or other VM) through the Qube Manager'sservices
tab - Write a script (one-liners are best due to newline issues) and optionally
encode it with
base64 -w 0 FILENAME
(when base64-encoded you do not have to worry about newlines or special characters) - In
dom0
, executeqvm-features QUBENAME vm-config.user-data ONELINER/BASE64ENCODEDSCRIPT
- Enjoy! Check the status of the script in your DispVM after launching via
sudo systemctl status qubes-user-data
See the qubes-utils repo for links to other utilities I've written for Qubes.
This project is licensed under the AGPL-3.0-or-later.