qubes-doc/user/how-to-guides/how-to-copy-from-dom0.md

86 lines
3.3 KiB
Markdown
Raw Normal View History

2011-04-07 09:13:39 -04:00
---
lang: en
2015-04-10 16:17:45 -04:00
layout: doc
permalink: /doc/how-to-copy-from-dom0/
redirect_from:
- /doc/copy-from-dom0/
2016-04-14 18:34:59 -04:00
- /doc/copy-to-dom0/
- /en/doc/copy-to-dom0/
- /doc/CopyToDomZero/
- /wiki/CopyToDomZero/
ref: 198
2021-07-08 21:06:41 -04:00
title: How to copy from dom0
2011-04-07 09:13:39 -04:00
---
2020-11-16 06:54:14 -05:00
This page covers copying files and clipboard text between [dom0](/doc/glossary/#dom0) and [domUs](/doc/glossary/#domu).
2021-06-17 10:01:53 -04:00
Since dom0 is special, the processes are different from [copying and pasting text between qubes](/doc/how-to-copy-and-paste-text/) and [copying and moving files between qubes](/doc/how-to-copy-and-move-files/).
2012-05-02 06:05:32 -04:00
2020-11-16 06:54:14 -05:00
## Copying **from** dom0
2012-05-02 06:05:32 -04:00
2020-11-16 06:54:14 -05:00
### Copying files from dom0
2012-05-02 06:05:32 -04:00
2020-11-16 06:54:14 -05:00
To copy a file from dom0 to a VM, simply use `qvm-copy-to-vm`:
```
qvm-copy-to-vm <target_vm> <file>
```
2020-11-16 06:54:14 -05:00
The file will arrive in the target VM in the `/home/user/QubesIncoming/dom0/` directory.
### Copying and pasting clipboard text from dom0
Use the **Qubes Clipboard** widget:
1. Copy text to the clipboard normally in dom0 (e.g., by pressing Ctrl+C).
2. Click the **Qubes Clipboard** icon in the Notification Area.
3. Click "Copy dom0 clipboard".
This displays a notification that text has been copied to the inter-qube clipboard.
4. Press Ctrl+Shift+V in the target qube.
This pastes the inter-qube clipboard contents into the target qube's normal clipboard.
5. Paste normally within that qube (e.g., by pressing Shift+V).
Alternatively, you can put your text in a file, then [copy it as a file](#copying-files-from-dom0).
Or, you can write the data you wish to copy into `/var/run/qubes/qubes-clipboard.bin`, then `echo -n dom0 > /var/run/qubes/qubes-clipboard.bin.source`.
Then use Ctrl+Shift+V to paste the data to the target qube.
### Copying logs from dom0
2018-02-12 07:54:01 -05:00
In order to easily copy/paste the contents of logs from dom0 to the inter-VM clipboard, you can simply:
2020-11-16 06:54:14 -05:00
1. Right-click on the desired qube in the Qube Manager.
2020-11-16 06:54:14 -05:00
2. Click "Logs."
2020-11-16 06:54:14 -05:00
3. Click on the desired log.
2020-11-16 06:54:14 -05:00
4. Click "Copy to Qubes clipboard."
2020-11-16 06:54:14 -05:00
You may now paste the log contents in qube as you normally would (e.g., Ctrl+Shift+V, then Ctrl+V).
2020-11-16 06:54:14 -05:00
## Copying **to** dom0
Copying anything into dom0 is not advised, since doing so can compromise the security of your Qubes system.
2020-11-16 06:54:14 -05:00
For this reason, there is no simple means of copying anything into dom0, unlike [copying from dom0](#copying-from-dom0).
2020-11-16 06:54:14 -05:00
There should normally be few reasons for the user to want to copy anything from domUs to dom0, as dom0 only acts as a "thin trusted terminal", and no user applications run there.
Sometimes, new users feel the urge to copy a desktop wallpaper image into dom0, but that is not necessary.
A safer approach is simply to display the image in [full-screen mode](/doc/full-screen-mode/) in an app qube, then take a screenshot from dom0, which results in exactly the image needed for a wallpaper, created securely and natively in dom0.
If you are determined to copy some files to dom0 anyway, you can use the following method.
(If you want to copy text, first save it into a text file.)
Run this command in a dom0 terminal:
```
qvm-run --pass-io <src-vm> 'cat /path/to/file_in_src_domain' > /path/to/file_name_in_dom0
```
2020-11-16 06:54:14 -05:00
Note that you can use the same method to copy files from dom0 to domUs (if, for some reason, you don't want to use `qvm-copy-to-vm`):
```
cat /path/to/file_in_dom0 | qvm-run --pass-io <dest-vm> 'cat > /path/to/file_name_in_appvm'
```