Both computers are running their copy of the same virtual appliance on Virtual Box which is accessed through putty.exe.

I would like to scp a C++ program that I've written on one of the virtual image (VM1) to another computer's virtual image (VM2) across a network:

[VM1] --> [Host Computer 1]--> Internet --> [Host Computer 2] --> [VM2]

I'm pretty newbish and this may be an involved solution and I don't expect the nice folks in this forum to do everything for me. However, if you could point me to the right resources, much will be appreciated :).

  • Well, you need to set up port forwarding on that other VM2, so that you can connect to it in the first place. I've posted a relevant answer before, will link it here – Sergiy Kolodyazhnyy Jan 31 '16 at 7:07
  • This explains how to set up port forwarding to the VM: askubuntu.com/a/727243/295286 – Sergiy Kolodyazhnyy Jan 31 '16 at 7:09

You say you want to scp - then the information is accessed through man scp or info scp form a command prompt - or you can google scp

the man pages can be a bit daunting it says

scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2

so here is my short version of it

scp is a bit like "copy from_existing_file to_non_existing"
thus a simple version of it would be "scp myid@remotehost:myprog.cpp mycopy.cpp"
if you wan to "grab" a copy
"scp myprog.cpp myid@remotehost:mycopy.cpp"
if you want to store away a backup-copy all the other switches like -v depend on your setup - and various issues.

Good Luck

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.