I'm looking for a reasonable way to forward ports from a host machine to a NixOps VM using the libvirt backend. It seems the de-facto way to forward ports with libvirt is using iptables, but that requires changes to the host's configuration.nix and doesn't allow NixOps to manage the port forwards. There is a somewhat hacky way to do this with virtualbox (see #734). One solution might be to use a qemu:commandline block as in:
Hey all,
I'm looking for a reasonable way to forward ports from a host machine to a NixOps VM using the libvirt backend. It seems the de-facto way to forward ports with libvirt is using iptables, but that requires changes to the host's configuration.nix and doesn't allow NixOps to manage the port forwards. There is a somewhat hacky way to do this with virtualbox (see #734). One solution might be to use a qemu:commandline block as in:
but that requires adding the qemu namespace to the generate XML file, which isn't currently supported.
Does anyone have an existing solution for this?
Thanks!