File Sharing Instructions pls - Mac OSx (Host) & CENTOS (Guest)

Discussion in 'Parallels Desktop for Mac' started by protyne, Jul 17, 2006.

  1. protyne

    protyne Bit poster

    Messages:
    2
    Hi,

    Trying to get my CENTOS - Guest OS to see Mac OSX - Host OS and retrieve files. Can someone please provide instructions please?

    I have searched the forum and Google with the following keywords - share files Linux Mac OS Paraellels. But did not find anything that gave me any idea.

    Kindly advise or point me to a thread that already has the info please.

    Cheers to all!
     
  2. deelock

    deelock Bit poster

    Messages:
    1
    file sharing options between host mac os and guest linux os

    hi
    the manual states this is not currently possible for linux. I too am looking for an easier way to transfer files between these os's
    I also notice that the iso9660 dvd i installed my fedora 5 OS from, is recognised as a blank DVD ROM by fedora 5. so burning files on to DVD is also not an option.

    currently, i use wget to transfer files into my linux OS.

    Any ideas on a better work around would be appreciated.

    -d
     
  3. ajwans

    ajwans Member

    Messages:
    24
    I used NFS to share my home directory from Mac OS X (host) to Centos (guest.)

    Using NFSManager you can create an NFS share for /Users and under Centos
    edit /etc/auto.master to include:

    /home file:/etc/auto.home

    And create /etc/auto.home with the contents:

    * macosx_ip:/Users/&

    If you want it to work nice create the users in centos with the same UID they
    have under Mac OS X and you will get full read write automounted home directories
    under Centos.

    I'm using Parallels Beta because it allows multiple virtual network adapters in the
    guest OS so my NFS is shared over a host only network but my internet access
    is bridged.

    Hope this helps.
    andy
     
  4. braver

    braver Bit poster

    Messages:
    4
    Andy -- this is great, can you please post more details about your setup -- which IP do you use in the server and client, how do you ensure you use the host-only network, etc.?

    Cheers,
    Alexy
     
  5. ajwans

    ajwans Member

    Messages:
    24
    I made a little mistake in my earlier post, I haven't exported all of /User I have a
    separate export for each user (only one in my system). So you will need to
    create an export for /Users/<username> on the mac side.

    One caveat is that I haven't been able to sucessfully export a directory using
    NFSManager or otherwise without rebooting. If anybody knows how to stop
    and restart the nfs services on mac os x please post here.

    I am definitely sharing over the host only networking because my internet
    is on a 192.168.13/24 network and my exports only allow access to clients on
    a 10.37.129/24 network. Thankyou Parallels for allowing multiple network
    adapters in the new beta release.

    Using Netinfo manager, / -> exports -> /Users/<username> has the options
    maproot=nobody
    network=<host only network>
    netmask= 255.255.255.0

    On the linux side my /etc/auto.master has:
    /home file:/etc/auto.home

    and /etc/auto.home has:
    * -rw,soft,intr <mac os x host network ip address>:/Users/&

    With this setup when I login to the guest linux operating system my Mac OS X
    home directory is mounted automatically and I have full read write access
    to the directory.

    It is important that your linux user's username/uid/gid match those on the Mac OS X
    system for all this to work. If you have different usernames then you would alter
    the /etc/auto.home on the linux side to be:

    <linux username> -rw,soft,intr <mac os x host network ip address>:/Users/<mac username>

    The wildcard entries would no longer work.

    You may also try turning off the firewall on under the sharing preferences in apple
    system preferences until you get this working and determine which ports to enable.

    andy
     
  6. ajwans

    ajwans Member

    Messages:
    24
    I've discovered an interesting option on the exports man page. Using netinfo manager
    if you add the 'alldirs' value to the 'opt' property on your export you can mount subdirectories
    of the export.

    What this means is that you can export all of /User from OS X and your linux guest VM can
    mount any user's home directory using the wild card form in the auto.home automount
    configuration file.

    Now if OS X only had the 'nohide' NFS option which allows mountpoints underneath your
    exported directories to become visible to the NFS client I would be even happier, oh well,
    can't have everything.

    andy
     
  7. William Robertson

    William Robertson Junior Member

    Messages:
    17
    This looks really promising, but I can't get it to work. I wish I understood this stuff better.

    I looked in Netinfo Manager but there is no "exports" anywhere. Is this something NFS Manager creates? What is it anyway?

    I downloaded NFS Manager from http://http://www.bresink.com/products.html but it's not exactly aimed at beginners. I was looking for something to say "Create share X giving computer Y access to folder Z" but apparently there's more to it than that.

    I initially followed your instructions, i.e. this in /etc/auto.master:

    Code:
    /home file:/etc/auto.home
    and this in /etc/auto.home:

    Code:
    * -rw,soft,intr 10.0.1.1:/Users/&
    (10.0.1.1 is the address of the Mac.) Then I restarted Centos and logged in as oracle, to find /home had disappeared and my home directory had moved to /oracle, so I tried Plan B, i.e. this in /etc/auto.master:

    Code:
    /nfs file:/etc/auto.home
    and this in /etc/auto.home:

    Code:
    oracle -rw,soft,intr 10.0.1.1:/Users/oracle
    Now /home is back where it was and there is a "/nfs" but it's empty. Probably I am missing a bunch of stuff on the Mac side to create an NFS share, and quite likely I have the syntax wrong in auto.home in Centos. What is the significance of the * and & characters?
     
    Last edited: Jan 19, 2007
  8. ajwans

    ajwans Member

    Messages:
    24
    * is a wildcard so for any directory access under /home it will try to mount that directory,
    the & just says replace me with whatever * matched. An example might help:

    Say you tried to access /home/oracle, * would match 'oracle' and so autofs would try to mount
    10.0.1.1:/Users/oracle (replacing & with 'oracle') with the options '-o rw,soft,intr'

    If you don't have an 'exports' directory in netinfo manager you can just create one by selecting
    the root '/' and clicking on 'new', then rename that directory to 'exports', under 'exports' create a
    directory '/Users' and add the options listed in my previous posts, don't forget to add the option
    'alldirs'.

    You will probably have to reboot your mac too.

    andy
     
  9. William Robertson

    William Robertson Junior Member

    Messages:
    17
    OK, so looks like I'm on the right track on the Centos side (although I didn't need to enter "oracle" twice in /etc/auto.home, as "&" would have just stood for whatever was in the first field).

    In Netinfo Manager I created "exports" and added "/Users" under it, but I couldn't follow the part about "options" (maproot etc). Netinfo Manager lets you add "properties". Are these what you mean? And if so, where you have "<host only network>", should I substitute something? I'm actually using Bridged Ethernet.

    My aim is to allow the oracle user in Centos to read and write files on the Mac under /Users/williamr, or possibly on my Firewire drive (/Volumes/Firewire1).

    Many thanks for your suggestions btw - this will be incredibly useful when I get it working, as it's something basic that the documentation just doesn't cover. I'll add the steps to my idiots' guide:
    http://www.williamrobertson.net/documents/install-oracle10g-intelmac.html
     
  10. ajwans

    ajwans Member

    Messages:
    24
    Yes, create a new property in your /Users export called 'opts' then add values to that property.
    The values you need (taking this off my working configuration) are 'alldirs', 'maproot=nobody',
    'network=<Linux IP Address>' without the <> of course, and 'mask=<netmask>' again without
    the <>.

    I use bridged ethernet as well for my first interface but I share the filesystem over a second
    virtual host only adapter. The beta releases allow more the one virtual network interface
    card.

    The reason that my setup works better is because when my IP address changes, such as
    moving the Macbook from home -> work the share still works correctly. If you tried to do this
    with bridged ethernet only and your IP address changes it may stop working.

    Hope this helps, just keep posting here until we get it working.
    andy
     
  11. William Robertson

    William Robertson Junior Member

    Messages:
    17
    I think I must be getting close, but it's still not working.

    I noticed NFS Manager creates the "exports" and "/Users" directories when you set up the share. I manually added the network, netmask and alldirs settings and rebooted. (Is that "netmask" or "mask" btw? I tried both.) For the record I'm running Mac OS 10.4.8 and CentOS 4.4. Can you see if I'm missing anything obvious?

    NFS Manager:
    [​IMG]

    NetInfo Manager:
    [​IMG]

    CentOS:
    [​IMG]
     
  12. ajwans

    ajwans Member

    Messages:
    24
    Yes, you must be getting close. You were 100% correct about the option being 'mask' and
    not 'netmask'. Under a Mac OS X terminal window if you do a "showmount -e" it will display
    the currently exported directories. This can help determine if your Mac OS X side it set up
    correctly.

    Also check that you don't have Mac OS X firewall settings preventing NFS from communicating
    between the guest and host operating systems. While setting this up it's probably going to be
    easiest to turn off both the Mac OS X firewall (under sharing system preference) and also
    Centos' firewall.

    andy
     
  13. William Robertson

    William Robertson Junior Member

    Messages:
    17
    Still no luck I'm afraid.

    "showmount -e" showed me I needed to start the NFS server (oops) which I did by hitting "Activate" in NFS Manager, and now it says:

    Code:
    [b]/Users/williamr:[/b] showmount -e    
    Exports list on localhost:
    /Users                             10.0.1.100 
    10.0.1.100 is the CentOS VM. I interpret that as saying the Mac is granting 10.0.1.100 access to /Users.

    Also while double-checking I realised that the Mac is at 10.0.1.2 (10.0.1.1 is the gateway), so I changed /etc/auto.home in CentOS, switched off the Mac firewall (CentOS is running without one) and restarted CentOS. No change.

    Reading the man page for nfs, it says I should put an entry in /etc/fstab. Could I be missing something there, or does the "auto" thing take care of it automagically? My /etc/fstab in CentOS looks like this:

    Code:
    # This file is edited by fstab-sync - see 'man fstab-sync' for details
    /dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
    LABEL=/boot             /boot                   ext3    defaults        1 2
    none                    /dev/pts                devpts  gid=5,mode=620  0 0
    none                    /dev/shm                tmpfs   defaults        0 0
    none                    /proc                   proc    defaults        0 0
    none                    /sys                    sysfs   defaults        0 0
    /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
    /dev/hdb                /media/cdrom            auto    pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
    Looking for troubleshooting tips for nfs I found http://www.troubleshooters.com/linux/nfs.htm (although this isn't about Mac or CentOS specifically) which gives a "mount" command like:

    Code:
    mount -t nfs -o rw 10.0.1.2:/Users/oracle /macshare
    I tried that as root (with the Mac's firewall off) and it failed instantly with mount: 10.0.1.2:/Users/oracle failed, reason given by server: Permission denied", which could be telling me something. With the Mac's firewall on it hangs for a while then fails with a timeout error. I tried putting the firewall on but enabling all the listed options but the CentOS side always gets a timeout. I tried mounting different Mac paths (/Users/Shared, /Users) but it made no difference.

    There must be something different between our setups, but I'm running out of ideas.
     
  14. William Robertson

    William Robertson Junior Member

    Messages:
    17
    [Deleted previous update as it wasn't helping]

    Latest update - Success (kind of):
    1. I chose the "Specified computers" access option in the NFS server setup, giving CentOS VM's address.
    2. In Mac's System Preferences, Sharing, Firewall, I created a new entry named "NFS" allowing ports 2049 and 111
    3. In CentOS, entered command as root: mount -v -t nfs -o rw 10.0.1.2:/Users /macshare
    I can now read the Mac's disk from CentOS over NFS! Now I just have to figure out where I was going wrong in making it permanent. I think what I want to do is make my external drive (/Volumes/Firewire1) accessible to any user in CentOS, rather than setting up a shared home directory etc, so possibly it will be a case of fstab rather than auto.home. The fstab entry will be similar to the mount command. I'll post back with details iwhen I get that figured out.

    Thanks!
     
    Last edited: Jan 24, 2007
  15. William Robertson

    William Robertson Junior Member

    Messages:
    17
    OK, I think I have it all working now. Many thanks for all your help. I've written a setup guide here:

    http://www.williamrobertson.net/documents/nfs-mac-centos-setup.html

    Let me know if you happen to see anything obviously wrong in it. For example I haven't mentioned NetInfo Manager because I think NFS Manager sets up everything you need, but I haven't got around to testing that theory by tearing down the share I've got working and rebuilding it from scratch ;)
     
  16. ajwans

    ajwans Member

    Messages:
    24
    One more thing, if you are using HFSX (Case-sensitive) file system on the Mac OS X side add
    nfsvers=2 to the mount options on the Linux side. Seems something about the file metadata
    is 64 bit under HFSX and NFS3 gets confused.

    andy
     
  17. dkp

    dkp Forum Maven

    Messages:
    1,367
    If you can get a FUSE sshfs client for your VM it will save you a lot of work. The Mac sshfs client is available from Google (MacFUSE).
     

Share This Page