Announcement

Collapse
No announcement yet.

How to connect to home ubuntu server network - use small words

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to connect to home ubuntu server network - use small words

    I'm hoping I can get some plain-spoken help here. I've been using linux exclusively for about three years. I can upgrade, get connected, make all sorts of little problems with help from the forums or online somewhere. What I simply cannot figure out is a simple command-line access to my home network server.

    I have a box that runs ubuntu server edition, which is where our music and movies are stored. I want to make VLC player and/or amarok play the music/movies from that server *without* downloading them locally first. I also want to be able to access documents in a folder on the network server through apps like Open Office and Gimp. I can't seem to figure out how to identify the path to the network folder.

    I've also tried to mount network drives to the /mnt folder, and read the mount man backwards and forwards, and I just don't understand it. I've no doubt there's some very basic understanding that I'm missing. I'm just trying to find the right command that will mount a drive, on the fly, so that I can point an application to that drive and open a file from within the app. I'm pretty sure I don't need samba - there are no windows involved here--and I know I can access the network folders because I can do so in Dolphin and in Konqueror through an sftp link.

    If someone would be willing to explain any of this, and use small words, I'd be really grateful.

    Thanks!
    Jen

    #2
    Re: How to connect to home ubuntu server network - use small words

    I was tempted to tell you about NFS but The thought of that explanation was almost enough to make me cry. Then I remembered seeing sshfs the other day and thought I would try it. Easy,easy,easy.

    sudo aptitude install sshfs
    on the client computer, or maybe install it everywhere just to have. Then to mount your home directory from the server on your laptop at $HOME/media-server do
    mkdir media-server
    sshfs media-server: media-server
    It is that easy. fusermount -u to unmount. man sshfs will be instructive. It accepts most ssh notation.

    Comment


      #3
      Re: How to connect to home ubuntu server network - use small words

      I have an Hewlett Packard Media Vault which runs on Linux. It is basically a NAS - Network Attached Storage - which I put all of my backups, mp3, movies, etc...on much like what you are wanting to do except it is not a "Ubuntu Server" per say. It is a network device running on Linux which my other Linux boxes connect to on boot up. Getting that done, well, it like to drove me crazy so I feel your pain.

      I know you know about your /etc/fstab configuration file---correct? Sure you do. That is where you list the devices that you want your Linux box to connect to upon starting up. Don't delete anything in that file that is already there because it also mounts your hard drives, cd drives, etc as well so if you screw with those - your hosed!

      Back to the fstab...I'll put this in the simplest terms I can so maybe it will help you (i'm no expert).

      The Media Vault (MV) has two hard drives labeled Volume1 and Volume2. Volume1 is where I store my media files, like you, so lets talked about that one. Under Volume1 there are folders (called "Shares") in which I put my stuff. My media files go into my "FileShare" folder and that folder has no password on it. The MV also has a static IP address of 192.168.2.176 (you must have a static IP address for your server for this to work).
      So...what do we know so far. We know:
      • MV Static IP = 192.168.2.176
      • The name of the folder I want to mount (link to) = FileShare
      • The drive the folder is on = Volume1 (turns out this is unimportant as far as the MV is concerned - your mileage may vary
      • The password on the folder = igofast (I know I said I did not have a password on it but just bare with me
      • The username = michael (but a username is not needed in all cases - again, your mileage may vary)
      • The client computer is using Ubuntu 8.10 and is connected via Ethernet cable to the MV


      Now, you have to create a folder to mount to or, in other terms, link "through" to your remote folders. I had to do this for the FileShare folder on the MV. I created a directory on my hard drive called "FileShare" and put it under the /mnt location. I coded this:
      Code:
      sudo mkdir /mnt/FileShare
      Remember, Linux is case sensitive!! This is the folder you will click on that will open up your remote folder on your server.

      This is the basic stuff you need to know in order to make this work. Yeah, there is Samba, NFS, CIFS, etc. to think about but I don't understand them well enough to explain them. What I do know is what I found to work for me which I am sharing with you.

      So...now let's get connected.

      You need to edit your /etc/fstab file and you must be sudo to do it. Type this:
      Code:
      sudo gedit /etc/fstab
      where "gedit" is the text editor for Ubuntu but I think Kubuntu uses Kate so replace "gedit" with "kate" - all lower case. Executing this command will open the fstab file in a text editor. Don't change anything there. Just got to the bottom of the page where nothing is written and start there. Better yet, make backup copy of the fstab file just in case you hose it - it happens. Trust me.

      Below is a single line from my fstab file that shows how I mount automatically to the FileShare each time my computer boots up.

      Code:
      //192.168.2.176/FileShare /mnt/FileShare cifs username=michael,password=igofast,_netdev,uid=michael,gid=users 0 0
      Do you see the "cifs" in the code above? It is a type of file mounting protocol but I have no idea what it is beyond that. See the term, "_netdev"? I don't know what that does either. See the two zeros at the end? Complete mystery to me. I don't know what they mean nor do I care. I spent weeks and weeks getting help on the forum and piece-by-piece I put this together and it has been rock solid ever since. All I know is, it works.

      Regarding the username and password. This folder does NOT have a password on it and the folder does not require a username to be associated with it - so I thought. I really thought that since there was no username or password required on this folder that I would not need that line in the fstab file that states the username and password. I thought I could code it like this:

      Code:
      //192.168.2.176/FileShare /mnt/FileShare cifs _netdev,uid=michael,gid=users 0 0
      However, I was wrong. Don't know why but I was. Countless hours of sleep were lost trying to figure out why that coded line would not mount that FileShare folder. In the end, I took a wild stab at actually assigning a password to the folder via the MV's interface then inserting a username and password into the fstab file. It worked! I then went back (via the MV interface) and removed the password requirement but left the password and username in the fstab file and it STILL worked! And that is where I left it. I don't want to know why it worked. I'm just glad that it did so i can move on.

      I hope this helps you.

      Mike

      sudo make me rich<br /><br />Kubuntu Gutsy 7.10<br />KDE 3.5<br />Compaq Presario 5000<br />Intel Celeron 1.2 Ghz<br />512 Ram, Riva TNT2 Video Card<br />All the above hardware is 7 year old junk but<br />Linux runs great on it.&nbsp; :&gt<br />Ham Radio Rules

      Comment


        #4
        Re: How to connect to home ubuntu server network - use small words

        Originally posted by mando_hacker
        I was tempted to tell you about NFS but The thought of that explanation was almost enough to make me cry. Then I remembered seeing sshfs the other day and thought I would try it. Easy,easy,easy.

        sudo aptitude install sshfs
        on the client computer, or maybe install it everywhere just to have. Then to mount your home directory from the server on your laptop at $HOME/media-server do
        mkdir media-server
        sshfs media-server: media-server
        It is that easy. fusermount -u to unmount. man sshfs will be instructive. It accepts most ssh notation.
        Wow! That is easy! This would work great with my bash backup scripts and tar.

        I used NFS for a couple years and had no trouble with it. The right setup was to make sure the read and write parameters were set for block sizes of 8296 and setting the client so wouldn't hang trying to mount an NFS that wasn't up. After that, the remote server looked and behaved just like another directory and the speed wasn't bad either.
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          Re: How to connect to home ubuntu server network - use small words

          I too have used NFS for years and do not find it a problem, but I have found that it takes a little getting used to and new users struggle. As to the speed, well, it is OK, only because there is nothing better without going to extremes. I really like this sshfs though. I expect it will become a common tool for me now that I know about it.

          Comment


            #6
            Re: How to connect to home ubuntu server network - use small words

            Thanks for your replies. Mike, your explanation is great - I'll be able to edit my fstab...just as soon as I work up the courage. Mando_hacker, the sshfs tool really is easy. I feel like a Geico caveman.

            Comment


              #7
              Re: How to connect to home ubuntu server network - use small words

              I've been running into an issue where I get an error -113 b/c the network connection isn't up yet (wired via interfaces using a static IP). If I run mount -a once I'm up and logged in, no problem. I just don't know how to require the network be up before it tries to mount the samba share on my main Kubuntu box. I just don't know how to overcome this timing problem.

              Also, from the logs the _netdev option does not seem to be a valid option for fstab.

              I'm trying to setup a media center test box. If I were to try setting up NFS, is it really that hard for someone comfortable with kubuntu and will it allow me to mount a remote fs w/o intervention or similar timing issues?
              Never trust a computer you can&#39;t throw out a window.<br />&nbsp; ~Steve Wozniak

              Comment


                #8
                Re: How to connect to home ubuntu server network - use small words

                Using NFS will not bypass the issue you are seeing and it might add additional complications, depending on which computers are connecting to your media center. It is likely that you need smb (aka CIFS, Windows file sharing) for some of the clients.

                The timing issue should already be taken care of by two scripts. One is in /etc/init.d and is mountnfs.sh on Jaunty. I have been told it is wait.sh on Intrepid. The other is /etc/network/if-up.d/mountnfs. The scripts in /etc/network/if-up.d/ get run after an interface is brought up and that script is there specifically to mount network filesystems. Unless you disabled it somehow that script should run after the interface is brought up.

                Comment

                Working...
                X