I tried the following command, but only an empty file is created on the target and the command stays open
qemu-img convert -f raw -O vmdk /dev/sda1 - | ssh foo@bar "cat > /home/foo/foobar.vmdk"
Note: sshfs
is not available.
I tried the following command, but only an empty file is created on the target and the command stays open
qemu-img convert -f raw -O vmdk /dev/sda1 - | ssh foo@bar "cat > /home/foo/foobar.vmdk"
Note: sshfs
is not available.
Unfortunately it is not possible to write the qemu-img
output to a pipe due to the fact that the output files need to be seekable
Ref: https://www.mail-archive.com/qemu-discuss@nongnu.org/msg05176.html
You want to use tee
instead of cat
.
tee - read from standard input and write to standard output and files
qemu-img convert -f raw -O vmdk /dev/sda1 - | ssh foo@bar "tee /home/foo/foobar.vmdk > /dev/null"