From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lars =?UTF-8?B?QsO2Y2tlbA==?= Subject: Re: libvirt with modified QEMU and OVMF Date: Sat, 17 Nov 2018 23:34:26 +0100 Message-ID: <20181117233426.4394e075@larf.space> References: <129c5140-eb4c-27df-fe43-6f7cbd423edd@larf.space> <87efe4grnm.fsf@gnu.org> <87in3fem46.fsf@gnu.org> <9de89b41-b522-3c40-a879-432801325b88@larf.space> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gO9Ag-0007cm-Gq for guix-devel@gnu.org; Sat, 17 Nov 2018 17:34:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gO9Ad-0000gW-Cw for guix-devel@gnu.org; Sat, 17 Nov 2018 17:34:34 -0500 Received: from ms-10.1blu.de ([178.254.4.101]:55986) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gO9Ad-0000fr-6B for guix-devel@gnu.org; Sat, 17 Nov 2018 17:34:31 -0500 Received: from [188.136.12.94] (helo=localhost) by ms-10.1blu.de with esmtpa (Exim 4.86_2) (envelope-from ) id 1gO9Aa-0007X7-HC for guix-devel@gnu.org; Sat, 17 Nov 2018 23:34:28 +0100 In-Reply-To: <9de89b41-b522-3c40-a879-432801325b88@larf.space> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" Cc: Guix-devel So to follow this up now. I tried these:=20 (simple-service 'qemu-conf etc-service-type `(("libvirt/qemu.conf" ,(mixed-text-file "qemu.conf" "nvram =3D /run/current-system/profile/share/firmware/ovmf_x64.bin \n user=3D'1000'")))) (extra-special-file "/etc/libvirt/qemu.conf" (plain-file "etc/libvirt/qemu.conf" "nvram =3D /run/current-system/profile/share/firmware/ovmf_x64.bin \n user=3D'1000'")) also i tried to edit the libvirt package by doing this: (replace 'install ;; Since the sysconfdir and localstatedir should be /etc and /var ;; at runtime, we must prevent writing to them at installation ;; time. (lambda _ (invoke "make" "install" "sysconfdir=3D/tmp/etc" "localstatedir=3D/tmp/var"))) (add-after 'install 'ovmf-stuff (lambda* (#:key outputs #:allow-other-keys) (let* ((output (assoc-ref outputs "out")) (etclibvirt (string-append output "/etc/libvirt"))) (mkdir-p etclibvirt) (with-output-to-file (string-append etclibvirt "/qemu.conf") (lambda _ (format #t "nvram =3D /run/current-system/profile/share/firmware/ovmf_x64.bin user=3D'1000'" output)))))) (add-after 'ovmf-stuff 'wrap-libvirtd (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (wrap-program (string-append out "/sbin/libvirtd") `("PATH" =3D (,(string-append (assoc-ref inputs "iproute") "/sbin") ,(string-append (assoc-ref inputs "qemu") "/bin")))) i really hope that after my mail client butchered it it is still readable. to summarize: an etc-service-type will not work because it links to /etc/libvirt which alredy exist and an extra-special-file will not work because "invalid character `/' in name `etc/libvirt/qemu.conf'". The file created in the package does not exist in /etc but in /run/current-system/profile/etc where libvirt probably does not read. At least it does not work as expected.=20 > Thanks for sharing your idea about it. I cannot pull right now but i=20 > think ...nvram =3D " ovmf "/F... would not work since you would have to=20 > call the complete path of the package. Though something like "nvram =3D=20 > /run/current-system/profile/share/firmware/ovmf_x64.bin" COULD work. > I don't know how it would react to the massive wall of symlinks. That > is probably the reason why NixOS calls it with ${pkgs.OVMF}. The > produced file in NixOS (/var/lib/libvirt/qemu.conf) points > to /nix/store/.... For usability something you can just put in > libvirt-service-type with #t would be good for usability. As well as > the user variable. Configurations like these are probably more common > than changing tls-ports and would simplify the migration of people > running different systems since they could more easily configure VMs > with UEFI support. >=20 > When my internet is running again i will pull and try this config. > But since its saturday that might take some time... You can easily > check for UEFI support in libvirt with either virt-install --boot > uefi or in virt-manager when you create a vm and edit it beforehand > you have a dropdown menu for BIOS/UEFI. If someone could test it out > and report back that would be great! >=20 >=20 > >> i would like to push the issue with OVMF in libvirt again: > >> > >> I would like to have OVMF(UEFI) capability with QEMU. In NixOS you > >> can achieve this with > >> > >> =C2=A0 virtualisation.libvirtd.enable =3D true; > >> =C2=A0 virtualisation.libvirtd.qemuOvmf =3D true; > >> =C2=A0=C2=A0 virtualisation.libvirtd.qemuVerbatimConfig =3D '' > >> =C2=A0=C2=A0=C2=A0=C2=A0 nvram =3D > >> [ "${pkgs.OVMF}/FV/OVMF.fd:${pkgs.OVMF}/FV/OVMF_VARS.fd" ] user =3D > >> "1000" ''; > >> > >> the "user" part is not necessary but is required for system VMs in > >> combination with qemu's pulseaudio driver. qemuVerbatimConfig is > >> the config that is at /etc/libvirt/qemu.conf in traditional > >> GNU/Linux distributions. =20 > > I don=E2=80=99t know about OVMF but IIUC, what you need here is to crea= te > > /etc/libvirt/qemu.conf. To do that, you can something along these > > lines: > > > > (simple-service 'qemu-conf etc-service-type > > `(("libvirt/qemu.conf" > > ,(mixed-text-file "qemu.conf" > > "nvarm =3D " > > ovmf "/FV/OVMF.fd:=E2=80=A6'))= )) > > > > Would that work? > > > > (Actually the =E2=80=9Clibvirt/=E2=80=9D bit is only possible since com= mit > > 5dec93bb8ba89605bce2f9a5ee9c4dbadeee3b58, a few minutes ago=E2=80=A6) > > > > We could provide a proper abstraction on top of that if needed, but > > I=E2=80=99m not familiar with libvirt. If you have ideas on how to imp= rove > > this, that=E2=80=99d be great! > > > > Thanks, > > Ludo=E2=80=99. =20