Seungweon's Blog

in Portland, Oregon

Correcting access to shared folders in Ubuntu 9.1 for VMware Workstation 6.5

Symptoms

  • Enabling shared folders in Fusion does not work
  • You do not have permission to access some or all shared files or folders in Ubuntu
  • Cannot access shared files in Ubuntu

Purpose

The permissions for the shared files are passed from the host (Mac OS) to the guest (Ubuntu). Since the UIDs do not match between users in the host and the guest, you do not have access to some files and folders. Matching the account Unique Identifier (UID) of the host and the guest allows access to all shared files and folders.

Resolution

You must change the UID for your user within Ubuntu to match the user on the host.

Note: VMware recommends backing-up your virtual machine before making configuration changes.
 
To change the UID for your user:
  1. Identify the UID for your Mac user:
    1. Open System Preferences and choose the Accounts pane.
    2. Unlock the pane by clicking the lock icon in the bottom left and authenticating with an administrator user name and password
    3. Right-click on your user and select Advanced Options.
    4. Record the value of the User ID field.

  2. Create a group in Ubuntu with a matching UID:
    1. Click System > Administration > Users and Groups > Manage Groups > Add Group.
    2. Choose a name for the group and make the Group ID the same as the UID identified in step 1.

  3. Create an alternate Admin user in Ubuntu to allow you to properly modify settings for the current user.
  4. Log out of the current user and log in as the newly created Admin user.
  5. Open Terminal and type sudo gedit /etc/passwd. Provide your password when prompted.
  6. Scroll to the bottom to locate the entry displaying the current User ID and Group ID.

    For example: <username>:x:1001:1001:<username>,,,,:/home/<username>:/bin/bash.

    In this example, 1001:1001 is User ID:Group ID.

  7. Change these entries to reflect the UID identified in Step 1.

    For example, if your UID is 501, your new entry is: <username>:x:501:501:<username>,,,,:/home/<username>:/bin/bash.

  8. Save the changes and close gedit.
  9. Change the group and ownership on the user's home folder to reflect the modifications:

    In Terminal: 
    1. Run sudo chown -R 501 /home/<username>
    2. Run sudo chgrp -R 501 /home/<username>

  10. Logout of the alternate Admin user, and log in as the user you have just modified.
  11. Enable shared folders in Fusion under Virtual Machines > Settings > Sharing.
  12. In Ubuntu, access your shared folder at /mnt/hgfs/<foldername>.
  13. (Optional) To create a symbolic link to that directory, in Terminal, run ln -s /mnt/hgfs/<folder name> ~/Desktop/<linkname>.

0 comments:

Post a Comment