LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mapping a folder between two virtual installs (https://www.linuxquestions.org/questions/linux-newbie-8/mapping-a-folder-between-two-virtual-installs-864517/)

ikarian 02-23-2011 08:18 AM

Mapping a folder between two virtual installs
 
Hi everyone-
I am working on a few different Linux related self-education projects, and I'm trying to stump myself as much as possible so I can learn as quickly as possible.

Using VMWare, I have several Linux and Windows flavors I am using for various purposes. To the point, I have an Ubuntu server (text only) and a Fedora desktop installed, and I need to figure out how to map a drive on the Fedora VM so that I can access it on the Ubuntu server VM. I have installed Samba on both, and I can send a ping from one to the other with no problems. I guess I just need some help with the command line syntax?

On a related note, I have NOT been able to figure out how DNS works in a setup like this, so when I say I can ping them, it is by IP address only. I'll work on the DNS stuff soon, but for right now, I just need access to my Fedora VM, unless for some reason you can ONLY set this up via DNS. Can you help me? Thanks!

Ubuntu server 192.168.28.133
Fedora desktop - 192.168.28.130
Folder I need to access: [Fedora desktop]/home/[username]/downloads/

fordeck 02-23-2011 01:11 PM

I recommend you find a book on Samba which will bring you up to speed. One very good book would be by Bruce Perens. According to this site you can download it for free if you become a member.

If you just need a couple of files from the Fedora box you might take a look at using scp assuming that you can ssh between the two. For example if you wanted to get file1.txt you could use the following command:

Code:

scp username@192.168.28.130:downloads/file1.txt .
This command would copy the file1.txt file from the fedora box to the current directory (the period represents the current directory) on the ubuntu box.

You can find out more about ssh and scp by reading their respective manual pages. Just enter at the command prompt:

man scp

or

man ssh

Regards,

Fordeck

ikarian 02-23-2011 01:35 PM

Not a bad idea about the book. I will look into it.

As for the scp command, I got a 'no route to host' error. What (if anything) needs to be done to make the files/folders available on the Fedora box? (in parlance of an expatriating Windows admin, one must share the folder before it will be accessible)

fordeck 02-23-2011 02:13 PM

Samba could be made to do what you are asking, however the details are in the book. Or perhaps take a look at Samba documentation on their web site.

Quote:

and I can send a ping from one to the other with no problems
That should mean you could connect. May check to see if sshd is running for example:

Code:

$ ps -ef | grep ssh
root      2431    1  0 Feb20 ?        00:00:00 /usr/sbin/sshd

Also you can check with netstat for example:

Code:

$ netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address              Foreign Address            State     
tcp        0      0 :::22                      :::*                        LISTEN

The above example shows a listening port 22 which is the ssh port. If either of the above examples fail to show that your machine is running sshd then you can start sshd using the following command:

Code:

service sshd start
To set it to start at boot time:

Code:

chkconfig sshd on
Anyway once you are able to ping each machine and have sshd running then you should be able to use scp to copy files from one machine to the other. I would try to explain samba, however the samba documentation or the book does a much better job of explaining it. Especially the book by Bruce Perens. It actually has examples that would be similar to what you are trying to accomplish.

Regards,

Fordeck

chrism01 02-23-2011 11:57 PM

Samba is really designed to talk to MS systems (the CIFS protocol was created by MS). You can use it to share between 2 *nix systems, but usually you'd use NFS instead. Your choice.
As above, for just moving a few files back & forth, use scp instead.

ikarian 02-24-2011 11:35 AM

Aaargghh...

So, I had to install OpenSSH on the Ubuntu server (recipient). I now see LISTEN state active in netstat for port 22 (where there was previously nothing listed when I entered the netstat -nat command). Same thing in the Fedora box (the one with the files I need). Still pinging back and forth like a champ. Far as I can tell, SSH is on and working. But still 'no route to host'. Any other ideas? Should I be taking that literally to mean I need to add a static route to the Ubuntu server, even though it can already find it via ping? Thanks again for your help.


All times are GMT -5. The time now is 02:47 PM.