In this post, I am going to talk about sharing data between domains. You can read part one here.
Update: Read part 3 about network isolation.
One of the most common operation while working on many domains is copy/pasting text or files. Though it is something very much necessary, at the same time this can be a security risk. Randomly copy pasting data or file into a trusted domain, can be dangerous. We also have to make sure that random scripts can not copy paste without proper authorization. Qubes uses Xen shared memory for copying files instead of any block device.
Copy pasting text
One can copy text to the clipboard of the VM as usual, and then one can press
Ctrl+Shift+c, then if one press
Ctrl+Shift+v in any VM, it will ask for a
menu like below screenshot to confirm if you want to paste to that VM’s
clipboard. After that, you can normally paste with
Ctrl+v or from the GUI.
Copying file to another VM
We can copy a file to another VM using the file browser. Just right click on any file, and click copy to the right VM. The following screenshots shows this way.
The other way to copy paste is using the command line. For example, the following command copies hello.txt file to the personal VM.
$ qvm-copy-to-vm personal hello.txt sent 0/1 KB
Executing any command on a given VM
dom0 is the privileged domain in the system. From that, you can actually execute any command to another domain. In the following example, I am running the date command in the personal domain. With the --pass-io command line flag, we are saying to pass across the STDOUT and STDIN from the remote VM to dom0.
$ qvm-run --pass-io personal date Tue Sep 5 17:42:11 IST 2017