Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Booting down the linux VM, removing the share, disabling sharing,

followed by enabling sharing, adding the share, and booting up the linux Vm

finally followed by reinstalling vmware tools

do not make the shared drive appear under /mnt/hgfs.

My question is: I'd like to use old-fashioned scp to copy a tar archive.

On the linux VM: scp FROM/dir/file.tar ~/.

What should FROM be?

share|improve this question
    
How is networking set up on the VM? Bridged or shared? –  Ian C. Apr 3 '12 at 0:05
add comment

1 Answer 1

up vote 2 down vote accepted

If you're trying to connect from Linux back to your Mac you'll need to make sure ssh access is enable on you Mac first. Go to System Settings -> Sharing and make sure the Remote Login option is check.

This dialog will also tell you the the IP address of your Mac and the account name to use to connect. If your Linux VM's network is set to Bridged you can work with your Mac as if it was any other machine on your network. They both have unique IPs in your local network. So:

Setting up remote login via ssh on your Mac

From a terminal window on your Linux VM you can now do:

scp <stuff to copy> <your mac user name that users returned>@<ip address of the active interface>:/path/to/put/stuff/at

For example, according to my settings, if I wanted to copy from a terminal window on my Linux VM to my Mac I'd do:

scp myfile.txt ian@192.168.1.99:~/tmp/

That would put myfile.txt from my Linux VM in to /Users/ian/tmp on my OS X host OS.

Similarly, from the Linux VM:

scp ian@192.16.8.1.99:~/tmp/myfile.txt .

Would copy myfile.txt from the Mac back to my working directory on the Linux VM.

If you're trying to connect from your Mac to your Linux machine you need to make certain that the ssh daemon is running on your Linux machine. To start sshd, open a terminal on your Linux machine and type:

sudo /sbin/service sshd start

If it starts correctly you'll see a [START] box. If it fails, well, that's a question for http://unix.stackexchange.com/.

Now you just need to get the IP address for your Linux VM. At a terminal window on your Linux VM type:

ifconfig

The eth0 interface should be your active ethernet interface. Grab it's IP address. That's what you'll use to connect to your Linux VM from a Terminal window on your Mac.

Open a Terminal window on your Mac and type:

scp <local file> <username>@<ip address you got above>:~/tmp/

to copy the file from your Mac to your Linux VM while you're on you Mac.

share|improve this answer
    
On the Mac I am getting "ssh: connect to host 192.168.2.118 port 22: Connection refused" and on the linux side I get "ssh: connect to host 192.168.2.118 port 22: No route to host". –  Calaf Apr 3 '12 at 3:45
    
Those are the same IP addresses -- which machine does that IP belong to? I'll add some more details to the question. –  Ian C. Apr 3 '12 at 3:46
    
On the mac side ifconfig tells me that 192.168.2.118 is active. Does that mean that this is the IP of the linux? –  Calaf Apr 3 '12 at 4:00
    
No. That's the IP address of your Mac. You can run ifconfig in a terminal window on your Linux VM to get the IP address of the Linux VM. –  Ian C. Apr 3 '12 at 4:15
    
Still having trouble despite the very clear message. On linux /sbin/ipconfig gives me under eth0 some mac-address (six hex separated by colons) but no IP address. Still on linux, now that sharing is on in the Mac's Sharing preferences I am now getting "port 22: Network is unreachable". –  Calaf Apr 3 '12 at 5:11
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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