-
Notifications
You must be signed in to change notification settings - Fork 12
Improve flk vm
(bash script)
#9
Comments
Maybe we could ask @zimbatm for a friendly review of https://github.com/divnix/digga/blob/develop/src/pkgs-lib/shell/flk.sh. zimbatm by definition (with |
looks good, I like how simple the script is |
We should also be able to choose how much resources we put for the vm, now it is static (I didn't check how much memory and cpu there is but I think not much). It makes it unusable to test out a plasma based setup :/ |
I happen to do a refactoring of the testing framwork in nixpkgs and as a result am currently familiar with the qemu instrumentation. The thing you could have a look at is At the end it receives a A couple of lines back, cores and memory are already defined, so I'd hope later flags would peacefully override them. (Hoping only) If my hope is in vain, I'd argue that this might be something that needs to be addressed upstream (it doesn't appear to be an exotic use case to run a vm with different ram settings during runtime). So we could run the vm with something If that dynamic is not needed it might suffice to put |
Thanks for the help @blaggacao! #!/usr/bin/env bash
set -euo pipefail
export QEMU_OPTS="-m 4G -smp 8"
../devos/digga/src/pkgs-lib/shell/flk.sh vm run NixOS the last line is because I am using my local develop digga repository so that I have For reference in case someone stumbles upon this issue later, here is a script that should work for anyone on devos if put at the root of devos and if the #!/usr/bin/env bash
set -euo pipefail
export QEMU_OPTS="-m 4G -smp 8" # Here you change the memory (-m) and the number of cores (-smp)
flk vm run NixOS # Here you change the HOST you want to run These options could most probably be added to the |
also one can add |
@blaggacao my method is not enough and I happen to notice that in the file you linked, there are some options: |
This seems to be relevant: |
I guess it's: {
config.virtualization = {
memorySize = 1024;
cores = 4;
};
} Didn't find from my cel phone where those options are defined. |
well no it's not as simple as to put it in the config of the host 🤔 |
Well, it is actually possible to use the options as is but you have to check if you are in a vm or not, that was the missing thing! virtualisation = {
kvmgt.enable = true;
libvirtd.enable = true;
docker.enable = true;
} //
(lib.optionalAttrs (builtins.hasAttr "qemu" options.virtualisation) {
memorySize = 16 * 1024;
msize = 16 * 1024;
cores = 8;
qemu = {
options = [ "-vga virtio" ];
};
}); so here I set my normal virtualisation options for my host and if we are in a vm, then some other options are added on top. |
@Narice Do we still want to pursue this or could we close it in the meanwhile and re-open once the underlaying need regains momentum? |
Yes if someone has an issue with the current implementation, they should open an issue ;) |
This is a tracking issue for incremental change propositions that were brought up in pull request divnix/digga#41.
Here are the different possible changes that were brought up:
The text was updated successfully, but these errors were encountered: