OOKNET                             [ /  search the index  ]  
──────────────────────────────────────────────────────────────────────────────────────
══════════════════════════════════════════════════════════════════════════════════════
OOKNET   [ /  search  ]  
────────────────────────────────────────────────
════════════════════════════════════════════════
 
HASH      c7b3d86f92fb
DATE      2025-05-09
SUBJECT   virtualization: configure qemu, modify test-vm script
FILES     6 CHANGED
HASH      c7b3d86f92fb
DATE      2025-05-09
SUBJECT   virtualization: configure qemu, modify
          test-vm script
FILES     6 CHANGED
 

diff --git a/hosts/ooksdesk/default.nix b/hosts/ooksdesk/default.nix
index b54a346..1807fb2 100644
--- a/hosts/ooksdesk/default.nix
+++ b/hosts/ooksdesk/default.nix
@@ -38,6 +38,7 @@
     };
     virtualization = {
       host = {
+        enable = true;
         ooknet-install-vm.enable = true;
         virt-manager.enable = true;
       };

diff --git a/hosts/ooksdesk/default.nix b/ho
sts/ooksdesk/default.nix
index b54a346..1807fb2 100644
--- a/hosts/ooksdesk/default.nix
+++ b/hosts/ooksdesk/default.nix
@@ -38,6 +38,7 @@
     };
     virtualization = {
       host = {
+        enable = true;
         ooknet-install-vm.enable = true;
         virt-manager.enable = true;
       };
 

diff --git a/modules/nixos/server/profiles/ookstest/hardware.nix b/modules/nixos/s
erver/profiles/ookstest/hardware.nix
new file mode 100644
index 0000000..f9c2647
--- /dev/null
+++ b/modules/nixos/server/profiles/ookstest/hardware.nix
@@ -0,0 +1,24 @@
+# Do not modify this file!  It was generated by 'nixos-generate-config'
+# and may be overwritten by future invocations.  Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+  imports =
+    [ (modulesPath + "/profiles/qemu-guest.nix")
+    ];
+
+  boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" 
"virtio_blk" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ "kvm-amd" ];
+  boot.extraModulePackages = [ ];
+
+  # Enables DHCP on each ethernet and wireless interface. In case of scripted net
working
+  # (the default) this is the recommended approach. When using systemd-networkd i
t's
+  # still possible to use this option, but it's recommended to use it in conjunct
ion
+  # with explicit per-interface declarations with `networking.interfaces.<interfa
ce>.useDHCP`.
+  networking.useDHCP = lib.mkDefault true;
+  # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
+
+  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+}

diff --git a/modules/nixos/server/profiles/o
okstest/hardware.nix b/modules/nixos/server/
profiles/ookstest/hardware.nix
new file mode 100644
index 0000000..f9c2647
--- /dev/null
+++ b/modules/nixos/server/profiles/ookstest
/hardware.nix
@@ -0,0 +1,24 @@
+# Do not modify this file!  It was generate
d by 'nixos-generate-config'
+# and may be overwritten by future invocati
ons.  Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+  imports =
+    [ (modulesPath + "/profiles/qemu-guest.
nix")
+    ];
+
+  boot.initrd.availableKernelModules = [ "a
hci" "xhci_pci" "virtio_pci" "sr_mod" "virti
o_blk" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ "kvm-amd" ];
+  boot.extraModulePackages = [ ];
+
+  # Enables DHCP on each ethernet and wirel
ess interface. In case of scripted networkin
g
+  # (the default) this is the recommended a
pproach. When using systemd-networkd it's
+  # still possible to use this option, but 
it's recommended to use it in conjunction
+  # with explicit per-interface declaration
s with `networking.interfaces.<interface>.us
eDHCP`.
+  networking.useDHCP = lib.mkDefault true;
+  # networking.interfaces.enp1s0.useDHCP = 
lib.mkDefault true;
+
+  nixpkgs.hostPlatform = lib.mkDefault "x86
_64-linux";
+}
 

diff --git a/modules/nixos/server/profiles/ookstest/qemu.nix b/modules/nixos/serve
r/profiles/ookstest/qemu.nix
index 7d30cac..b9250dd 100644
--- a/modules/nixos/server/profiles/ookstest/qemu.nix
+++ b/modules/nixos/server/profiles/ookstest/qemu.nix
@@ -1,3 +1,3 @@
 {
-  ooknet.virtualization.qemu.enable = true;
+  ooknet.virtualization.guest.type = "qemu";
 }

diff --git a/modules/nixos/server/profiles/o
okstest/qemu.nix b/modules/nixos/server/prof
iles/ookstest/qemu.nix
index 7d30cac..b9250dd 100644
--- a/modules/nixos/server/profiles/ookstest
/qemu.nix
+++ b/modules/nixos/server/profiles/ookstest
/qemu.nix
@@ -1,3 +1,3 @@
 {
-  ooknet.virtualization.qemu.enable = true;
+  ooknet.virtualization.guest.type = "qemu"
;
 }
 

diff --git a/modules/nixos/virtualization/host/ooknet-install-vm.nix b/modules/nix
os/virtualization/host/ooknet-install-vm.nix
index a22b9cc..1c48539 100644
--- a/modules/nixos/virtualization/host/ooknet-install-vm.nix
+++ b/modules/nixos/virtualization/host/ooknet-install-vm.nix
@@ -70,9 +70,10 @@ in {
               --ram=${toString cfg.ram} \
               --vcpus=${toString cfg.vcpus} \
               --disk path="$IMAGE_PATH",bus=virtio,size=${toString cfg.storage} \
-              --graphics none \
               --cdrom ${cfg.isoPath} \
               --network network=${cfg.network.name},mac=${cfg.macAddress} \
+              --os-variant="nixos-unstable" \
+              --boot uefi \
               --noautoconsole
             log info "VM successfully created"
             log info "Connect with: ssh ${cfg.user}@${cfg.ipAddress}"
@@ -146,8 +147,8 @@ in {
 
           destroyHostKey() {
             log info "Cleaning up old host keys..."
-            ssh-keygen -R ${cfg.ipAddress} >2/dev/null || true
-            ssh-keygen -R ${cfg.name} >2/dev/null || true
+            ssh-keygen -R ${cfg.ipAddress} 2>/dev/null || true
+            ssh-keygen -R ${cfg.name} 2>/dev/null || true
           }
 
           startVM() {

diff --git a/modules/nixos/virtualization/ho
st/ooknet-install-vm.nix b/modules/nixos/vir
tualization/host/ooknet-install-vm.nix
index a22b9cc..1c48539 100644
--- a/modules/nixos/virtualization/host/ookn
et-install-vm.nix
+++ b/modules/nixos/virtualization/host/ookn
et-install-vm.nix
@@ -70,9 +70,10 @@ in {
               --ram=${toString cfg.ram} \
               --vcpus=${toString cfg.vcpus}
 \
               --disk path="$IMAGE_PATH",bus
=virtio,size=${toString cfg.storage} \
-              --graphics none \
               --cdrom ${cfg.isoPath} \
               --network network=${cfg.netwo
rk.name},mac=${cfg.macAddress} \
+              --os-variant="nixos-unstable"
 \
+              --boot uefi \
               --noautoconsole
             log info "VM successfully creat
ed"
             log info "Connect with: ssh ${c
fg.user}@${cfg.ipAddress}"
@@ -146,8 +147,8 @@ in {
 
           destroyHostKey() {
             log info "Cleaning up old host 
keys..."
-            ssh-keygen -R ${cfg.ipAddress} 
>2/dev/null || true
-            ssh-keygen -R ${cfg.name} >2/de
v/null || true
+            ssh-keygen -R ${cfg.ipAddress} 
2>/dev/null || true
+            ssh-keygen -R ${cfg.name} 2>/de
v/null || true
           }
 
           startVM() {
 

diff --git a/modules/nixos/virtualization/options.nix b/modules/nixos/virtualizati
on/options.nix
index 888cc53..2a721b9 100644
--- a/modules/nixos/virtualization/options.nix
+++ b/modules/nixos/virtualization/options.nix
@@ -7,7 +7,6 @@
   inherit (lib) mkOption mkEnableOption elem;
   inherit (lib.types) path int str bool nullOr enum;
   inherit (config.ooknet) host;
-  inherit (config.ooknet) workstation;
   inherit (config.ooknet.host) admin;
   cfg = config.ooknet.virtualization;
 in {
@@ -28,7 +27,7 @@ in {
     host = {
       enable = mkOption {
         type = bool;
-        default = elem "virtualization" workstation.profiles;
+        default = false;
         description = "Enable ooknet vm module";
       };
       virt-manager.enable = mkEnableOption "Enable libvirtd graphical front end v
irt-manager";

diff --git a/modules/nixos/virtualization/op
tions.nix b/modules/nixos/virtualization/opt
ions.nix
index 888cc53..2a721b9 100644
--- a/modules/nixos/virtualization/options.n
ix
+++ b/modules/nixos/virtualization/options.n
ix
@@ -7,7 +7,6 @@
   inherit (lib) mkOption mkEnableOption ele
m;
   inherit (lib.types) path int str bool nul
lOr enum;
   inherit (config.ooknet) host;
-  inherit (config.ooknet) workstation;
   inherit (config.ooknet.host) admin;
   cfg = config.ooknet.virtualization;
 in {
@@ -28,7 +27,7 @@ in {
     host = {
       enable = mkOption {
         type = bool;
-        default = elem "virtualization" wor
kstation.profiles;
+        default = false;
         description = "Enable ooknet vm mod
ule";
       };
       virt-manager.enable = mkEnableOption 
"Enable libvirtd graphical front end virt-ma
nager";
 

diff --git a/outputs/hosts/servers.nix b/outputs/hosts/servers.nix
index 80f302e..10677b9 100644
--- a/outputs/hosts/servers.nix
+++ b/outputs/hosts/servers.nix
@@ -23,5 +23,14 @@ in {
       type = "desktop";
       services = ["ookflix"];
     };
+    ookstest = mkServer {
+      inherit withSystem;
+      system = "x86_64-linux";
+      hostname = "ookstest";
+      domain = "ooknet.org";
+      type = "vm";
+      services = [];
+      profile = "ookstest";
+    };
   };
 }

diff --git a/outputs/hosts/servers.nix b/out
puts/hosts/servers.nix
index 80f302e..10677b9 100644
--- a/outputs/hosts/servers.nix
+++ b/outputs/hosts/servers.nix
@@ -23,5 +23,14 @@ in {
       type = "desktop";
       services = ["ookflix"];
     };
+    ookstest = mkServer {
+      inherit withSystem;
+      system = "x86_64-linux";
+      hostname = "ookstest";
+      domain = "ooknet.org";
+      type = "vm";
+      services = [];
+      profile = "ookstest";
+    };
   };
 }
 
[ BACK TO LOG ]
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET