VIRT-TOP(1)
okay so welcome bestie to VIRT-TOP(1) β the Virtualization Support manual page, aka the group chat where virt-top explains itself. Itβs a top(1)-like utility for showing stats of virtualized domains, and it uses libvirt, so it can show stats across a whole variety of different virtualization systems. π
β¨
πΈ NAME πΈ
virt-top β 'top'-like utility for virtualization stats.
π SUMMARY π
virt-top [-options]
π¦ DESCRIPTION π¦
virt-top is a top(1)-like utility for showing stats of virtualized domains. Many keys and command line options are the same as for ordinary top.
It uses libvirt, so it is capable of showing stats across a variety of different virtualization systems. iconic behavior, honestly π
β¨ OPTIONS β¨
-1β display physical CPUs by default instead of domains.
Under each domain column, two numbers are shown. The first is the percentage of the physical CPU used by the domain and the hypervisor together. The second is the percentage used by just the domain.
When virt-top is running, use the 1 key to toggle between physical CPUs and domains display.
-2β display network interfaces by default instead of domains. Whenvirt-topis running, use the2key to toggle between network interfaces and domains display.-3β display block devices (virtual disks) by default instead of domains. Whenvirt-topis running, use the3key to toggle between block devices and domains display.-bβ batch mode. In this mode keypresses are ignored. no keyboard chaos, just vibes π-c uri,--connect uriβ connect to the libvirt URI given.- To connect to QEMU/KVM you would normally do
-c qemu:///system. - To connect to Xen on the same host, do
-c xen:///. - To connect to
libvirtdon a remote machine you would normally do-c qemu://host/system.
- To connect to QEMU/KVM you would normally do
If this option is not given then virt-top connects by default to whatever is the default hypervisor for libvirt, although this can be overridden by setting environment variables.
See the libvirt documentation at http://libvirt.org/uri.html for further information.
-d delayβ set the delay between screen updates in seconds. The default is3.0seconds. You can change this whilevirt-topis running by pressing either thesordkey.-n iterationsβ set the number of iterations to run. The default is to run continuously. forever mode is the default, bestie π-o sortβ set the sort order to one of:cpu(sort by %CPU used),mem(sort by total memory),time(sort by total time),id(sort by domain ID),name(sort by domain name),netrx(sort by network received bytes),nettx(sort by network transmitted bytes),blockrdrq(sort by block device [disk] read requests),blockwrrq(sort by block device [disk] write requests).
While virt-top is running you can change the sort order using keys P (cpu), M (memory), T (total time), N (domain ID), F (interactively select the sort field).
-sβ secure mode. Currently this does nothing. literally nothing, no cap π--hist-cpu secsβ set the time in seconds between updates of the historical %CPU at the top right of the display.--csv file.csvβ write the statistics to filefile.csv. First a header is written showing the statistics being recorded in each column, then one line is written for each screen update. The CSV file can be loaded directly by most spreadsheet programs.
Currently the statistics which this records vary between releases of virt-top (but the column headers will stay the same, so you can use those to process the CSV file).
To save space you can compress your CSV files (if your shell supports this feature, eg. bash):
virt-top --csv >(gzip -9 > output.csv.gz)
You can use a similar trick to split the CSV file up. In this example the CSV file is split every 1000 lines into files called output.csv.00, output.csv.01 etc.
virt-top --csv >(split -d -l 1000 - output.csv.)
RHEL provides a short Python script called processcsv.py which can be used to post-process the CSV output. Run it like this:
virt-top --csv data.csv
processcsv.py < data.csv
This creates or overwrites the following files in the current directory:
global.csv
domain<NNN>.csv
global.csv will contain the global data. One domain<NNN>.csv file will also be created for each domain with ID NNN, containing the per-domain data. π
--no-csv-cpuβ disable domain CPU stats in CSV output.--no-csv-memβ disable domain memory stats in CSV output.--no-csv-blockβ disable domain block device stats in CSV output.--no-csv-netβ disable domain network interface stats in CSV output.--debug filenameβ send debug and error messages tofilename. To send error messages to syslog you can do:
virt-top --debug >(logger -t virt-top)
See also REPORTING BUGS below.
--init-file filenameβ readfilenameas the init file instead of the default, which is$HOME/.virt-toprc. See also INIT FILE below.--no-init-fileβ do not read any init file.--scriptβ script mode. There will be no user interface. This is most useful when used together with the--csvand-noptions.--streamβ stream mode. All output is sent tostdout. This can be used from shell scripts etc. There is no user interface.--block-in-bytesβ show I/O statistics in Bytes. Default is shown in the number of Requests.--end-time timeβ the program will exit at the time given.
The time may be given in one of the following formats:
YYYY-MM-DD HH:MM:SSβ end time is the date and time given.HH:MM:SSβ end time is the time given, today.+HH:MM:SSβ end time isHHhours,MMminutes,SSseconds in the future (counted from the moment that program starts).+secsβ end time issecsseconds in the future.
For example to run the program for 3 minutes you could do:
virt-top --end-time +00:03:00
or:
virt-top --end-time +180
Not every version of virt-top supports this option β it depends how the program was compiled (see README file in the source distribution for details). version-dependent behavior, bestie, check your build π
--helpβ display usage summary.--versionβ display version number and exit.
π KEYS π
Note that keys are case sensitive. For example use upper-case P (shift P) to sort by %CPU. ^ before a key means a Ctrl key, so ^L is Ctrl+L.
spaceor^Lβ updates the display.qβ quits the program.hβ displays help.sordβ change the delay between screen updates.Bβ toggle Block I/O statistics so they are shown in either bytes or requests.0(number 0) β show the normal list of domains display.1(number 1) β toggle into showing physical CPUs. If pressed again toggles back to showing domains (the normal display).2β toggle into showing network interfaces. If pressed again toggles back to showing domains.3β toggle into showing block devices (virtual disks). If pressed again toggles back to showing domains.Pβ sort by %CPU.Mβ sort by total memory. Note that this shows the total memory allocated to the guest, not the memory being used. allocated β actually used, okay? πTβ sort by total time.Nβ sort by domain ID.Fβ select the sort field interactively (there are other sort fields you can choose using this key).Wβ this creates or overwrites the init file with the current settings.
This key is disabled if --no-init-file was specified on the command line or if overwrite-init-file false is given in the init file.
π INIT FILE π
When virt-top starts up, it reads initial settings from the file .virt-toprc in the userβs home directory.
The name of this file may be overridden using the --init-file filename command line option or may be disabled entirely using --no-init-file.
The init file has a simple format. Blank lines and comments beginning with # are ignored. Everything else is a set of key value pairs, described below.
display task|pcpu|block|netβ sets the major display mode to one oftask(tasks, the default),pcpu(physical CPUs),block(block devices), ornet(network interfaces).delay secsβ sets the delay between display updates in seconds.hist-cpu secsβ sets the historical CPU delay in seconds.iterations nβ sets the number of iterations to run before we exit. Setting this to-1means to run continuously.sort cpu|mem|time|id|name|...β sets the sort order. The option names are the same as for the command line-ooption.connect uriβ sets the default connection URI.debug filenameβ sets the default filename to use for debug and error messages.csv filenameβ enables CSV output to the named file.csv-cpu true|falseβ enable or disable domain CPU stats in CSV output.csv-mem true|falseβ enable or disable domain memory stats in CSV output.csv-block true|falseβ enable or disable domain block device stats in CSV output.csv-net true|falseβ enable or disable domain network interface stats in CSV output.batch true|falseβ sets batch mode.secure true|falseβ sets secure mode.script true|falseβ sets script mode.stream true|falseβ sets stream mode.block-in-bytes true|falseβ show block device statistics in bytes.end-time timeβ set the time at which the program exits. See above for the time formats supported.overwrite-init-file falseβ if set tofalsethen theWkey will not overwrite the init file.
β οΈ bug alert, bestie: note that in the current implementation, options specified in the init file override options specified on the command line. This is a bug and this behaviour may change in the future. π«Ά
π COLUMN HEADINGS π
Okay bestie, this is the legend for every single column you're gonna see on screen. Learn these and you'll be reading virt-top like it's your fave group chat π
%CPUβ Percentage of CPU used. And just like intop(1),100%means all the physical CPUs are being fully used, no cap. So yes, one guest absolutely devouring everything shows up as100%, not800%. Iconic behaviour honestly.DEVICEβ The block device name.DOMAIN,NAMEβ The name of the libvirt domain. That's your guest's whole identity fr fr.IDβ The libvirt domain ID.INTERFACEβ The network interface name.%MEMβ The percentage of host memory assigned to the guest. The way your RAM is just... gone π«PHYCPUβ The physical CPU.RDBYβ Disk bytes read since last displayed.RDRQβ Disk read requests since last displayed.RXBYβ Network bytes received since last displayed.RXPKβ Network packets received since last displayed.Sβ The state of the domain, and it's literally one of these:?β Unknown. Mystery era πRβ Running. Living her best life.Sβ Blocked.Pβ Paused. Girl is frozen mid-sentence πD,Oβ Shutdown.Xβ Crashed. Not the vibe πMβ Suspended by guest power management.
TIMEβ Total CPU time used.TXBYβ Network bytes transmitted since last displayed.TXPKβ Network packets transmitted since last displayed.WRBYβ Disk bytes written since last displayed.WRRQβ Disk write requests since last displayed.
ποΈ NOTES ποΈ
Block I/O statistics
So here's the thing that trips everyone up: this I/O value is the amount of I/O since the previous iteration of virt-top. It's a delta, not a speed, bestie β¨
To actually calculate the speed of I/O, you divide the number by delay secs. That's the whole trick. Periodt.
NETWORK RX BYTES AND PACKETS
Libvirt/virt-top has no way to know that a packet transmitted to a guest was actually received (eg. if the guest is not listening). Rude of the guest, but okay.
So in the network RX stats, virt-top reports the packets transmitted to the guest, on the basis that the guest might receive them. Hopeful queen behaviour π«Ά
In particular this includes broadcast packets. And because of the way Linux bridges work, if the guest is connected to a bridge, it will probably see a steady "background noise" of RX packets even when the network interface is idle or down. Those are caused by STP packets generated by the bridge β not your fault, not a bug, just bridge chatter π¦
DEBUGGING LIBVIRT ISSUES
virt-top tries to turn libvirt errors into informative messages, because it loves you. But if libvirt initialization fails, then that's not possible. Instead you will get an obscure error like:
libvir: error : Unknown failure
Fatal error: exception Libvirt.Virterror(...)
To see the cause of libvirt errors in more detail, enable libvirt debugging by setting this environment variable:
export LIBVIRT_DEBUG=1
Then you'll actually know what's going on. Slay π
π SEE ALSO π
top(1), virsh(1), <http://www.libvirt.org/ocaml/>, <http://www.libvirt.org/>, <http://people.redhat.com/~rjones/>, <http://caml.inria.fr/>
βοΈ AUTHORS βοΈ
Richard W.M. Jones <rjones @ redhat . com>
(Yes, with the spaces. That's literally how it's written, don't come for me π)
Β©οΈ COPYRIGHT Β©οΈ
(C) Copyright 2007-2012 Red Hat Inc., Richard W.M. Jones http://libvirt.org/
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
π REPORTING BUGS π
Bugs can be viewed on the Red Hat Bugzilla page: <https://bugzilla.redhat.com/>.
If you find a bug in virt-top, please follow these steps to report it β it's giving responsible citizen energy π
- Check for existing bug reports Go to <https://bugzilla.redhat.com/> and search for similar bugs. Someone may already have reported the same bug, and they may even have fixed it. Imagine doing all that work for nothing π«
- Capture debug and error messages Run
virt-top --debug virt-top.log
and keep virt-top.log. It contains error messages which you should submit with your bug report. Do not lose the log, bestie, it's the receipts π§Ύ
- Get version of virt-top and version of libvirt. Use:
virt-top --version
If you can get the precise version of libvirt you are using then that too is helpful. Numbers make devs happy, iykyk.
- Submit a bug report. Go to <https://bugzilla.redhat.com/> and enter a new bug. Please describe the problem in as much detail as possible.
Remember to include the version numbers (step 3) and the debug messages file (step 2). Both. Not one. Both π€
- Assign the bug to
rjones @ redhat.comAssign or reassign the bug torjones @ redhat.com(without the spaces β yes, take the spaces out here). You can also send me an email with the bug number if you want a faster response. Faster response = faster fix, and that's the dream π
okay that's the whole page, you made it to the end, I'm so proud of you π this was virt-top-1.1.2, dated 2025-10-09, and it's the VIRT-TOP(1) manual page β go forth and monitor your guests, queen ππ
π¦ where this page comes from
- centos-stream 10: virt-top 1.1.2-1.el10 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms