How are you writing/testing scripts for dom0?

I’m finding it a bit cumbersome to write scripts in a VM, then copy them to dom0 each time I want to test the script.

I could code direct in dom0 using nano, but that takes away most the functionality of a code editor like Visual Studio Code. I don’t think it would be wise to install Visual Studio Code in dome0.

Other than nano, what else are you using to write/edit scripts that run in dom0? Whats your process to code/test efficiently for dom0?

One approach:

Open an editor in your work VM. Draft a script and save it. When you are ready to test, open a dom0 terminal and use:

qvm-run --pass-io work 'cat /path/to/file-name-in-work-VM' > /path/to/file-name-in-dom0

Subsequent drafts & tests… just save and run the same command.

[edit: never mind… I just released I completely misread the original post]

emacs (or vim?) has syntax highlighting, is available from the dom0 repos (if not pre-installed).


I’m happy using vim in dom0, as I using only vim most of the time anyway.

Sure, it is not helps, but you asked how we do it :wink:
That’s how I doing it.

Using vi in dom0, but also run shellcheck before execution.

Since I do a lot of custom lvm scripting: If any part is (or could be) non-reversible/damaging, I’ll model that part in a domU script first, installing any packages I need first, then move it to dom0.