Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new xen option fails to work #350051

Closed
gador opened this issue Oct 20, 2024 · 8 comments
Closed

new xen option fails to work #350051

gador opened this issue Oct 20, 2024 · 8 comments
Labels
0.kind: question Requests for a specific question to be answered 6.topic: xen-project The Xen Project hypervisor 9.needs: upstream fix This PR needs upstream to change something

Comments

@gador
Copy link
Member

gador commented Oct 20, 2024

Describe the bug

virtualisation.xen.enable = true does not enable xen.

Steps To Reproduce

Steps to reproduce the behavior:

  1. add virtualisation.xen.enable = true; to the config
  2. reboot

Expected behavior

xl list or xl info (or any other xl command) should work, no errors should show in the boot log

Screenshots

Additional context

xl info returns

xencall: error: Could not obtain handle on privileged command interface: No such file or directory
libxl: error: libxl.c:102:libxl_ctx_alloc: cannot open libxc handle: No such file or directory
cannot init xl context

Boot log shows:

systemd-modules-load[128]: Failed to insert module 'xenfs': No such device
[..]
xen-qemu-dom0-disk-backend.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.
[..]
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to insert module 'xen_gntdev': No such device
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to insert module 'xen_gntalloc': No such device
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to insert module 'xen_blkback': No such device
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to insert module 'xen_netback': No such device
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to insert module 'xen_pciback': No such device
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to find module 'evtchn'
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to find module 'gntdev'
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to find module 'netbk'
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to find module 'blkbk'
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to find module 'xen-scsibk'
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to find module 'usbbk'
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to find module 'pciback'
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to insert module 'xen_acpi_processor': No such device
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to find module 'blktap2'
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to insert module 'xen_wdt': No such device
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to insert module 'xen_acpi_processor': No such device
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to insert module 'xen_privcmd': No such device
Okt 20 17:38:54 framework kernel: Rounding down aligned max_sectors from 4294967295 to 4294967288
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to insert module 'xen_scsiback': No such device
Okt 20 17:38:54 framework systemd-modules-load[1273]: Failed to insert module 'xenfs': No such device

My config includes lanzaboote, zfs and impermanenceconfigs. My kernel is the pkgs.linuxPackages one. My kernelParams are [ "boot.shell_on_fail" "mem_sleep_default=deep" "nvme.noacpi=1" ];

/proc/xen does not exist.

Should I have done something different? Is there a specific kernel I should have used?

Notify maintainers

@NixOS/xen-project

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.57, NixOS, 24.11 (Vicuna), 24.11.20241020.c351235`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.9`
 - channels(wogan): `""`
 - channels(root): `"nixos, nixpkgs"`
 - nixpkgs: `/nix/store/b1r7mk0hgd88fdspwwj97rsa8ppqj7ci-source`

Add a 👍 reaction to issues you find important.

@gador gador added the 0.kind: bug Something is broken label Oct 20, 2024
@SigmaSquadron SigmaSquadron added the 6.topic: xen-project The Xen Project hypervisor label Oct 20, 2024
@SigmaSquadron
Copy link
Contributor

SigmaSquadron commented Oct 20, 2024

Hi there! Thank you for your interest in the Xen hypervisor.

The logs seem to indicate you have not booted into a Xen kernel. You've mentioned you're using Lanzaboote; are you also using this experimental PR that implements Xen support for Lanzaboote? That PR should be considered unstable at this point; for the best experience, try switching to systemd-boot.

Note: While we say "kernel" here, a Xen "kernel" is different from the kernels you set in boot.kernelPackages. In this context, a Xen "kernel" refers to the Xen EFI executable, xen-4.19.0.efi, which is turned into an UKI by the systemd-boot builder.

@SigmaSquadron SigmaSquadron added 0.kind: question Requests for a specific question to be answered 9.needs: reporter feedback This issue needs the person who filed it to respond and removed 0.kind: bug Something is broken labels Oct 20, 2024
@gador
Copy link
Member Author

gador commented Oct 20, 2024

@SigmaSquadron thanks for the (very) quick reply!

I didn't know it was different, nor did I know lanzaboote had this experimental PR!
For now I'll stay with lanzaboote and watch the PR closely. As soon as it is merged I'll give it another try. Thanks for all your work towards xen-dom0!

@gador gador closed this as completed Oct 20, 2024
@SigmaSquadron SigmaSquadron removed the 9.needs: reporter feedback This issue needs the person who filed it to respond label Oct 20, 2024
@gador
Copy link
Member Author

gador commented Nov 12, 2024

I've got my system running with xen with help from @CertainLach (thanks!)

Unfortunately it seems my system (framework 13 inch 11th gen) is quite unstable with xen. I had to hard reset 4 times by now (in about 1 hour!) It seems temperature control isn't working and the CPU overheats. I also don't get temperature measurements when booted in xen.

@SigmaSquadron
Copy link
Contributor

Not much we can do about that, unfortunately. Xen is notoriously picky when it comes to hardware compatibility. You may want to report this to upstream Xen.

@SigmaSquadron SigmaSquadron added the 9.needs: upstream fix This PR needs upstream to change something label Nov 12, 2024
@CertainLach
Copy link
Member

Qubes branch has many compatibility fixes as part of qubes-vmm-xen package, it might make sense to use xen from this package on laptop, even if not using qubes itself.

Your issue, however, sounds like something to be fixed by "cpufreq=xen:hwp=off" kernel cmdline argument (As per workaround from qubes-issues)

@gador
Copy link
Member Author

gador commented Nov 23, 2024

Thanks for the pointer. I went down the rabbit hole with qubes-issues and tried your option (where xen complains about non knowing the option hwp=off and it isnt documented in the official xen docs) until I added "cpufreq=none" and my system worked, again. Until I plugged in the power. Then it frooze.
I guess I give xen another try once #341429 has been merged.

@SigmaSquadron
Copy link
Contributor

SigmaSquadron commented Nov 23, 2024

welcome to xen on non-server hardware :) I'll try to get #341429 in a mergeable state soon.

@gador
Copy link
Member Author

gador commented Nov 23, 2024

Yeah I know. Thanks for all you work towards xen and qubes! I used qubes extensively before and really look forward to playing with it in combination with nixos :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: question Requests for a specific question to be answered 6.topic: xen-project The Xen Project hypervisor 9.needs: upstream fix This PR needs upstream to change something
Projects
None yet
Development

No branches or pull requests

3 participants