qubes-doc/user/common-tasks/copying-files.md

68 lines
3.7 KiB
Markdown
Raw Normal View History

2011-04-10 08:52:59 -04:00
---
lang: en
2015-04-10 16:17:45 -04:00
layout: doc
permalink: /doc/copying-files/
redirect_from:
- /en/doc/copying-files/
- /doc/CopyingFiles/
- /wiki/CopyingFiles/
ref: 191
title: Copying and moving files between qubes
2011-04-10 08:52:59 -04:00
---
2020-11-16 06:54:14 -05:00
Copying and moving files between qubes
======================================
2011-04-10 09:11:54 -04:00
2020-11-16 06:54:14 -05:00
*This page is about copying and moving files.
If you wish to simply copy and paste text, that can be done more easily using the inter-qube clipboard.
See [copying and pasting text between qubes](/doc/copy-paste/).
For dom0, see [copying from (and to) dom0](/doc/copy-from-dom0/).*
2020-11-16 06:54:14 -05:00
Qubes OS supports the secure copying and moving of files and directories (folders) between qubes.
2011-04-10 09:11:54 -04:00
2020-11-16 06:54:14 -05:00
For simplicity, these instructions will refer to copying/moving a single file, but they apply equally well to groups of files and directories, which are copied recursively.
2014-09-02 07:53:07 -04:00
2020-11-16 06:54:14 -05:00
1. Open a file manager in the qube containing the file you wish to copy (the source qube), right-click on the file you wish to copy or move, and select `Copy to Other AppVM...` or `Move to Other AppVM...`.
2011-04-10 09:11:54 -04:00
2020-11-16 06:54:14 -05:00
2. A dialog box will appear in dom0 asking for the name of the target qube (qube B).
Enter or select the desired destination qube name.
2011-04-10 09:11:54 -04:00
2020-11-16 06:54:14 -05:00
3. If the target qube is not already running, it will be started automatically, and the file will be copied there.
It will show up in this directory (which will automatically be created if it does not already exist):
2011-04-10 09:11:54 -04:00
2020-11-16 06:54:14 -05:00
/home/user/QubesIncoming/<source_qube>/<filename>
2018-01-18 21:19:21 -05:00
2020-11-16 06:54:14 -05:00
If you selected **Move** rather than **Copy**, the original file in the source qube will be deleted.
(Moving a file is equivalent to copying the file, then deleting the original.)
2011-04-10 09:11:54 -04:00
2020-11-16 06:54:14 -05:00
4. If you wish, you may now move the file in the target qube to a different directory and delete the `/home/user/QubesIncoming/` directory when no longer needed.
2011-04-10 09:11:54 -04:00
2020-11-16 06:54:14 -05:00
The same operations are also available via these command-line tools:
2014-09-02 07:53:07 -04:00
2018-01-18 21:19:21 -05:00
```
qvm-copy [--without-progress] file [file]+
2018-01-18 21:19:21 -05:00
```
2018-01-18 21:19:21 -05:00
```
qvm-move [--without-progress] file [file]+
2018-01-18 21:19:21 -05:00
```
2020-11-16 06:54:14 -05:00
Security
--------
2020-11-16 06:54:14 -05:00
The inter-qube file copy system is secure because it doesn't allow other qubes to steal the files that are being copied, and it doesn't allow the source qube to overwrite arbitrary files on the destination qube.
Moreover, this system doesn't use any sort of virtual block device for file copy.
Instead, we use Xen shared memory, which eliminates a lot of processing of untrusted data.
For example, the receiving qube is *not* forced to parse untrusted partitions or file systems.
2020-11-16 06:54:14 -05:00
In this respect, the inter-qube file copy system provides even more security than file copy between two physically separated (air-gapped) machines!
(See [Software compartmentalization vs. physical separation](https://invisiblethingslab.com/resources/2014/Software_compartmentalization_vs_physical_separation.pdf) for more on this.)
2011-04-10 08:52:59 -04:00
2020-11-16 06:54:14 -05:00
However, one should keep in mind that performing a data transfer from *less trusted* to *more trusted* qubes is always potentially insecure if the data will be parsed in the target qube.
This is because the data that we copy could try to exploit some hypothetical bug in software running in the target qube.
For example, a seemingly-innocent JPEG that we copy from an untrusted qube might contain a specially-crafted exploit for a bug in a JPEG-parsing application in the target qube.
This is a general problem and applies to any data transfer from *less trusted* to *more trusted* qubes.
It even applies to the scenario of copying files between air-gapped machines.
2020-11-16 06:54:14 -05:00
Therefore, you should always copy data only from *more trusted* to *less trusted* qubes.
2011-04-10 10:03:52 -04:00
See also [this article](https://blog.invisiblethings.org/2011/03/13/partitioning-my-digital-life-into.html) for more information on this topic, and some ideas of how we might solve this problem in some future version of Qubes.