[vfio-users] vga passthrough works but no grub screen for linux guest

Christoph Willing chris.willing at linux.com
Tue Jul 2 07:17:39 UTC 2019


On 1/7/19 8:11 am, Christoph Willing wrote:
> On 30/6/19 11:07 pm, Bronek Kozicki wrote:
>> On Sun, 30 Jun 2019, at 1:41 PM, Christoph Willing wrote:
>>> I have vga passthrough working with a linux guest running in qemu-3.1.0
>>> on a host with two Nvidia Quadro K600 cards and the nvidia binary driver
>>> 430.26 installed. A dedicated keyboard & mouse is also passed through
>>> successfully so, in general, I'm pretty happy with the setup but ...
>>>
>>> when I use OVMF and run the guest without passthrough (just a regular
>>> qemu vm running on the host display) I see a grub screen to select a
>>> particular kernel, followed by the usual console output during bootup
>>> before X starts. However, when running with passthrough enabled, the
>>> guest vm's monitor (Samsung U28D590) shows nothing until X starts -
>>> there is no grub screen and no console output.
>>>
>>> Before I had the nvidia binary driver installed in the guest, I had some
>>> console output while booting but still no grub screen.
>>>
>>> Is there some way I can see everything including the grub screen, or is
>>> it normal not to see that in the guest?
>>
>> It is normal on my Quadro M5000 - these cards are not supported as primary display with passthrough. This might be something to do with ROM, but I was not successful trying to investigate further. To compensate for this all my virtual machines have serial console, so I can do "virsh console"
>>
>>
>> B.
>>
> 
> Thanks for the confirmation Bronek - it's good to know I'm not the only
> one seeing this. I'll give it a try with serial console.
> 

For others searching about this issue, Bronek's idea to use serial
console for grub and system boot messages was a good one. For "pure"
qemu users, it works (for me) like this:

first note that the qemu gui interface has a "serial0" option in the
View menu. Selecting the serial0 option early enough displays the grub
screen with which you may interact to select which kernel to boot. After
that will be mainly nothing of interest though (in my case: error: no
suitable video mode found. Booting in blind mode). To see all the kernel
boot messages too, the guest's kernel command line must also include
something like:
   console=ttyS0,115200n8
(38400n8 also worked - probably other speeds too)

I think most people might want to add this via /etc/default/grub but
since I was experimenting and wanted to try things with a unique grub
entry (rather than all grub entries) I added it to a dedicated grub
menuentry in /etc/grub.d/40_custom so that my kernel command line looked
like this:
   linux  /boot/vmlinuz-generic root=/dev/sda2 ro console=ttyS0,115200n8

Now all the expected boot output appears in qemu's serial0 window.

The only problem with using serial0 window is that it's not scrollable.
An alternative is to add "-serial mon:stdio" somewhere in the qemu
command/script. Then the grub screen and boot output appears in the
terminal used to run qemu. Note that the -serial option is not
compatible with -daemonize".

chris




More information about the vfio-users mailing list