1virt-cat(1) Virtualization Support virt-cat(1)
2
3
4
6 virt-cat - Display files in a virtual machine
7
9 virt-cat [--options] -d domname file [file ...]
10
11 virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]
12
13 Old-style:
14
15 virt-cat domname file
16
17 virt-cat disk.img file
18
20 "virt-cat" is a command line tool to display the contents of "file"
21 where "file" exists in the named virtual machine (or disk image).
22
23 Multiple filenames can be given, in which case they are concatenated
24 together. Each filename must be a full path, starting at the root
25 directory (starting with '/').
26
27 "virt-cat" can be used to quickly view a file. To edit a file, use
28 "virt-edit". For more complex cases you should look at the
29 guestfish(1) tool (see "USING GUESTFISH" below).
30
32 Display "/etc/fstab" file from inside the libvirt VM called "mydomain":
33
34 virt-cat -d mydomain /etc/fstab
35
36 List syslog messages from a VM disk image file:
37
38 virt-cat -a disk.img /var/log/messages | tail
39
40 Find out what DHCP IP address a VM acquired:
41
42 virt-cat -d mydomain /var/log/messages | \
43 grep 'dhclient: bound to' | tail
44
45 Find out what packages were recently installed:
46
47 virt-cat -d mydomain /var/log/yum.log | tail
48
49 Find out who is logged on inside a virtual machine:
50
51 virt-cat -d mydomain /var/run/utmp > /tmp/utmp
52 who /tmp/utmp
53
54 or who was logged on:
55
56 virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp
57 last -f /tmp/wtmp
58
60 --help
61 Display brief help.
62
63 -a file
64 --add file
65 Add file which should be a disk image from a virtual machine. If
66 the virtual machine has multiple block devices, you must supply all
67 of them with separate -a options.
68
69 The format of the disk image is auto-detected. To override this
70 and force a particular format use the --format=.. option.
71
72 -c URI
73 --connect URI
74 If using libvirt, connect to the given URI. If omitted, then we
75 connect to the default libvirt hypervisor.
76
77 If you specify guest block devices directly (-a), then libvirt is
78 not used at all.
79
80 -d guest
81 --domain guest
82 Add all the disks from the named libvirt guest.
83
84 --echo-keys
85 When prompting for keys and passphrases, virt-cat normally turns
86 echoing off so you cannot see what you are typing. If you are not
87 worried about Tempest attacks and there is no one else in the room
88 you can specify this flag to see what you are typing.
89
90 --format=raw|qcow2|..
91 --format
92 The default for the -a option is to auto-detect the format of the
93 disk image. Using this forces the disk format for -a options which
94 follow on the command line. Using --format with no argument
95 switches back to auto-detection for subsequent -a options.
96
97 For example:
98
99 virt-cat --format=raw -a disk.img file
100
101 forces raw format (no auto-detection) for "disk.img".
102
103 virt-cat --format=raw -a disk.img --format -a another.img file
104
105 forces raw format (no auto-detection) for "disk.img" and reverts to
106 auto-detection for "another.img".
107
108 If you have untrusted raw-format guest disk images, you should use
109 this option to specify the disk format. This avoids a possible
110 security problem with malicious guests (CVE-2010-3851).
111
112 --keys-from-stdin
113 Read key or passphrase parameters from stdin. The default is to
114 try to read passphrases from the user by opening "/dev/tty".
115
116 -v
117 --verbose
118 Enable verbose messages for debugging.
119
120 -V
121 --version
122 Display version number and exit.
123
124 -x Enable tracing of libguestfs API calls.
125
127 Previous versions of virt-cat allowed you to write either:
128
129 virt-cat disk.img [disk.img ...] file
130
131 or
132
133 virt-cat guestname file
134
135 whereas in this version you should use -a or -d respectively to avoid
136 the confusing case where a disk image might have the same name as a
137 guest.
138
139 For compatibility the old style is still supported.
140
142 guestfish(1) is a more powerful, lower level tool which you can use
143 when "virt-cat" doesn't work.
144
145 Using "virt-cat" is approximately equivalent to doing:
146
147 guestfish --ro -i -d domname download file -
148
149 where "domname" is the name of the libvirt guest, and "file" is the
150 full path to the file. Note the final "-" (meaning "output to
151 stdout").
152
153 The command above uses libguestfs's guest inspection feature and so
154 does not work on guests that libguestfs cannot inspect, or on things
155 like arbitrary disk images that don't contain guests. To display a
156 file from a disk image directly, use:
157
158 guestfish --ro -a disk.img -m /dev/sda1 download file -
159
160 where "disk.img" is the disk image, "/dev/sda1" is the filesystem
161 within the disk image to edit, and "file" is the full path to the file.
162
164 Libvirt guest names can contain arbitrary characters, some of which
165 have meaning to the shell such as "#" and space. You may need to quote
166 or escape these characters on the command line. See the shell manual
167 page sh(1) for details.
168
170 guestfs(3), guestfish(1), virt-edit(1), <http://libguestfs.org/>.
171
173 Richard W.M. Jones <http://people.redhat.com/~rjones/>
174
176 Copyright (C) 2010-2011 Red Hat Inc.
177
178 This program is free software; you can redistribute it and/or modify it
179 under the terms of the GNU General Public License as published by the
180 Free Software Foundation; either version 2 of the License, or (at your
181 option) any later version.
182
183 This program is distributed in the hope that it will be useful, but
184 WITHOUT ANY WARRANTY; without even the implied warranty of
185 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
186 General Public License for more details.
187
188 You should have received a copy of the GNU General Public License along
189 with this program; if not, write to the Free Software Foundation, Inc.,
190 675 Mass Ave, Cambridge, MA 02139, USA.
191
192
193
194libguestfs-1.8.15 2011-11-10 virt-cat(1)