Cyclical login problem on GPU passthrough to Ubuntu VM

I mapped a Quadro K4000 into Ubuntu18.04 VM (QEMU-KVM), installed driver 450.80.02 Linux 64-bit.
After reboot, i was stuck in “cyclical login” state (after input password in login window, just got the login window again!)

I also tried CentOS 7 VM, the same problem.
And it works fine on Windows VM.

Please help me on this, thanks a lot!

Refer to the following detailed information:
1. dmesg

2. It seemed nouveau was disabled, nvidia was loaded, and also qxl was loaded

3. lspci
got Quadro K4000

and also QXL

4. nvidia-smi

5. xorg.conf (generated by nvidia installer)

6. Xorg.0.log

Please try with a minimal xorg.conf

Section "Device"
  Identifier "nvidia"
  Driver "nvidia"
  BusID "PCI:7:0:0"

and have a monitor connected to the Quadro.

Hi generix
Thank you for help.
Just come back for vacation, try your xorg.conf, and the problem is not resolved ( And also failed after a monitor was connected to the GPU.)
Cause i am using VM, so i can only connect a monitor to Host Server ( physical machine into which K4000 is plugged and on which VM is running). And i access the VM from my laptop via remote-viewer(SPICE).

Ok, that’s a whole different story. The remote viewer just connects to the virtual graphics device in quemu, not to a real Xserver that would run on the nvidia gpu.
This would require either connecting to the Xserver using e.g. x11vnc or using VirtualGL.
In general, to have an Xserver starting on an Nvidia gpu without monitor,
Option “AllowEmptyInitialConfig” “true”
Option “UseDisplayDevice” “none”
has to be added to the device section.

Thanks for explanation, I’ll try.