Encrypting boot partition Libvirt not showing the OS booting up

john doe johndoe65534 at mail.com
Tue Oct 13 10:06:02 UTC 2020


On 10/13/2020 10:58 AM, Peter Krempa wrote:
> On Tue, Oct 13, 2020 at 10:40:11 +0200, john doe wrote:
>> On 10/13/2020 8:50 AM, john doe wrote:
>
> [...]
>
>>> Thank you, I have now isolated the command generated by libvirt.
>>> Starting this command from a script, a vnc server is started.
>>>
>>> Is libvirt internally using vnc connection?
>>>
>>
>> It looks like the issue is that the libvirt command pass to qemu is
>> using '-display none' where it should be '-nographic'.
>
> That is deliberate:
>
> commit 7a97676b968bcdf60fb987afe6308bc0b4ab9cd3
> Author: Paolo Bonzini <pbonzini at redhat.com>
> Date:   Tue Jul 5 14:35:28 2016 +0200
>
>      qemu: generate -display none
>
>      This is preferrable to -nographic which (in addition to disabling
>      graphics output) redirects the serial port to stdio and on OpenBIOS
>      enables the firmware's serial console.
>
>
> We don't want to use stdio serial port at all, but rather explicitly
> defined ones exposed internally such as:
>
>      <serial type='pty'>
>        <target type='isa-serial' port='0'>
>          <model name='isa-serial'/>
>        </target>
>      </serial>
>      <console type='pty'>
>        <target type='serial' port='0'/>
>      </console>
>
>
> I've verified that once I add the suggested useserial attribute:
>
>    <os>
>      <type arch='x86_64' machine='pc-i440fx-2.9'>hvm</type>
>      <bootmenu enable='yes'/>
>      <bios useserial='yes'/>
>    </os>
>
> to one of my VMs I can see the console when started via virsh start
> --console:
>
> $ virsh start --console upstream
> Domain upstream started
> Connected to domain upstream
> Escape character is ^] (Ctrl + ])
>
>
> iPXE (http://ipxe.org) 00:03.0 C100 PCI2.10 PnP PMM+3E7835A0+3E6E35A0 C100
>
>
>
>
>
> iPXE (http://ipxe.org) 00:08.0 C200 PCI2.10 PnP PMM+3E6D25A0 3E6E35A0 C200
>
>
>
>
> Press ESC for boot menu.
>
>

To summerise:

After having installed the vm with virt-install, if you encrypt the boot
partition, you may need to add the below two lines in the os section of
the domain xml:

     <bootmenu enable='yes'/>
     <bios useserial='yes'/>

Then start the guest with the below command:

virsh start $vm --console


I was able to find the log file in the directory '/var/log/libvirt/qemu'.


A big thank you for all the help:
- Peter Krempa
- Daniel P. Berrangé
- Laine Stump
- Michal Privoznik


Much appriciated.

--
John Doe





More information about the libvirt-users mailing list