Skip to content

Instantly share code, notes, and snippets.

@caldempsey
Created July 21, 2019 23:02
Show Gist options
  • Save caldempsey/090e44fca8a968d926ae801d3abda612 to your computer and use it in GitHub Desktop.
Save caldempsey/090e44fca8a968d926ae801d3abda612 to your computer and use it in GitHub Desktop.
Script to copy QubesOS from a host VM to domain0.
#!/bin/bash
# qvm-copy-to-dom0
# Copy a file from an AppVM to dom0
# qvm-copy-to-dom0 appVM srcPath [ dst ]
AppVM=$1 # mandatory
Source=$2 # mandatory
Destination=$3 # optional (will use ~/QubesIncoming/AppVM/ folder if null)
if [ -z "$Destination" ]; then
Destination="$HOME/QubesIncoming/$AppVM/$(basename "$Source")"
mkdir -p "$HOME/QubesIncoming/$AppVM"
fi
if [ -e "$Destination" ]; then
echo "'$Destination' exists; aborting" >&2
exit 1
fi
qvm-run --pass-io $AppVM "cat $Source" > "$Destination"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment