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, use the mount target's DNS Name or IP address from Workspace. Complete the following steps:
- Open the Amazon EFS console.
- In the navigation pane, choose File systems.
- Select the file system that's your mount target.
- In the Details pane, under Mount targets, copy the DNS Name or IP address.
- Configure the EFS file system security group to allow inbound traffic to TCP port 2049 from the abcxyz_workspacesMembers security group.
- To mount the EFS file system on the Linux WorkSpace, run the following command:
sudo mount -t nfs EFS_FILE_SYSTEM_DNS_NAMEorIP_ADDRESS:/ /mnt/efs
Note: Replace EFS_FILE_SYSTEM_DNS_NAMEorIP_ADDRESS with the DNS Name or IP address of your mount target. To mount EFS mount helper, you must first install the amazon-efs-utils package. However, this rpm-based package is available only in Amazon Linux releases. For other Linux distributions, you must compile packages from the source. For more information, see On other Linux distributions on the GitHub website.
- To verify that you successfully set up the network file share, run the following command:
df -h
Example output:
EFS_FILE_SYSTEM_IP_ADDRESS (or) EFS_FILE_SYSTEM_DNS_NAME /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:
-
To install the cifs-utils package, run one of the following commands based on your distribution.
Amazon Linux 2 WorkSpace:
sudo yum install cifs-utils
Ubuntu WorkSpace:
sudo apt install cifs-utils
Red Hat Enterprise Linux WorkSpace:
sudo dnf install cifs-utils
-
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.
-
To authenticate with Kerberos, run the following command:
kinit
-
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.
-
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