(I'm running ubuntu server 12.04 on virtual box)
I'm trying to transfer a file (scp) from my laptop to one of the directories of a virtual machine. I tried sharing folders, but that failed. I'm a bit of a networking newbie.
I've looked at like 20-30 pages. Here's one: http://www.howtoforge.com/moving-files-between-linux-systems-with-scp
I followed those steps exactly. My problem is that when I try using scp, it just hangs. I'm also not sure which network interface to configure (eth0, eth1?) in the guest OS. Another (significant?) detail is that the inet address of eth0 is 10.0.2.15 instead of something like 192.168.x.y.
I've enabled the bridge adapter and the host-only adapter. Both the laptop and guest VM have openssh-server installed. I'm not sure what to do at this point.
Is there a better place to ask about this?
The reason you're not able to scp/ssh is your Guest and Host machines are currently on separate networks. The Guest machine is currently NAT'd to the host network so that it may access the internet. Essentially you'll want to set up another network adapter on the Guest VM.
To do this:
Now you'll need to edit /etc/network/interfaces. Change the address to your base IP address.
You should now be able to ssh/scp back and forth between your host and guest machine using the correct IP addresses. (Note, it will not be the IP from eth0)
Success!
Easy way is to use
scp
:Make sure you running on guest pc sshd service otherwise run below command:
From host PC:
I fixed the problem by using the IP address of the second adapter in the homestead installation:
192.168.x.x
in my case. Adapter 1 is NATed and shows127.0.0.1:2222
in the output while the VM was coming up, but the actual IP address of Adapter 1 was10.0.X.X
in my case.