VMを一覧表示しようとすると、VMでlibvirt-binエラーが発生します。

VMを一覧表示しようとすると、VMでlibvirt-binエラーが発生します。

私はArch LinuxホストでVirtualbox 4.3.18を使用し、Ubuntu Server Cloudゲストシステムでlibvirt-bin 1.2.9を使用しています。フォローしようとするたびにこのチュートリアルvirshを実行すると、次のエラーが発生します。

注文する:

virsh -c vbox+ssh://[email protected]/system list --all

間違い:

error: failed to connect to the hypervisor
error: internal error: unable to initialize VirtualBox driver API

この問題を解決する方法を知っている人はいますか?

ベストアンサー1

vbox + ssh接続タイプを処理するようにlibvirtdインストールを構成する必要があります。これを行う方法の詳細は次のとおりです。VirtualBoxハイパーバイザードライバ

VirtualBox VMとの通信方法を知るために、サンプルドメインXML構成をlibvirtdにロードする必要があります。

抜粋 - 構成例
<domain type='vbox'>
  <name>vbox</name>
  <uuid>4dab22b31d52d8f32516782e98ab3fa0</uuid>

  <os>
    <type>hvm</type>
    <boot dev='cdrom'/>
    <boot dev='hd'/>
    <boot dev='fd'/>
    <boot dev='network'/>
  </os>

  <memory>654321</memory>
  <vcpu>1</vcpu>

  <features>
    <pae/>
    <acpi/>
    <apic/>
  </features>

  <devices>
    <disk type='file' device='cdrom'>
      <source file='/home/user/Downloads/slax-6.0.9.iso'/>
      <target dev='hdc'/>
      <readonly/>
    </disk>

    <disk type='file' device='disk'>
      <source file='/home/user/tmp/vbox.vdi'/>
      <target dev='hdd'/>
    </disk>

    <disk type='file' device='floppy'>
      <source file='/home/user/tmp/WIN98C.IMG'/>
      <target dev='fda'/>
    </disk>

    <filesystem type='mount'>
      <source dir='/home/user/stuff'/>
      <target dir='my-shared-folder'/>
    </filesystem>

    <!--BRIDGE-->
    <interface type='bridge'>
      <source bridge='eth0'/>
      <mac address='00:16:3e:5d:c7:9e'/>
      <model type='am79c973'/>
    </interface>

    <!--NAT-->
    <interface type='user'>
      <mac address='56:16:3e:5d:c7:9e'/>
      <model type='82540eM'/>
    </interface>

    <sound model='sb16'/>

    <parallel type='dev'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
    </parallel>

    <parallel type='dev'>
      <source path='/dev/pts/2'/>
      <target port='1'/>
    </parallel>

    <serial type="dev">
      <source path="/dev/ttyS0"/>
      <target port="0"/>
    </serial>

    <serial type="pipe">
      <source path="/tmp/serial.txt"/>
      <target port="1"/>
    </serial>

    <hostdev mode='subsystem' type='usb'>
      <source>
        <vendor id='0x1234'/>
        <product id='0xbeef'/>
      </source>
    </hostdev>

    <hostdev mode='subsystem' type='usb'>
      <source>
        <vendor id='0x4321'/>
        <product id='0xfeeb'/>
      </source>
    </hostdev>
  </devices>
</domain>

これをシステムのファイル(たとえば)に保存し、my.xmlそれを使用してvirshインポートします。

$ virsh create my.xml

メモ:libvirtデーモンドライバもインストールする必要があります。 Fedora 20は次のパッケージにありますlibvirt-daemon-driver-vboxlibvirt-daemonインターフェースと共にこれが必要になるでしょうlibvirt-daemon-driver-interface。 ArchLinuxには、これらの機能を提供する同様のパッケージがあるとします。

引用する

KVM/Virsh - Ubuntu ドキュメント

おすすめ記事