1virt-ls(1) Virtualization Support virt-ls(1)
2
3
4
6 virt-ls - List files in a virtual machine
7
9 virt-ls [--options] -d domname directory [directory ...]
10
11 virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory ...]
12
13 Old style:
14
15 virt-ls [--options] domname directory
16
17 virt-ls [--options] disk.img [disk.img ...] directory
18
20 "virt-ls" is a command line tool to list the names of files in a
21 directory inside a virtual machine or disk image.
22
23 Multiple directory names can be given, in which case the output from
24 each is concatenated.
25
26 "virt-ls" is just a simple wrapper around libguestfs(3) functionality.
27 For more complex cases you should look at the guestfish(1) tool.
28
29 To list directories from a libvirt guest use the -d option to specify
30 the name of the guest. For a disk image, use the -a option.
31
32 "virt-ls" can be used in one of three modes: simple, long and
33 recursive. A simple listing is like the ordinary ls(1) command:
34
35 $ virt-ls -d myguest /
36 bin
37 boot
38 [etc.]
39
40 With the "-l" ("--long") option, "virt-ls" shows more detail:
41
42 $ virt-ls -l -d myguest /
43 total 204
44 dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin
45 dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot
46 [etc.]
47
48 With the "-R" ("--recursive") option, "virt-ls" lists the names of
49 files and directories recursively:
50
51 $ virt-ls -R -d myguest /tmp
52 foo
53 foo/bar
54 [etc.]
55
56 You cannot combine these options. To do more complicated things, use
57 guestfish(1).
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-ls 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-ls --format=raw -a disk.img /dir
100
101 forces raw format (no auto-detection) for "disk.img".
102
103 virt-ls --format=raw -a disk.img --format -a another.img /dir
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 -l | --long
117 -R | --recursive
118 Select the mode. With neither of these options, "virt-ls" produces
119 a simple, flat list of the files in the named directory.
120
121 "virt-ls -l" produces a "long listing", which shows more detail
122 (just like the plain "ls -l" command).
123
124 "virt-ls -R" produces a recursive list of files starting at the
125 named directory. See the documentation for "guestfs_find0" in
126 guestfs(3) for precise details.
127
128 You cannot combine these options.
129
130 -v
131 --verbose
132 Enable verbose messages for debugging.
133
134 -V
135 --version
136 Display version number and exit.
137
138 -x Enable tracing of libguestfs API calls.
139
141 Previous versions of virt-ls allowed you to write either:
142
143 virt-ls disk.img [disk.img ...] /dir
144
145 or
146
147 virt-ls guestname /dir
148
149 whereas in this version you should use -a or -d respectively to avoid
150 the confusing case where a disk image might have the same name as a
151 guest.
152
153 For compatibility the old style is still supported.
154
156 Libvirt guest names can contain arbitrary characters, some of which
157 have meaning to the shell such as "#" and space. You may need to quote
158 or escape these characters on the command line. See the shell manual
159 page sh(1) for details.
160
162 guestfs(3), guestfish(1), virt-cat(1), virt-tar(1), Sys::Guestfs(3),
163 Sys::Guestfs::Lib(3), Sys::Virt(3), <http://libguestfs.org/>.
164
166 Richard W.M. Jones <http://people.redhat.com/~rjones/>
167
169 Copyright (C) 2009 Red Hat Inc.
170
171 This program is free software; you can redistribute it and/or modify it
172 under the terms of the GNU General Public License as published by the
173 Free Software Foundation; either version 2 of the License, or (at your
174 option) any later version.
175
176 This program is distributed in the hope that it will be useful, but
177 WITHOUT ANY WARRANTY; without even the implied warranty of
178 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
179 General Public License for more details.
180
181 You should have received a copy of the GNU General Public License along
182 with this program; if not, write to the Free Software Foundation, Inc.,
183 675 Mass Ave, Cambridge, MA 02139, USA.
184
185
186
187libguestfs-1.8.15 2011-11-10 virt-ls(1)