virt-copy-in(1)
π virt-copy-in β bestie edition β¨
okay so welcome to virt-copy-in(1) from the libguestfs fam π β the little tool that yeets files from your laptop straight into a virtual machine's disk image. iykyk.
πΈ NAME πΈ
virt-copy-in β copy files and directories into a virtual machine disk image. that's it. that's the whole job. slay. π
β¨ SYNOPSIS β¨
virt-copy-in -a disk.img file|dir [file|dir ...] /destination
virt-copy-in -d domain file|dir [file|dir ...] /destination
two vibes, same energy: point it at a raw disk image with -a, or at a named libvirt domain with -d. π¦
π WARNING π
bestie. listen to me. running virt-copy-in on live virtual machines, or at the same time as other disk editing tools, is genuinely dangerous and can corrupt your disk. not cute. not slay. π the VM must be shut down before you use this command, and disk images must not be edited concurrently. no cap.
π DESCRIPTION π
virt-copy-in copies files and directories from your local disk into a virtual machine disk image β or into a named libvirt domain. π
you can hand it one or more filenames and directories on the command line, and directories get copied in recursively (the way that it just keeps going, obsessed). the final parameter has to be the destination directory inside the disk image, and it must be an absolute path starting with a / character. periodt. β
π EXAMPLES π
update /etc/resolv.conf in a guest
virt-copy-in -d MyGuest resolv.conf /etc
upload a home directory to a guest
virt-copy-in -d MyGuest skel /home
both iconic, both take two seconds, both make you look like you know what you're doing π«Ά
π§ JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH π§
real talk: this command is literally just a simple shell script wrapper around the guestfish(1) copy-in command. that's the whole tea β. so if you want to do anything more complex than a trivial copy, you're probably better off using guestfish directly β she has range, she has main character energy, she can do it all. π
π₯ OPTIONS π₯
since the shell script just passes options straight to guestfish, go read guestfish(1) to see the full list of options. i'm not gatekeeping β there's just literally nothing extra here, the whole flag menu lives over there. π
-a disk.imgβ point at a disk image (straight from the synopsis, bestie)-d domainβ point at a named libvirt domain instead
and for everything else: guestfish(1). fr fr.
π SEE ALSO π
guestfish(1)virt-cat(1)virt-copy-out(1)virt-edit(1)virt-tar-in(1)virt-tar-out(1)http://libguestfs.org/
the whole friend group π
π AUTHORS π
Richard W.M. Jones (rjones at redhat dot com) β the icon who wrote it β¨
πΈ COPYRIGHT πΈ
Copyright (C) 2011-2025 Red Hat Inc.
π¦ LICENSE π¦
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
(translation: it's free, it's open, and if it breaks, it breaks without a warranty β read the actual license for the real legal tea π)
π BUGS π
got a bug to report? here's where to go:
to get a list of bugs against libguestfs:
https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
to report a new bug against libguestfs:
https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
when reporting a bug, please supply:
- The version of libguestfs.
- Where you got libguestfs (eg. which Linux distro, compiled from source, etc)
- Describe the bug accurately and give a way to reproduce it.
- Run
libguestfs-test-tool(1)and paste the complete, unedited output into the bug report.
(that last one matters β paste it complete and unedited, no filtering, no "i cleaned it up for you" π)
<div align="center">β π xoxo, this page was brought to you by libguestfs-1.61.3, dated 2026-09-16 β go copy some files into a VM, bestie, you got this πβ¨</div>
π¦ where this page comes from
- centos-stream 10: libguestfs 1:1.61.3-1.el10 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms