From 14931f19505985bc18f19dd217e3467f9bc1a530 Mon Sep 17 00:00:00 2001 From: Ryo Yanagida Date: Mon, 19 Aug 2024 18:15:22 +0100 Subject: [PATCH 1/2] update with a guide to use ssh-config dump --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index d672545..13d77cf 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,15 @@ In general, we discourage the use of shared folders and suggest that all data ge After that the data may be transfered to the host, for example, using rsync. Using rsync is also easier to automate when qemu is used because of the network setup that qemu uses by default. +One way to use rsync with vagrant is to dump the ssh config onto a file and feed that file to ssh command as an option for rsync command (or any other program that uses ssh internally) + +Running `vagrant ssh-config > .ssh_config` in the same directory as Vagrantfile will create a file called .ssh_config in the directory. +When running `rsync`, `-e` option can be used to feed ssh command and arguments to establish connection with the VM. e.g.: +``` +rsync -avH -e "ssh -F ./.ssh_config" default:~/results/ ./results/" +``` +Above will synchronise ~/results within the vagrant vm and the ./results folder right next to the Vagrantfile. + # This document is ever-evolving. Feel free to add your own contributions, clarify the points made, or insert additional content. From 40342b11c3126378fdab42ce5ebb77db9d47d950 Mon Sep 17 00:00:00 2001 From: Ryo Yanagida Date: Tue, 20 Aug 2024 15:01:11 +0100 Subject: [PATCH 2/2] add a sentence suggesting to delete the .ssh_config file to prompt re-generating it after destroying the vm --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 13d77cf..ddc4f60 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,9 @@ When running `rsync`, `-e` option can be used to feed ssh command and arguments ``` rsync -avH -e "ssh -F ./.ssh_config" default:~/results/ ./results/" ``` -Above will synchronise ~/results within the vagrant vm and the ./results folder right next to the Vagrantfile. +Above will synchronise ~/results within the vagrant vm and the ./results folder right next to the Vagrantfile. + +When destroying the vagrant vm, remember to delete the .ssh_config to avoid confusion and to prompt re-generating the .ssh_config file again. #