In libguestfs ≥ 1.27.17, there’s a new tool called virt-log for displaying the log files from a disk image or virtual machine:
$ virt-log -a disk.img | less
Previously you could write:
$ virt-cat -a disk.img /var/log/messages
That worked for some Linux guests, but several things happened:
- The binary systemd journal
- The command above doesn’t work on Debian guests (you need to use
/var/log/syslog
) - Windows uses the Windows Event Log
Virt-log is designed to do the right thing automatically (although at the moment Windows support is not finished). In particular it will automatically decode and display the systemd journal, and it knows the different locations that some Linux distros store their plain text log files.