-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Wed, Aug 10, 2016 at 05:29:59PM -0700,
nekroze...@gmail.com wrote:
> Hi All,
>
> I have been experimenting with using salt to configure a full Qubes system with standalone vms running docker for development and automated setup of a kali template based off of the debian template based on the procedure in the docs.
>
> In my trials (mostly wins) I have found a few issues and also just missing parts that make management difficult.
>
> After I finish a run (or two) of "qubesctl --all state.highstate" using my qubes salt configuration (
https://github.com/Nekroze/qubes-salt) I can no longer update dom0 or send files from one VM to another (other then from dom0 out to a vm) as I just get the error:
>
> Data vchan connection failed
Hmm, that's strange. I use salt regularly to update all the templates at
once and haven't noticed anything like this.
Do you see any not cleaned up VMs after that? Like
`disp-mgmt-something`.
Or maybe there are too many not cleaned up xenstore entries, like here:
https://github.com/QubesOS/qubes-issues/issues/1390 (check with
`xenstore-ls`)?
> I have not been able to find any information on common causes for this error, the best I can find while searching is the source code that prints the error. I've tried disabling a bunch of the tops to reduce what is changing but it just keeps happening. This is the 4th time I have re-installed qubes 3.2-rc2 because of this error when trying to use salt. I am unsure as to what information is required for this kind of error hence reporting here before I start an issue on github, any advice on logs to provide or steps to try would be welcome.
If above ideas are not helpful, try to log `strace -f` output on all related
processes - especially the one producing the message.
> There are also a handful of other problems smaller problems I have encountered while trying to configure everything I need with salt. For example the fedora-23-minimal templates are unmanageable via salt, all of the internal VM salt configuration just doesn't work on on them from my experiments.
It may be that salt requires some additional packages to preform its
actions. Minimal template have really minimal package set installed.
But you probably can install additional stuff using pkg.installed.
Yes, it may require calling `qubesctl --all state.highstate` twice.
> Additionally it seems that package management control over dom0 fails when sys-whonix is the updateVM, this forces all salt updates over sys-firewall for setup and it seems updating Whonix templates this way presents an error (that they are not running with a whonix-gw based netVM) as they are included in states that affect all templates.
This looks like two totally separate issues:
1. dom0 package management when UpdateVM is set to Debian-based VM
2. Whonix templates updates
The first one indeed may be the case, because Debian have much older
version of yum, which lack many functionalities required to execute some
actions, specially --downloadonly option. In practice, only basic
package installation/upgrade is supported, but not things like querying
repository. Also in some cases dependency resolution may fail
(especially in case of "Obsoletes: ...").
In any case, if you put Fedora-based VM behind sys-whonix, and set it as
UpdateVM, it should work.
The second issue looks like you misconfigured whonix templates - if
you set its netvm to sys-whonix (or any other whonix-gw based proxyvm)
it should just work. Take a look here:
https://github.com/QubesOS/qubes-mgmt-salt-dom0-virtual-machines/blob/master/qvm/sys-whonix.sls
> Sadly due to the previously mentioned vchan issue I am unable to grab the exact error message at the moment but I will try and get it later today when I might have time to do another re-install.
>
> Its great when everything goes well but when there is an issue there is no summary from the VM's configuration changes like dom0 has. At best it would be nice to see things like the versions that changed in the VM's when an update works, but when something goes wrong, not having this means I have to step through the procedure to find out what failed which means I have to do it manually anyways. This seems to happen even when qubesctl says the vm was OK but I find the a package was not installed at all and must have errored, again doing it manually I was able to see the error and resolve a trivial cache issue preventing the install.
The output is logged to /var/log/qubes/mgmt-*.log. Also take a look at
- --show-output option.
Unfortunately in some cases salt exit with code "0", even when some
errors were encountered. This will lead to false "OK" reporting...
> When using the qvm.create state, it is clear from using Qubes for a bit that it maps to the similarly named cli tool however preferences specified in the qvm.create state, being only run if the vm exists at all, require secondary qvm.prefs of the same or similar preferences to ensure that those states remain the same. From my understanding part of configuration management like this is not just to provision but to ensure the configuration conforms to the state specifications, this just feels very clumsy to have to do twice, perhaps templating can help here but I am just starting the make a dent in learning how to use templating for salt.
Take a look at documentation here:
https://github.com/QubesOS/qubes-mgmt-salt-dom0-qvm/blob/master/README.rst
Especially at "qvm.vm" wrapper.
Configuration in default states (
qvm.work, qvm.personal etc)
specifically use templates[1] ("load" function defined there) to not
override/remove user modified VMs. But you don't need to use this
template in your configuration. In fact not using it will make it
slightly easier to read. Like here:
https://gist.github.com/marmarek/29f9a4a1f3a7a457cf2b449ab0b0e2f4
> There are some aspects of configuring the dom0 experience in Qubes that does not seem to be possible from salt. For example there is no way to specify which applications are available in the menu for an appVM,
Indeed there is no module for this, but you can simply edit
`whitelisted-appmenus.list` file in the VM directory with file.managed.
Then appmenus regeneration will be triggered at nearest template
upgrade, which will probably happen a moment later anyway (as dom0 is
configured before all the VMs).
> From what I can see no way to toggle the dynamic memory management switch from salt,
Its "meminfo-writer" service (qvm.service).
> nor a way to add firewall rules to the Qubes manager firewall list via states.
That's true...
Hmm, on the other hand, you can edit firewall.xml (file.managed), or
call `qvm-firewall` (cmd.run). Those are really only workarounds, but
may be enough for you for now.
There are almost zero chance that we'll manage to improve this in the
next version, as there are already a lot other tasks scheduled. But if
you could provide at least some design of the state arguments, that
would be helpful. It would be even better if you could implement this ;)
BTW do you know a salt module for editing XML files - just like
file.line or so? It would be really useful for configuring some desktop
environment settings - almost all Xfce configuration is in XML files...
> There are great tools for provisioning the cluster of VM's but it doesn't tie into the user experience for Qubes requiring more manual configuration.
>
> I would like to formalize these into issues on GitHub but just wanted to discuss if there was more information I need or some issues are already resolved in the next version. I am unsure as to which way I should split these into issues if at all and would appreciate any advice.
Please split every actionable item into separate issue. There are very
few more annoying things than "almost closed issues".
But please keep in mind our top priority is making Qubes OS as secure as
possible, which in practice means our focus is now on this:
https://github.com/QubesOS/qubes-issues/issues/2185
We'll be very grateful for any help with all the other stuff (including
improving mgmt stack).
> All in all though, the salt stuff is great when it works but the missing or broken parts make it hard to justify at present. My apologies for the long post.
Thanks for detailed feedback!
[1]
https://github.com/QubesOS/qubes-mgmt-salt-dom0-virtual-machines/blob/master/qvm/template.jinja
- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJXq9iPAAoJENuP0xzK19csJ5AH/25YJH64EsSMqxFfnJ+V9LmZ
fK3V+Q7+B7LdGT6cm81JKwFB8ngAmhkLjjR2hcNmEuFofQ+pJFFYZCsa6Q6dlqiq
ZiCti28BhReL1NQ0By8b1QSssXryudHfsVKTdxVskbnzbvP962MHJKBkyTx0WtRf
q+Sa4TUMTlkRiy/wkHVci69i2BNwTOL8Sq1xrKEOio6zSl/jzF70zUVseYMzOJYM
LLbMyN+l7UqEiurb2e9DdVqzUoE6PLMb8pQl17Fhe8u1ZG//GdsRb+vP0HqkF+9P
fbon7236LimLMTOXP1JRleq37ybbypR7bZikcQABwTiJCozHvu0gOzT2JZR6xAs=
=5xkZ
-----END PGP SIGNATURE-----