VBoxManage:如何取得VM的運行時資訊/統計數據

VBoxManage:如何取得VM的運行時資訊/統計數據

我想知道自 VM 啟動以來讀取/寫入的位元組數。
它可以在 VirtualBox GUI 的選單中 Machine -> Session Information顯示一個簡潔的窗口,其中包含我需要的資訊:

在此輸入影像描述

但我找不到用 VBoxManage 做同樣事情的方法。
似乎metrics也沒有guestproperty提供統計數據。
debugvm info 看起來很有希望,它產生了很多神秘的數據,但不是我正在尋找的數據。不過我可能錯過了什麼。
我基本上對磁碟 IO 統計數據感興趣,但了解網路統計數據也很好

答案1

嗯,我自己已經想出來了。答案是debugvm statistics
它輸出 xml,但為了簡單起見,我將使用 grep:

MinGW$ VBoxManage debugvm $MY_VM statistics | grep name=\"/Devices.\*Bytes\"
<Counter c="1184613888" unit="bytes" vis="used" name="/Devices/AHCI0/Port0/ReadBytes"/>
<Counter c="331036672" unit="bytes" vis="used" name="/Devices/AHCI0/Port0/WrittenBytes"/>
<Counter c="184550400" unit="bytes" vis="used" name="/Devices/AHCI0/Port1/ReadBytes"/>
<Counter c="396939264" unit="bytes" vis="used" name="/Devices/AHCI0/Port1/WrittenBytes"/>
<Counter c="1079296" unit="bytes" vis="used" name="/Devices/AHCI0/Port2/ReadBytes"/>
<Counter c="331808713" unit="bytes" name="/Devices/E1k0/ReceiveBytes"/>
<Counter c="19335791" unit="bytes" name="/Devices/E1k0/TransmitBytes"/>

AHCI名稱中帶有 SATA 磁碟的條目,E1k0顯然是網路適配器

相關內容