[libvirt] libvirt hyper-v

Matthias Bolte matthias.bolte at googlemail.com
Sat Dec 10 10:05:19 UTC 2011

2011/12/9 Andy Li <andy_li at usish.com>:
> Dear Sir or Madam:
> I am engineer who want to connect hyper-v R2 via libvirt 0.9.3, but after
> create ceritificate file, and set the hyper-v winRM status to
> AllowUnencrypted="true"
> Then I connect the hyper-v by the command: virsh –c
> hyperv://  it always reply:
> Error: unable to complete TLS handshake: A TLS packet with unexpected length
> was received
> Error: failed to connect to the hypervisor

Your problem is simple. Hyper-V support was added to libvirt in
version 0.9.5, so your libvirt 0.9.3 is too old and doesn't know about

What's happening here is that libvirt doesn't know how to handle a URI
with hyperv:// scheme and tries to connect to a non-existing libvirtd
on Because you override the default libvirtd TLS port
libvirt tries to open a TLS session with the WinRM server on the
unencrypted port 5985 on your Hyper-V host but fails with a TLS
related error message.

The solution is to upgrade your libvirt version to 0.9.5 or newer and
try again with the same virsh command. Also make sure that Hyper-V
support is enabled in your new libvirt build, it requires openwsman.

Matthias Bolte

More information about the libvir-list mailing list