Open main menu

Changes

3,928 bytes added ,  10:48, 3 October 2018
no edit summary
 
== Analyze Failures ==
 
=== Background ===
This question was a challenge because I have never done kernel debugging, or used QEMU before. But a few doses of Google later, and using simple deduction based on other experiences, I'm getting through.
So, I installed QEMU + dependencies on my Bionic workstation.
 
=== Command to Start ===
> Please show the commands you use to start via libvirt with this XML.
To start QEMU in KVMmode, append -enable-kvm to the additional start options. To check if KVM is enabled for a running VM, enter the QEMU Monitor using <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>2</kbd> , and type <code>info kvm</code>.
</blockquote>
That informed me that I was not running in KVM mode (disabled). So I halted the machine. I then launched the GUI '''virt-manager''' <code>sudo virt-manager</code>, created a new machine using the qcow image, and started it. Looking at the <code>ps axjfww</code> output on the host, I could see that the command "I" virt-manager used to start the VM was <blockquote>qemu-system-x86_64 -enable-kvm -name guest=generic,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-1-generic/master-key.aes -machine pc-i440fx-bionic,accel=kvm,usb=off,vmport=off,dump-guest-core=off -cpu Broadwell-noTSX-IBRS -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 4cbd5a21-bff7-4e66-8632-2e936507c658 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-1-generic/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-shutdown -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=/home/greg/Downloads/debug-crash.qcow,format=qcow2,if=none,id=drive-ide0-0-0 -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -netdev tap,fd=26,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:4e:3e:15,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 -spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardevspicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=1 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 -msg timestamp=on</blockquote> I also installed the '''qemu-virgil''' snap and was able to start the VM with KVM using<blockquote>sudo qemu-virgil -enable-kvm -m 512 -device virtio-vga,virgl=on -display sdl,gl=on -redir tcp:10022::22 -soundhw ac97 /home/greg/Downloads/debug-crash.qcow</blockquote> Turning to the libvirt project, I discovered that you can convert the XML to command-line args. So, after a quick <code>sudo mkdir -p /var/lib/uvtool/libvirt/images/
</code>, and placing the image there, I tried to run the VM with
<blockquote>
qemuLC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin QEMU_AUDIO_DRV=none /usr/bin/kvm-system-x86_64 -enable-kvm spice -name guest=genericdebug-crash,debug-threads=on -S on -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-genericdebug-crash/master-key.aes -machine pc-i440fx-bionic,accel=kvm,usb=off,vmport=off,dump-guest-core=off -cpu Broadwell-noTSX-IBRS -m 1024 512 -realtime mlock=off -smp 1,socketssockets=1,cores=1,threads=1 -uuid 4cbd5a2149cdd138-bff72fae-4e664f57-86328fdc-2e936507c658 d9bafabb92ac -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain--1-genericdebug-crash/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot strict=on -device ich9piix3-usb-ehci1uhci,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=/homevar/lib/uvtool/greglibvirt/Downloadsimages/debug-crash.qcow,format=qcow2,if=none,id=drive-ide0virtio-0disk0 -0 device virtio-device ideblk-hdpci,scsi=off,bus=idepci.0,unitaddr=00x4,drive=drive-ide0-0virtio-0disk0,id=ide0-0virtio-0disk0,bootindex=1 -netdev tap,fd=2622,id=hostnet0 -device rtl8139virtio-net-pci,netdev=hostnet0hostnet0,id=net0,mac=52:54:00:4ec9:3ebd:15ff,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 -spice port=5900,addr=vnc 127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on :0 -device qxlcirrus-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardevspicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=1 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=2 -device virtio-balloon-pci,id=balloon0balloon0,bus=pci.0,addr=0x7 0x6 -msg timestamp=on</blockquote>
but that failed because the specified AES key <code>-object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-debug-crash/master-key.aes</code> file does not exist. Removing that option, it still fails on a permission problem. The socket file doesn't exist, but it also doesn't get created... even using sudo to execute it as libvirt-qemu (that's the owner of the socket directory). Noticing that the final directory is missing, I ran it again after creating the '''domain--1-debug-crash''' directory.
 
And looking again at my host system process list <code>ps axjfww</code> I could see that the command to start the VM is
 
<blockquote style="background-color:#a8e2a8;">
qemu-system-x86_64 -enable-kvm -name guest=debug-crash,debug-threads=on -machine pc-i440fx-bionic,accel=kvm,usb=off,dump-guest-core=off -m 512 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 49cdd138-2fae-4f57-8fdc-d9bafabb92ac -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain--1-debug-crash/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/uvtool/libvirt/images/debug-crash.qcow,format=qcow2,if=none,id=drive-virtio-disk0 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=22,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:c9:bd:ff,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -vnc 127.0.0.1:0 -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -msg timestamp=on
</blockquote>
That still doesn't quite work, because I can't connect to the machine. It appears that I am supposed to create and sign a certificate for the machine?
  === Apache ===
> Apache is not starting, why?
 
There's a syntax error on line 153 of /etc/apache2/apache2.conf. More accurately, it can not open the file that it's trying to open at /etc/apache2/extra.conf. And actually, looking at that file, someone with a sense of humor symlinked it to <code>/dev/urandom</code> -- which is why Apache has a problem with the syntax :-D
=== Crash File ===
> What is going on with /var/crash/_usr_sbin_postconf.1000.crash?
 
TBD
== Makefile Weirdness (LDFLAGS ) ==
> It turns out this change actually made LDFLAGS empty. Why?
 I thought this was a trick question, because it looked like the syntax for $CFLAGS and $CPPFLAGS are incorrect. But, that syntax actually does look correct. Since the sed expression also looks correct, I have to surmise thought that somehow CFLAGS and/or LDFLAGS weren't configured correctly. But that's was only a guess. '''R'''eading '''T'''he '''F'''ine '''M'''anual on <code>dpkg-buildflags</code>, it tells me that <span style="background-color:#a8e2a8;"> <code>LDFLAGS</code> defaults to empty. So sed is a no-op, and LDFLAGS would still be empty.</span>
4,558

edits