Author Topic: KVM仮想環境でのAVASTフリー版をインストールするとフリーズ  (Read 5143 times)

0 Members and 1 Guest are viewing this topic.

REDACTED

  • Guest
ubuntu 15.04のKVM仮想環境へAVASTフリー版(最新版)をインストールすると仮想環境ごとフリーズして
ベアマシンの再起動が必要となる。

ただし、HostOSのkernelを3.19.8にするとフリーズせずに正常起動できる、また、マザーボードをAsrock z77 Extrem4、CPUをCorei7 3770Sの
環境ではフリーズせず

マザーボード:asrock z97 Extrem6
CPU:Corei7 4970(Haswll)
HostOS:ubuntu 15.04
kernel:4.1.2
qemu-kvm:1:2.3+dfsg-5ubuntu2
libvirt:1.2.12-0ubuntu14.1

GustOS:Windows8.1,Wndows10

root@yoshi-kvm01:/etc/libvirt/qemu# cat WinPC01_Win10.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit WinPC01_Win10
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>WinPC01_Win10</name>
  <uuid>885fdf58-a504-4bef-8aef-be58343c1853</uuid>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-utopic'>hvm</type>
    <loader type='rom'>OVMF.fd</loader>
    <bootmenu enable='yes'/>
    <smbios mode='host'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
    <kvm>
      <hidden state='on'/>
    </kvm>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Haswell</model>
    <vendor>Intel</vendor>
    <topology sockets='1' cores='4' threads='1'/>
    <feature policy='require' name='vme'/>
    <feature policy='require' name='dtes64'/>
    <feature policy='require' name='vmx'/>
    <feature policy='require' name='xtpr'/>
    <feature policy='require' name='est'/>
    <feature policy='require' name='monitor'/>
    <feature policy='require' name='smx'/>
    <feature policy='require' name='abm'/>
    <feature policy='require' name='tm'/>
    <feature policy='require' name='acpi'/>
    <feature policy='require' name='ht'/>
    <feature policy='require' name='pdcm'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='f16c'/>
    <feature policy='require' name='ds'/>
    <feature policy='require' name='invtsc'/>
    <feature policy='require' name='tm2'/>
    <feature policy='require' name='ss'/>
    <feature policy='require' name='pbe'/>
    <feature policy='require' name='ds_cpl'/>
    <feature policy='require' name='rdrand'/>
    <feature policy='force' name='cx16'/>
    <feature policy='force' name='lahf_lm'/>
    <feature policy='disable' name='xsave'/>
    <feature policy='disable' name='osxsave'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/mapper/vg_yoshi--kvm01_hdd-lv_WinPC01_Win10'/>
      <target dev='vda' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/mapper/vg_yoshi--kvm01_hdd-lv_WinPC01_Data'/>
      <target dev='vdb' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/media/smb/download/Windows/Windows10/Windows10_InsiderPreview_x64_JA-JP_10162.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:0e:ca:c5'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='bridge'>
      <mac address='52:54:00:7e:4e:dd'/>
      <source bridge='br1'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' port='5900' autoport='no' listen='0.0.0.0' keymap='ja'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x14' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x1d' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </hostdev>
    <redirdev bus='usb' type='spicevmc'>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
    </redirdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </memballoon>
  </devices>
</domain>



マザーボード:asrock z77 Extrem4
CPU:Corei7 3770S(Ivy)
HostOS:ubuntu 15.04
kernel:4.1.2
qemu-kvm:1:2.3+dfsg-5ubuntu2
libvirt:1.2.12-0ubuntu14.1

GustOS:Windows8.1,Wndows10

root@yoshi-kvm02:/etc/libvirt/qemu# cat KvmPC01.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit KvmPC01
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>KvmPC01</name>
  <uuid>cd981219-ec93-43f2-8a5a-0135e420d33d</uuid>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>
    <loader type='rom'>OVMF.fd</loader>
    <bootmenu enable='yes'/>
    <smbios mode='host'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
    <kvm>
      <hidden state='on'/>
    </kvm>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Haswell</model>
    <topology sockets='1' cores='4' threads='1'/>
    <feature policy='force' name='cx16'/>
    <feature policy='force' name='lahf_lm'/>
    <feature policy='disable' name='xsave'/>
    <feature policy='disable' name='osxsave'/>
    <feature policy='disable' name='vme'/>
    <feature policy='disable' name='pdpe1gb'/>
    <feature policy='disable' name='fma'/>
    <feature policy='disable' name='movbe'/>
    <feature policy='disable' name='bmi1'/>
    <feature policy='disable' name='bmi2'/>
    <feature policy='disable' name='hle'/>
    <feature policy='disable' name='avx2'/>
    <feature policy='disable' name='smep'/>
    <feature policy='disable' name='invpcid'/>
    <feature policy='disable' name='rtm'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/mapper/vg_yoshi--kvm02-KvmPC01'/>
      <target dev='vda' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/etc/libvirt/iso/Windows8.1Pro.iso'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:26:67:e5'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' autoport='yes'>
      <image compression='off'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x14' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x1d' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </hostdev>
    <redirdev bus='usb' type='spicevmc'>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
    </redirdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
</domain>


Offline NON

  • Japanese User
  • Avast Überevangelist
  • Ultra Poster
  • *****
  • Posts: 5490
  • Whatever will be, will be.
こんばんは masato2 さん


Avastには、VirtualBoxの技術を使った仮想マシン機能が含まれています。そのため、そもそも仮想環境とは相性があまり良くありません。
最新のAvastではこの機能に改修が入ったようなので、その関係で相性問題が出ている可能性は大いにあります。

インストール時にカスタムインストールを選び、「セキュアバーチャルマシン」のチェックを外すと、この機能は停止しますので、これでお試しください。
Desktop: Win10 Pro 22H2 64bit / Core i5-7400 3.0GHz / 32GB RAM / Avast 23 Premium Beta(Icarus) / Comodo Firewall
Notebook: Win10 Pro 22H2 64bit / Core i5-3340M 2.7GHz / 12GB RAM / Avast 23 Free / Windows Firewall Control
Server: Win11 Pro 23H2 64bit / Core i3-4010U 1.7GHz / 12GB RAM / Avast One 23 Essential

Avast の設定について解説しています。よろしければご覧ください。

REDACTED

  • Guest
回答ありがとうございます。

KVMの設定から以下の設定(CPUのサポートフラグ)を外すことで、正常に立ち上がるようになりました。


外した設定。
    <feature policy='require' name='vme'/>
    <feature policy='require' name='dtes64'/>
    <feature policy='require' name='vmx'/>
    <feature policy='require' name='xtpr'/>
    <feature policy='require' name='est'/>
    <feature policy='require' name='monitor'/>
    <feature policy='require' name='smx'/>
    <feature policy='require' name='abm'/>
    <feature policy='require' name='tm'/>
    <feature policy='require' name='acpi'/>
    <feature policy='require' name='ht'/>
    <feature policy='require' name='pdcm'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='f16c'/>
    <feature policy='require' name='ds'/>
    <feature policy='require' name='invtsc'/>
    <feature policy='require' name='tm2'/>
    <feature policy='require' name='ss'/>
    <feature policy='require' name='pbe'/>
    <feature policy='require' name='ds_cpl'/>
    <feature policy='require' name='rdrand'/>


実際に外れたと思われる設定
    <feature policy='require' name='dtes64'/>
    <feature policy='require' name='xtpr'/>
    <feature policy='require' name='est'/>
    <feature policy='require' name='monitor'/>
    <feature policy='require' name='smx'/>
    <feature policy='require' name='abm'/>
    <feature policy='require' name='tm'/>
    <feature policy='require' name='acpi'/>
    <feature policy='require' name='ht'/>
    <feature policy='require' name='pdcm'/>
    <feature policy='require' name='ds'/>
    <feature policy='require' name='invtsc'/>
    <feature policy='require' name='tm2'/>
    <feature policy='require' name='pbe'/>
    <feature policy='require' name='ds_cpl'/>


>Avastには、VirtualBoxの技術を使った仮想マシン機能が含まれています。そのため、そもそも仮想環境とは相性があまり良くありません。

なるほど、仮想環境のネスト構成になるわけですね。

>インストール時にカスタムインストールを選び、「セキュアバーチャルマシン」のチェックを外すと、この機能は停止しますので、これでお試しください。

 製品で考えた場合、インストーラーが仮想環境へのインストールと認識した場合は、「セキュアバーチャルマシン」のインストールを行わない用にした
 ほうが良いように思えますが、そんな対応は難しのでしょうか?

 最後に一点質問になりますが、バージョンアップ時には初回インストール時の設定(今回なら「セキュアバーチャルマシン」をインストールしない)は引き継がれてアップデートインストール
 は行われるのでしょうか。

Offline NON

  • Japanese User
  • Avast Überevangelist
  • Ultra Poster
  • *****
  • Posts: 5490
  • Whatever will be, will be.
セキュアバーチャルマシンがインストールされるかどうかは、OSおよびPCの性能に依存して決定されています。
条件は随時調整されるようですが、私が最後に見た時点では、OS、ハードウェア仮想化支援機能の有無、実効搭載メモリ量の3点に依存して決定されていたと記憶しています。

メモリ量: 実効で2GB以上 (オンボードグラフィック使用PCでメモリ2GBの場合、条件を満たさない)
ハードウェア仮想化支援機能:
OSが64bit => 必須
OSが32bit かつ Windows 8以降 => 必須
OSが32bit かつ Windows 7以前 => 必須ではない

従って、masato2さんのPC (ゲストOSがWin8) では、ハードウェア仮想化支援機能が必須になります。
この場合、利用するKVM環境がゲストOSに対し仮想化支援機能を利用可能と通知するか否か、そして実際に使うに当たってはネスト仮想化に対応しているか否かで動作が変わることになります。
となると、キーは
Quote
<feature policy='require' name='vmx'/>
あたりでしょうか。


 最後に一点質問になりますが、バージョンアップ時には初回インストール時の設定(今回なら「セキュアバーチャルマシン」をインストールしない)は引き継がれてアップデートインストール
 は行われるのでしょうか。
基本的には、これらの設定は保持されたままアップデートされます。
ごく稀に、うまく設定が引き継がれない場合もあるようですが・・・
Desktop: Win10 Pro 22H2 64bit / Core i5-7400 3.0GHz / 32GB RAM / Avast 23 Premium Beta(Icarus) / Comodo Firewall
Notebook: Win10 Pro 22H2 64bit / Core i5-3340M 2.7GHz / 12GB RAM / Avast 23 Free / Windows Firewall Control
Server: Win11 Pro 23H2 64bit / Core i3-4010U 1.7GHz / 12GB RAM / Avast One 23 Essential

Avast の設定について解説しています。よろしければご覧ください。

REDACTED

  • Guest
CPUのサポートビットを元に戻して、セキュアバーチャルマシンのチェックボックスを外して再インストール
しましたが、やはりインストール時の「カーネールドライバを起動中です」と表示されるところでフリーズ
してしまいましたので、VirtualBox機能の影響ではないようです。

REDACTED

  • Guest
CPUサポートビットを変更しながら確認したところ、
<feature policy='require' name='vmx'/>
を外すことでフリーズすることがなくなりました。

上記の設定が入っていると、セキュアバーチャルマシーンのチェックボックスをオンに
しようが。オフにしようがフリーズしてしまうので、ビットが立っていると何かしら
仮想化機能が使えるかを見に行っているように思われます。

Kernel 3.xと4.xで動作が違うのは、4.xで何かしら仕様がわかってしまったことにより
想定外の動作をしていると言った所でしょうか。


Offline NON

  • Japanese User
  • Avast Überevangelist
  • Ultra Poster
  • *****
  • Posts: 5490
  • Whatever will be, will be.
確かに、Avastの仮想化機能はVirtualBoxだけではなく、セキュアバーチャルマシンが性能不足で使えない場合に機能する自前のサンドボックスにも、ハードウェア仮想化支援機能が使われています。
この設定は、設定画面 -> トラブルシューティング -> ハードウェアによる仮想化支援機能を利用する として、オプションが存在します。

VMXはIntelでいうところのVT-xに相当するので、これを外すと機械的にハードウェア仮想化支援機能は「なし」とみなされ、関連する全機能が停止すると考えられます。
仮想化と言うところで、何となくキーはVMXかなとは思っていました。

よく見ると、フリーズしないというマザーボード側のKVM設定では、VMXはオフになっていますね。
こちらでフリーズしなかったのは、ハードウェアと言うよりは、KVMの設定依存だったと思われます。
Desktop: Win10 Pro 22H2 64bit / Core i5-7400 3.0GHz / 32GB RAM / Avast 23 Premium Beta(Icarus) / Comodo Firewall
Notebook: Win10 Pro 22H2 64bit / Core i5-3340M 2.7GHz / 12GB RAM / Avast 23 Free / Windows Firewall Control
Server: Win11 Pro 23H2 64bit / Core i3-4010U 1.7GHz / 12GB RAM / Avast One 23 Essential

Avast の設定について解説しています。よろしければご覧ください。