2016年1月6日 星期三

使用虛擬機器測試 secure boot (三) 使用 virtsh


呼叫使用提示
virsh help

顯示選項 list 的使用提示
virsh help list

連結本地端 qemu 這個 hypervisor (virsh 可以管理多種不同的 hypervisor,qemu 只是其中一種)
virsh connect qemu:///system
連進去後,
顯示 domains (但 inactive domain 不會顯示;一開始還以為沒有連成功,因為啥都沒顯示)
virsh list

顯示 domains (包括 inactive domain)
virsh list --all

立刻終止 active domain (相當於 virt-manager 下使用 force off )
virsh destroy <domain name>

刪除已經建立/定義好的 domain(要先 destroy 才可以 undefine)
virsh undefine <domain name>

virt-tools.org 這裡有簡單的教學。



virt-tools.org 的這個教學網頁裡也有提到如何透過 /proc/cpuinfo and demsg 檢查自身的機器是否支援虛擬化技術;如果有,又是哪一種虛擬化技術。簡單直白,值得一看(下面直接摘要):

/proc/cpuinfo flags #

/proc/cpuinfo will tell you if the processor supports virtualization and if it is enabled (but it could not show up in flags because it is disabled — more on this below).
The flags to look out for are:
  • vmx — Intel VT-x, basic virtualization
  • svm — AMD SVM, basic virtualization
  • ept — Extended Page Tables, an Intel feature to make emulation of guest page tables faster.
  • vpid — VPID, an Intel feature to make expensive TLB flushes unnecessary when context switching between guests.
  • npt — AMD Nested Page Tables, similar to EPT.
  • tpr_shadow and flexpriority — Intel feature that reduces calls into the hypervisor when accessing the Task Priority Register, which helps when running certain types of SMP guests.
  • vnmi — Intel Virtual NMI feature which helps with certain sorts of interrupt events in guests.

Kernel messages (dmesg) and the BIOS #

The next thing to look at are the kernel messages by running the command:
dmesg | less
The two messages to look out for are:
kvm: no hardware support
and
kvm: disabled by bios




詞彙:
hypervisor - 不精確地講,就是虛擬機器層。
domain - virtual machine instance

沒有留言:

張貼留言