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

Centos 7 Spice Console Black Screen #137

Open
EggManOstrichBaby opened this issue Oct 4, 2018 · 29 comments
Open

Centos 7 Spice Console Black Screen #137

EggManOstrichBaby opened this issue Oct 4, 2018 · 29 comments
Labels

Comments

@EggManOstrichBaby
Copy link

Hi,
I am able to create VMs via the dashboard but when i launch the spice console, i'm presented with a black screen in virt-viewer, checking the running processes shows that the VM is running. also no errors are generated. spice works fine when i create the VM from virt-manager.

screenshot from 2018-10-05 01-04-38
Fri Oct 05 00:57:45.058252 2018] [core:notice] [pid 12887] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0 [Fri Oct 05 00:57:45.058981 2018] [suexec:notice] [pid 12887] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.122.209. Set the 'ServerName' directive globally to suppress this message [Fri Oct 05 00:57:45.076830 2018] [auth_digest:notice] [pid 12887] AH01757: generating secret for digest authentication ... [Fri Oct 05 00:57:45.077460 2018] [lbmethod_heartbeat:notice] [pid 12887] AH02282: No slotmem from mod_heartmonitor [Fri Oct 05 00:57:45.103266 2018] [mpm_prefork:notice] [pid 12887] AH00163: Apache/2.4.6 (CentOS) PHP/7.2.10 configured -- resuming normal operations [Fri Oct 05 00:57:45.103305 2018] [core:notice] [pid 12887] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' [Fri Oct 05 00:59:24.693830 2018] [php7:notice] [pid 13801] [client 192.168.122.209:40060] Executing: sudo virsh list --all, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 00:59:25.236048 2018] [php7:notice] [pid 13801] [client 192.168.122.209:40060] Executing: sudo virsh list --all |tail -n +3|head -n -1|awk '{print $2" "$3}', referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 00:59:25.688674 2018] [php7:notice] [pid 13801] [client 192.168.122.209:40060] Executing: sudo virsh list --all |tail -n +3|head -n -1|awk '{print $2" "$3}', referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 00:59:43.037104 2018] [php7:notice] [pid 12897] [client 192.168.122.209:40068] Executing: sudo ls /var/lib/libvirt/images|grep -i .iso, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:12.949216 2018] [php7:notice] [pid 12896] [client 192.168.122.209:40072] Executing: sudo qemu-img create -f qcow2 -o size='10'G '/data/debian-5bb66a44e7aa1.qcow2', referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:13.554815 2018] [php7:notice] [pid 12896] [client 192.168.122.209:40072] Formatting '/data/debian-5bb66a44e7aa1.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 lazy_refcounts=off \n, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:13.554958 2018] [php7:notice] [pid 12896] [client 192.168.122.209:40072] Executing: sudo virt-install --name='debian' --disk path='/data/debian-5bb66a44e7aa1.qcow2',format=qcow2,bus=virtio,cache=none --disk path='/var/lib/libvirt/images/debian-9.5.0-amd64-xfce-CD-1.iso',device=cdrom,target=hdc,perms=ro --soundhw=ac97 --vcpus='2',cores='2',sockets='1' --ram='2048' --network bridge='br0',model=virtio --os-type='linux' --os-variant='debiansqueeze' --graphics spice,listen=0.0.0.0,password=2PnDx9pRSicrj --redirdev usb,type=spicevmc --video qxl --noreboot --wait=0 , referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:14.629721 2018] [php7:notice] [pid 12896] [client 192.168.122.209:40072] WARNING KVM acceleration not available, using 'qemu'\n, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:14.645006 2018] [php7:notice] [pid 12896] [client 192.168.122.209:40072] Executing: sudo /usr/local/VDI//vdi-xmledit -name 'debian', referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:14.842168 2018] [php7:notice] [pid 12896] [client 192.168.122.209:40072] /usr/local/VDI//vdi-xmledit:40: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.\n if image_path:\n, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:14.975446 2018] [php7:notice] [pid 12896] [client 192.168.122.209:40072] Executing: sudo virsh list --all |tail -n +3|head -n -1|awk '{print $2" "$3}', referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:33.031391 2018] [php7:notice] [pid 13806] [client 192.168.122.209:40084] Executing: sudo virsh domdisplay debian, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:33.728976 2018] [php7:notice] [pid 13806] [client 192.168.122.209:40084] Executing: sudo virsh screenshot debian /tmp/debian.ppmbugfix, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:34.200645 2018] [php7:notice] [pid 13806] [client 192.168.122.209:40084] Executing: sudo virsh screenshot debian /tmp/debian.ppm, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:34.359102 2018] [php7:notice] [pid 13806] [client 192.168.122.209:40084] Executing: sudo cat /tmp/debian.ppm, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:34.541222 2018] [php7:notice] [pid 13806] [client 192.168.122.209:40084] Executing: sudo rm /tmp/debian.ppmbugfix, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:34.618494 2018] [php7:notice] [pid 13806] [client 192.168.122.209:40084] Executing: sudo rm /tmp/debian.ppm, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:47.910328 2018] [php7:notice] [pid 13802] [client 192.168.122.209:40090] PHP Notice: Undefined index: client_logged in /var/www/html/kvm-vdi/functions/functions.php on line 63, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:00:59.588128 2018] [php7:notice] [pid 13805] [client 192.168.122.209:40092] Executing: sudo virsh domdisplay debian, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:01:00.292036 2018] [php7:notice] [pid 13805] [client 192.168.122.209:40092] Executing: sudo virsh screenshot debian /tmp/debian.ppmbugfix, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:01:00.754569 2018] [php7:notice] [pid 13805] [client 192.168.122.209:40092] Executing: sudo virsh screenshot debian /tmp/debian.ppm, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:01:00.923094 2018] [php7:notice] [pid 13805] [client 192.168.122.209:40092] Executing: sudo cat /tmp/debian.ppm, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:01:01.094044 2018] [php7:notice] [pid 13805] [client 192.168.122.209:40092] Executing: sudo rm /tmp/debian.ppmbugfix, referer: http://192.168.122.209/kvm-vdi/dashboard.php [Fri Oct 05 01:01:01.182848 2018] [php7:notice] [pid 13805] [client 192.168.122.209:40092] Executing: sudo rm /tmp/debian.ppm, referer: http://192.168.122.209/kvm-vdi/dashboard.php

Also is there any way i can make the Hypervisor Agent log more verbose ?

@Seitanas
Copy link
Owner

Seitanas commented Oct 5, 2018

Hello,

you should look at VM process ps axwww|grep debian first. And see if process has SPICE password set up.

You can enable debug logging here:

level = INFO

@EggManOstrichBaby
Copy link
Author

I don't see any password setup in the process string

root@CentOS7 ~]# ps axwww|grep debian
11487 ? Sl 1:35 /usr/libexec/qemu-kvm -name debian9 -S -machine pc-i440fx-rhel7.0.0,accel=tcg,usb=off,dump-guest-core=off -m 2048 -realtime mlock=off -smp 2,sockets=1,cores=2,threads=1 -uuid c40cfba8-66ae-4110-b9c0-2a8324add88a -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-1-debian9/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-reboot -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/data/debian9-5bb742a38fd34.qcow2,format=qcow2,if=none,id=drive-virtio-disk0,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=2 -drive file=/var/lib/libvirt/images/debian-9.5.0-amd64-xfce-CD-1.iso,format=raw,if=none,id=drive-ide0-1-0,readonly=on -device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1 -netdev tap,fd=26,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:b8:33:24,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0,bus=usb.0,port=1 -spice port=5900,addr=0.0.0.0,image-compression=off,seamless-migration=on -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864 -global qxl-vga.vgamem_mb=16 -global qxl-vga.max_outputs=1 -device AC97,id=sound0,bus=pci.0,addr=0x4 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 -msg timestamp=on

I have tried opening virt-manger and launching virt-viewer from there using the same password when virsh creates the VM

[Fri Oct 05 16:23:24.503670 2018] [php7:notice] [pid 9623] [client 192.168.122.209:36134] Executing: sudo virt-install --name='debian9' --disk path='/data/debian9-5bb742a38fd34.qcow2',format=qcow2,bus=virtio,cache=none --disk path='/var/lib/libvirt/images/debian-9.5.0-amd64-xfce-CD-1.iso',device=cdrom,target=hdc,perms=ro --soundhw=ac97 --vcpus='2',cores='2',sockets='1' --ram='2048' --network bridge='br0',model=virtio --os-type='linux' --os-variant='debiansqueeze' --graphics spice,listen=0.0.0.0,password=C5oug6RAqSLdh --redirdev usb,type=spicevmc --video qxl --noreboot --wait=0 , referer: http://192.168.122.209/kvm-vdi/dashboard.php

still shows a black scree
I want you to know that im setting this up within a VM i.e I've virtualized Centos 7 on my Gentoo Machine, dont know if VM nesting is causing this in any way, but like i said VM created from Virt-manager inside Centos 7 (VM) work fine with proper display output.

@Seitanas
Copy link
Owner

Seitanas commented Oct 5, 2018

Take a look at your vm XML config file in /etc/libvirt/qemu.
What emulator is configured?

@EggManOstrichBaby
Copy link
Author

qemu apparently

<devices> <emulator>/usr/local/VDI/vdi-wrapper</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/data/debian9-5bb742a38fd34.qcow2'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/debian-9.5.0-amd64-xfce-CD-1.iso'/> <target dev='hdc' bus='ide'/> <readonly/>

@Seitanas
Copy link
Owner

Seitanas commented Oct 5, 2018

Okay, it's using correct emulator <emulator>/usr/local/VDI/vdi-wrapper</emulator>. So it should set spice password for VM on its startup, and announce it to dashboard service.
Try starting machine via virsh command. Perhaps there will be some kind of error printed.
Also, check if SELinux is disabled.

@EggManOstrichBaby
Copy link
Author

do you want me to disable it completely or will permissive mode do, cause i tried that before, its still shows a black screen
[root@CentOS7 ~]# setenforce permissive
[root@CentOS7 ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31

@EggManOstrichBaby
Copy link
Author

will disable selinux completely, and get back to you.

@Seitanas
Copy link
Owner

Seitanas commented Oct 5, 2018

You should disable it completely and reboot server. Basically, vm should have SPICE password visible in VM process section like this:
--graphics spice,listen=0.0.0.0,password=jARrkzB8e4YIa.
For what I see now, VM is started directly via qemu, ant not via /usr/local/VDI/vdi-wrapper

@EggManOstrichBaby
Copy link
Author

sestatus
SELinux status: disabled

nope still a black screen
screenshot from 2018-10-05 17-07-17

@EggManOstrichBaby
Copy link
Author

so how do i force qemu to use the wrapper ??

@EggManOstrichBaby
Copy link
Author

I dont think it's a password issue, cause when i launch virt-manger and use the same password it still shows a black screen.

@EggManOstrichBaby
Copy link
Author

this is a VM running perfectly fine
screenshot from 2018-10-05 16-55-42

@EggManOstrichBaby
Copy link
Author

using virt-viewer directly, with the generated password still the same
screenshot from 2018-10-05 17-50-28

@Seitanas
Copy link
Owner

Seitanas commented Oct 5, 2018

It may not be password issue, but a problem with kvm-vdi installation.
Password should be set, - if it's not, something has failed.

@EggManOstrichBaby
Copy link
Author

Is there any way to find out, or am i on my on on this one ?, don't mint starting from scratch but would be a lot better if i really knew what was actually going on in the backend.

@EggManOstrichBaby
Copy link
Author

can it be a permission issue in someways ? what other log can i check apart from the "error_log" ?

@EggManOstrichBaby
Copy link
Author

EggManOstrichBaby commented Oct 5, 2018

wow, dont't know what just happened it just works now
screenshot from 2018-10-05 20-50-42

@EggManOstrichBaby
Copy link
Author

man i'm scratching my head, wtf ?? bug ?? I swear didn't don anything ??

@EggManOstrichBaby
Copy link
Author

EggManOstrichBaby commented Oct 5, 2018

Edited : this was irrelevant as i figured out that this wasn't the problem. the black screen issue still persists if make changes to the cpu/memory allocation while deploying the VM.

@EggManOstrichBaby
Copy link
Author

EggManOstrichBaby commented Oct 5, 2018

could you please explain what does this mean ? Oct 5 21:32:58 CentOS7 journal: Allocating size to SpiceDisplay 0x55879196a3c0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
I did a complete cleanup and it had stopped working again i.e black screen, now its working again, is this a bug ??

@EggManOstrichBaby
Copy link
Author

EggManOstrichBaby commented Oct 5, 2018

Ok so I found out that if i playaround with the cpu & memory allocation it gives me the blackscreen issue, but if i just leave to its defaults it works, now how this is related to spice i do not know.
i cant allocate more cores or memory because of this.

@Seitanas
Copy link
Owner

Seitanas commented Oct 6, 2018

Not sure, how this could affect SPICE. Perhaps this is somehow related to hypervisor being run in virtualised environment. Is there enough cpu/memory allocated for hypervisor?

@EggManOstrichBaby
Copy link
Author

EggManOstrichBaby commented Oct 6, 2018

Yes 6 cores and 4GB of RAM
I haven't setup a windows host yet, will check if it behaves the same way.

@EggManOstrichBaby
Copy link
Author

EggManOstrichBaby commented Oct 6, 2018

It's the same with the windows host. black screen if i change cpu/mem. also I've notice the VM installation takes very long.

@EggManOstrichBaby
Copy link
Author

Yup, can confirm this a CentOS issue, setup the whole thing on Debian 9 (Virtual ) and everything is working can allocate more core/mem no problem.

@Seitanas
Copy link
Owner

The main difference between those 2 distributions is that Centos uses SELinux. It must be completely disabled and server rebooted.

@EggManOstrichBaby
Copy link
Author

EggManOstrichBaby commented Oct 23, 2018

After Enabling Nested VM for KVM & host-passthrough in virt-manager, the CentOS Black Screen issue is fixed, it's working fine now, I can allocate more resources without any problem.

@ghost
Copy link

ghost commented Jan 25, 2019

same problem here trying to install debian on centos host

@ghost
Copy link

ghost commented Jan 27, 2019

did you activated by BIOS the required option for virtualization? you can check it by issuing dmesg | grep kvm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants