Copying commands to dom0

Hello!

While i did read the documentation about copying file(s) from / to dom0, i can’t find any information about copying commands to dom0. If there is any command in the forum i’d like to try out in dom0, I’d like to avoid mistyping.

Thanks any help!

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

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'

example case :

in vault vm i have onequbesuser.asc

the command should be :

qvm-run --pass-io vault 'cat ~/pubkey/onequbesuser.asc' > ~/onequbesuser.asc
2 Likes

Thanks!

Copying text files never occured to me. Sounds like a good idea!

This is not easy by default for your safety. You should never ever paste from a website onto a terminal, especially into dom0.

3 Likes

Thanks for the warning! I had the time to think about it, and i think i will check the commands from the web (if there is any mistyping), that copy the manually typed command from dom0 and paste it to some text editor and check for deviation.

1 Like

Perfect. This way you’re following the golden rule of only copying information from more trusted domains onto less trusted ones.

2 Likes

It’s not just about avoiding typos and copying only from more trusted or less trusted domains. The actual command also matters. If you don’t understand what sudo rm -rf / is going to do, it doesn’t matter how carefully you copied it or whether you copied it by hand into dom0.

Thanks for the warning! If i’m not familiar with a command i usually read through it’s manpage (now on qubes in a disp-vm). If the manpage is not enough clear to me (there is a lot manpage which isn’t too user friendly) i’m searching google. Usually i don’t use any command i don’t unsderstand. Unfortunately there are rare exceptions.