Merge branch 'add-hyper-v-instructions' into 'master'

add hyper-v instructions

See merge request nonguix/nonguix!674
This commit is contained in:
admmq 2025-09-30 06:11:20 +00:00
commit b5ed848350

View file

@ -373,6 +373,59 @@ use as your kernel.
...) ...)
#+END_SRC #+END_SRC
* Running Guix on proprietary hypervisors
** Hyper-V
HyperV is relatively popular solution for deploying a hypervisor. Especially in small companies.
*** Creating a bootable image
Creating an iso of Guix is trivial and described here in [[https://guix.gnu.org/manual/devel/en/html_node/Building-the-Installation-Image.html][Guix manual]]. Unfortunately, such image
will not boot on gen 2 hyper-v vm. It will not mount the virtual disk. This can be resolved by
adding initrd modules hv_storvsc, hv_vmbus and hv_utils to installation-os definition in
gnu/system/install.scm.
#+BEGIN_SRC scheme
...
(define installation-os
;; The operating system used on installation images for USB sticks etc.
(operating-system
(initrd-modules (append (list "hv_storvsc" "hv_vmbus" "hv_utils")
%base-initrd-modules))
(host-name "gnu")
...
#+END_SRC
After that run
#+BEGIN_SRC shell
guix system image --image-type=iso9660 gnu/system/install.scm
#+END_SRC
This will generate an installation image which will successfully run on gen 2 hyper-v vm.
*** Installing Guix
Create configuration file (using manual installation option) and add initrd modules mentioned
above.
*** Fixing screen resolution
In case you would want to deploy a Guix server with graphics, to increase vm screen size use
hyperv_fb. Add it as a kernel argument in your system config.
#+BEGIN_SRC scheme
...
(operating-system
(initrd-modules (append (list "hv_storvsc" "hv_vmbus" "hv_utils")
%base-initrd-modules))
(kernel-arguments
(append
'("video=hyperv_fb:1920x1080")
%default-kernel-arguments))
...
#+END_SRC
* Contributing * Contributing
Contributions are welcome! If there's a package you would like to add, just Contributions are welcome! If there's a package you would like to add, just