Langue: en

Version: 2010-09-16 (fedora - 01/12/10)

Section: 1 (Commandes utilisateur)


virt-cat - Display a file in a virtual machine


  virt-cat [--options] domname file
  virt-cat [--options] disk.img [disk.img ...] file


"virt-cat" is a command line tool to display the contents of "file" where "file" exists in the named virtual machine (or disk image).

"virt-cat" can be used to quickly view a single file. To edit a file, use "virt-edit". For more complex cases you should look at the guestfish(1) tool.


Display "/etc/fstab" file from inside the libvirt VM called "mydomain":
  virt-cat mydomain /etc/fstab

List syslog messages from a VM:

  virt-cat mydomain /var/log/messages | tail

Find out what DHCP IP address a VM acquired:

  virt-cat mydomain /var/log/messages | grep 'dhclient: bound to' | tail

Find out what packages were recently installed:

  virt-cat mydomain /var/log/yum.log | tail

Find out who is logged on inside a virtual machine:

  virt-cat mydomain /var/run/utmp > /tmp/utmp
  who /tmp/utmp

or who was logged on:

  virt-cat mydomain /var/log/wtmp > /tmp/wtmp
  last -f /tmp/wtmp


Display brief help.
Display version number and exit.
--connect URI | -c URI
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, then libvirt is not used at all.


guestfs(3), guestfish(1), virt-edit(1), Sys::Guestfs(3), Sys::Guestfs::Lib(3), Sys::Virt(3), <>.


Richard W.M. Jones <> Copyright (C) 2009 Red Hat Inc.

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.