virt-tail(1)
π virt-tail β the manual page, but make it make sense
okay so bestie, welcome to virt-tail(1) from the Virtualization Support section. this is me explaining it to you in the group chat voice, but every single fact is staying, no cap. π«Ά
β¨ NAME β¨
virt-tail β follow (tail) files inside a virtual machine. yes, like tail -f but the files live in the guest. iconic behavior honestly. π
πΈ SYNOPSIS πΈ
virt-tail [--options] -d domname file [file ...]
virt-tail [--options] -a disk.img [-a disk.img ...] file [file ...]
π¦ DESCRIPTION π¦
virt-tail is a command line tool that follows (tails) the contents of file, where file exists in the named virtual machine (or disk image). it's basically the ordinary command tail -f, but make it virtualization. β¨
you can give it multiple filenames, and in that case each one is followed separately. every filename has to be a full path, starting at the root directory (so it starts with /). no shortcuts, bestie, full path only.
the command keeps running until:
- the user presses ^C or an interrupt signal is received.
- none of the listed files was found in the guest, or they all get deleted.
- there is an unrecoverable error.
so yeah, it doesn't just run forever for the vibes β those three things will end it. π
π EXAMPLE π
Follow /var/log/messages inside a virtual machine called mydomain:
virt-tail -d mydomain /var/log/messages
look at her go. π
β¨ OPTIONS β¨
--helpβ display brief help. short and sweet.-afile,--addfile β add file, which should be a disk image from a virtual machine. if the virtual machine has multiple block devices, you must supply all of them with separate-aoptions. yes, all of them.
the format of the disk image is auto-detected. to override this and force a particular format, use the --format=.. option.
-aURI,--addURI β add a remote disk. seeADDING REMOTE STORAGEinguestfish(1). remote slay. π--blocksize=512,--blocksize=4096,--blocksizeβ this parameter sets the sector size of the disk image. it affects all explicitly added subsequent disks after this parameter. using--blocksizewith no argument switches the disk sector size to the default value, which is usually 512 bytes. see alsoguestfs_add_drive_optsinguestfs(3).-cURI,--connectURI β if using libvirt, connect to the given URI. if omitted, then we connect to the default libvirt hypervisor.
if you specify guest block devices directly (-a), then libvirt is not used at all. like, zero libvirt. not even a little. π
-dguest,--domainguest β add all the disks from the named libvirt guest. domain UUIDs can be used instead of names. flexible queen behavior. π--echo-keysβ when prompting for keys and passphrases,virt-tailnormally turns echoing off so you cannot see what you are typing. if you are not worried about Tempest attacks and there is no one else in the room, you can specify this flag to see what you are typing.
okay but fr fr, that's a real security tradeoff, not a cute aesthetic choice. π
-f,--followβ this option is ignored.virt-tailalways behaves liketail(1) -f. you don't need to specify the-foption. it's giving "we already knew, babe". π--format=raw|qcow2|..,--formatβ the default for the-aoption is to auto-detect the format of the disk image. using this forces the disk format for-aoptions which follow on the command line. using--formatwith no argument switches back to auto-detection for subsequent-aoptions.
for example:
virt-tail --format=raw -a disk.img file
forces raw format (no auto-detection) for disk.img.
virt-tail --format=raw -a disk.img --format -a another.img file
forces raw format (no auto-detection) for disk.img and reverts to auto-detection for another.img.
if you have untrusted raw-format guest disk images, you should use this option to specify the disk format. this avoids a possible security problem with malicious guests (CVE-2010-3851). like, please actually do this. π₯
--keySELECTOR β specify a key for LUKS, to automatically open a LUKS device when using the inspection.--keyNAME:key:KEY_STRING--keyUUID:key:KEY_STRING--keyall:key:KEY_STRING
NAME is the libguestfs device name (eg. /dev/sda1). UUID is the device UUID. all means try the key against any encrypted device.
use the specified KEY_STRING as passphrase.
--keyNAME:file:FILENAME--keyUUID:file:FILENAME--keyall:file:FILENAME
read the passphrase from FILENAME.
--keyNAME:clevis--keyUUID:clevis--keyall:clevis
attempt passphrase-less unlocking for the device with Clevis, over the network. please refer to ENCRYPTED DISKS in guestfs(3) for more information on network-bound disk encryption (NBDE).
note that if any such option is present on the command line, QEMU user networking will be automatically enabled for the libguestfs appliance.
--keyNAME:error--keyUUID:error--keyall:error
any encrypted device matching will cause an error. --key all:error can be used to reject any disk image that contains an encrypted partition.
--keys-from-stdinβ read key or passphrase parameters from stdin. the default is to try to read passphrases from the user by opening/dev/tty.
if there are multiple encrypted devices then you may need to supply multiple keys on stdin, one per line.
-mdev[:mountpoint[:options[:fstype]]],--mountdev[:mountpoint[:options[:fstype]]] β mount the named partition or logical volume on the given mountpoint.
if the mountpoint is omitted, it defaults to /.
specifying any mountpoint disables the inspection of the guest and the mount of its root and all of its mountpoints, so make sure to mount all the mountpoints needed to work with the filenames given as arguments. like, all of them, or your paths won't resolve and you'll be sad. π
if you don't know what filesystems a disk image contains, you can either run guestfish without this option, then list the partitions, filesystems and LVs available (see list-partitions, list-filesystems and lvs commands), or you can use the virt-filesystems(1) program.
the third (and rarely used) part of the mount parameter is the list of mount options used to mount the underlying filesystem. if this is not given, then the mount options are either the empty string or ro (the latter if the --ro flag is used). by specifying the mount options, you override this default choice. probably the only time you would use this is to enable ACLs and/or extended attributes if the filesystem can support them:
-m /dev/sda1:/:acl,user_xattr
using this flag is equivalent to using the mount-options command.
the fourth part of the parameter is the filesystem driver to use, such as ext3 or ntfs. this is rarely needed, but can be useful if multiple drivers are valid for a filesystem (eg: ext2 and ext3), or if libguestfs misidentifies a filesystem.
-v,--verboseβ enable verbose messages for debugging. she's chatty. π£οΈ-V,--versionβ display version number and exit.-xβ enable tracing of libguestfs API calls. lowkey the best way to see what's actually happening. π
π§ LOG FILES π§
to list out the log files from guests, see the related tool virt-log(1). it understands binary log formats such as the systemd journal. different tool, different vibe, same family. π
πͺ WINDOWS PATHS πͺ
virt-tail has a limited ability to understand Windows drive letters and paths (eg. E:\foo\bar.txt).
if and only if the guest is running Windows then:
- drive letter prefixes like
C:are resolved against the Windows Registry to the correct filesystem. - any backslash (
\) characters in the path are replaced with forward slashes so that libguestfs can process it. - the path is resolved case insensitively to locate the file that should be displayed.
there are some known shortcomings:
- some NTFS symbolic links may not be followed correctly.
- NTFS junction points that cross filesystems are not followed.
so like, mostly works, but not a full Windows-whisperer. manage expectations bestie. π«Ά
β EXIT STATUS β
this program returns 0 if successful, or non-zero if there was an error. simple as that. π
π SEE ALSO π
guestfs(3), guestfish(1), virt-copy-out(1), virt-cat(1), virt-log(1), virt-tar-out(1), tail(1), http://libguestfs.org/.
the whole friend group, honestly. π
πΈ AUTHOR πΈ
Richard W.M. Jones http://people.redhat.com/~rjones/
π COPYRIGHT π
Copyright (C) 2016 Red Hat Inc.
π LICENSE π
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
that's the legal bit, and it means it. no cap. βοΈ
π BUGS π
to get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
to report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
when reporting a bug, please supply:
- the version of libguestfs.
- where you got libguestfs (eg. which Linux distro, compiled from source, etc)
- describe the bug accurately and give a way to reproduce it.
- run
libguestfs-test-tool(1)and paste the complete, unedited output into the bug report.
unedited means unedited, bestie. don't trim it for the aesthetic. the whole thing. π₯
and that's the page!! this is guestfs-tools-1.57.3, dated 2026-09-16, and honestly she ate. go follow some logs. π β¨π¦
π¦ where this page comes from
- centos-stream 10: guestfs-tools 1.57.3-1.el10 Β· GPL-2.0-or-later AND LGPL-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