NAME

virt-edit - Edit a file in a virtual machine


SYNOPSIS

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


WARNING

You must not use virt-edit on live virtual machines. If you do this, you risk disk corruption in the VM. virt-edit tries to stop you from doing this, but doesn't catch all cases.


DESCRIPTION

virt-edit is a command line tool to edit file where file exists in the named virtual machine (or disk image).

If you want to just view a file, use virt-cat(1). For more complex cases you should look at the guestfish(1) tool.


EXAMPLES

 virt-edit mydomain /boot/grub/grub.conf
 virt-edit mydomain /etc/passwd


OPTIONS

--help

Display brief help.

--version

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.


ENVIRONMENT VARIABLES

EDITOR

If set, this string is used as the editor. It may contain arguments, eg. "emacs -nw"

If not set, vi is used.


SEE ALSO

guestfs(3), guestfish(1), virt-cat(1), the Sys::Guestfs(3) manpage, the Sys::Guestfs::Lib(3) manpage, the Sys::Virt(3) manpage, http://libguestfs.org/.


AUTHOR

Richard W.M. Jones http://et.redhat.com/~rjones/


COPYRIGHT

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.