LibVMI Initialization Fails with KVM Patch

95 views
Skip to first unread message

hakim

unread,
Mar 6, 2018, 3:27:30 PM3/6/18
to vmitools
I am having some difficulty initializing LibVMI using KVM patch. LibVMI process list example gives following debug output.

xencall: error: Could not obtain handle on privileged command interface: No such file or directory
VMI_ERROR
: Failed to open libxc interface.
Failed to find a suitable xenctrl.so!
--found KVM
LibVMI Version 0.11.0
LibVMI Driver Mode 1
--completed driver init.
--got id from name (Ubuntu-Test --> 39)
**set image_type = Ubuntu-Test
--libvirt version 1003001
--qmp: virsh -c qemu:///system qemu-monitor-command Ubuntu-Test '{"execute": "pmemaccess", "arguments": {"path": "/tmp/vmixH4py0"}}'
--kvm: using custom patch for fast memory access
--connect() failed to /tmp/vmixH4py0, No such file or directory
Failed to init LibVMI library.


This is the output of the kernel log that I feel relevant.

Mar  6 15:19:18 ubuntu-kvm2 kernel: [695179.410321] audit: type=1400 audit(1520367558.201:1070): apparmor="DENIED" operation="mknod" profile="libvirt-9ed3debd-01ec-4bca-8de4-5ec15b3cb55a" name="/tmp/vmixH4py0" pid=24075 comm="qemu-system-x86" requested_mask="c" denied_mask="c" fsuid=64055 ouid=64055




FYI, I start the VM using Virt-Manager which issues the following command to create the vm:

qemu-system-x86_64 -enable-kvm -name Ubuntu-Test -S -machine pc-i440fx-2.8,accel=kvm,usb=off,vmport=off -cpu Broadwell -m 4096 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 9ed3debd-01ec-4bca-8de4-5ec15b3cb55a -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-Ubuntu-Test/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -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=0x6.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x6 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x6.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x6.0x2 -drive file=/data/ctam/vhd_images/Ubuntu-Test.img,format=raw,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:2b:c0:38,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 intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -msg timestamp=on

For whatever reason, it is unable to create the temporary file. Any suggestion is much appreciated.

hakim

unread,
Mar 6, 2018, 3:39:57 PM3/6/18
to vmitools
Also I made sure that the QMP is enabled. Here is the output of my test.

virsh qemu-monitor-command --hmp Ubuntu-Test 'info kvm'

kvm support
: enabled

hakim

unread,
Mar 13, 2018, 1:43:37 PM3/13/18
to vmitools
Hi Tamas,

Can you provide some input regarding this issue? I have confirmed that libyajl is installed and kvm patch is also installed. But it is unable to create a temporary file and hence falling back to human-monitor mode. Using human-monitor mode, I was able to run process-list example for Linux virtual machine, but it never worked for Windows VM. Have you had success to run kvm version for both Windows and Linux vms?

Thanks
Hakim

hakim

unread,
Mar 29, 2018, 9:13:42 AM3/29/18
to vmitools
Wanted to add some information so it can save some time for others. Following message appeared because of apparmor. Apparmor disabled qemu to create a domain socket. Disable apparmor profile to fix it.

Mar  6 15:19:18 ubuntu-kvm2 kernel: [695179.410321] audit: type=1400 audit(1520367558.201:1070): apparmor="DENIED" operation="mknod" profile="libvirt-9ed3debd-01ec-4bca-8de4-5ec15b3cb55a" name="/tmp/vmixH4py0" pid=24075 comm="qemu-system-x86" requested_mask="c" denied_mask="c" fsuid=64055 ouid=64055


I was using qemu-kvm version 2.8. On the provided patch there was some issue related to structure memory padding. A fix was added in https://github.com/libvmi/libvmi/pull/587
Reply all
Reply to author
Forward
0 new messages