Skip to content

How do I map a network file share on a Linux WorkSpace?

3 minute read
-1

I want to mount a network file share on an Amazon WorkSpaces Linux WorkSpace.

Resolution

Mount an Amazon EFS file share on a Linux WorkSpace

To mount an Amazon Elastic File System (Amazon EFS) file system in a Linux WorkSpace, you must use the mount target's IP address and not the DNS name. To mount an EFS file system, complete the following steps:

  1. Open the Amazon EFS console.
  2. Select the file system that's your mount target.
  3. In the Details pane, under Mount targets, copy the IP address.
  4. Configure the EFS file system security group to allow inbound traffic to TCP port 2049 from the abcxyz_workspacesMembers security group.
  5. To mount the EFS file system on the Linux WorkSpace, run the following command:
    sudo mount -t nfs EFS_FILE_SYSTEM_IP_ADDRESS:/ /mnt/efs
    Note: Replace EFS_FILE_SYSTEM_IP_ADDRESS with the IP address of your mount target.
  6. To verify that you successfully set up the network file share, run the following command:
    df -h
    The command's output that shows the mounted EFS file system looks similar to this:
    EFS_FILE_SYSTEM_IP_ADDRESS  /mnt/efs

Mount a Windows file share on a Linux WorkSpace

To mount a Windows file share on a Linux WorkSpace, complete the following steps:

  1. Install the cifs-utils package.

    For an Amazon Linux 2 WorkSpace, run the following command:

    sudo yum install cifs-utils

    For an Ubuntu WorkSpace, run the following command:

    sudo apt install cifs-utils 

    For a Red Hat Enterprise Linux WorkSpace, run the following command:

    sudo dnf install cifs-utils
  2. To set up a directory on your Linux system as your mount point, run the following command:

    sudo mkdir -p /mnt/windows-share

    Note: Replace windows-share with your directory name.

  3. To authenticate with Kerberos, run the following command:

    kinit
  4. To mount the Windows file share, run the following mount.cifs command:

    sudo mount -t cifs //server/share /mnt/windows-share --verbose -o vers=3.0,cache=none,user=$USER,cruid=$USER,sec=krb5,uid=$(id -u),gid=$(id -g)

    Note: Replace the //server/share with the universal naming convention (UNC) path of your Windows file share.

  5. To verify that you successfully set up the network file share, run the following command:

    df -h

To automatically mount the file share on system boot, add the mount command to your Linux system's /etc/fstab file. It's a best practice to automatically mount the file share if you need to access it frequently.

Related information

Mounting EFS file systems

How to access Amazon FSx for Windows File Server from a Linux client on the YouTube website

Mounting a file share on an Amazon Elastic Compute Cloud (Amazon EC2) Linux instance

AWS OFFICIALUpdated 9 months ago
1 Comment

Hello,

Why does this procedure suggest mounting using an IP address rather than the EFS DNS name? Are you trying to use a specific mount target in the same subnet/AZ as the WorkSpace or is there some other reason? (As I understand it the AWS .2 resolver will automatically resolve an EFS DNS name to a local IP for it, if available.)

It is worth calling out in this guide that WorkSpaces are unable to have IAM roles attached to them, unlike the EC2 option of using EC2 Instance Profiles. This is due to a limitation to the Amazon WorkSpaces service, as they are special EC2 instances which are AWS-managed but have a second ENI in the customer's VPC.

It's also worth noting that at the time of writing the amazon-efs-utils package which is needed for data transport encryption is only provided as an RPM compatible with Amazon Linux releases. If you're on another Linux OS you'll have to build it yourself.

replied 20 days ago