Getting to boot nixos on Xen #1
Labels
No labels
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Fachschaft/nixConfig#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is a bit more of a nightmare then it should be. We want certain things:
This basically leaves us with the following xen virtualization modes:
pv and the newer pvh.
Both of them load images directly without emulating some sort of BIOS/efi. We some options to do this.
1 is not really an option for us, as this won't give the kernel control about its boot options and kernel. 2 is out, as pygrub
is not capable of parsing the grub.cfg nixos generates.
Leaves us with 3 and 4. These both work by booting a grub image as a kernel (from xen perspective), hardcoded from dom0 into
the guest context and this grub then parses the guest config to load the real kernel. (pvgrub and pvhgrub are both part of grub not of xen).
pvgrub has a bug that fails booting zstd kernels (dafug these are selfextracting archives grub shouldn't handle the compression anyway).
leaves us exactly with pvhgrub.
Luckily for us debian supplies us with pvhgrub images with the
grub-xen-host
package.So we can get a booting nixos config in the following way:
This assumes that the hardrive with the grub config is the first one.
That leaves us with the bootstrapping problem:
One working way with several drawbacks (if someone finds something better tell me):
We can boot the nixos install iso in hvm mode with only one partition and the cdrom. Install
nixos with a basic configuration, reboot the system with more hardware in pvh mode and fix all the mount
points later.
This is not ideal as for example
/var/
will already be populated when the filesystem that should go there becomes available.It kind of works though.
Maybe we can boot the iso the same way as the main machine, finding out the path of the grub config in that iso shouldn't be hard