Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows instances can't access to AWS EFS (NFS4.1) #2346

Open
madmongoose opened this issue Nov 26, 2021 · 0 comments
Open

Windows instances can't access to AWS EFS (NFS4.1) #2346

madmongoose opened this issue Nov 26, 2021 · 0 comments

Comments

@madmongoose
Copy link
Contributor

The version of the AWS NFS server driver differs from the version currently implemented in Windows, so AWS does not officially support Windows EC2 with AWS EF S.

Several solutions have been tried in search of a workaround.

  1. Using WSL with the NFS client. Returns the error "mount.nfs: There is no such device". The bug will be fixed in future versions of WSL2 that are under testing. A mandatory requirement is to support nested virtualization on the host.
  2. Running the Linux guest machine in VirtualBox and Vmware Workstation without nested virtualization returned the error "vt-x is unavailable (verr_vmx_no_vmx)".
  3. NFS4.1 driver was installed for Windows developed by the University of Michigan. The driver provided the ability to mount NFS shares, read information, but there was no write capability. Can create folders and files, but reading these files later became impossible and returned the error "file not found". There was also a problem with the speed of work. After inspecting the driver and documentation, it turned out that the driver was designed to work together with many Windows clients with shared NFS resources. The driver uses the "OPEN4_SHARE_DENY_NONE" function, which is not supported in AWS EFS. I commented on the lines of code with this functionality and tried to compile the driver from the source code using Visual Studio 2010 and the Windows 7600 driver kit, which were recommended by the authors for the build. An error occurs during compilation, due to which some files are unavailable. Links to the source code, forks, and description of the problem:
    http://www.citi.umich.edu/projects/nfsv4/windows/readme.html#install
    http://www.citi.umich.edu/projects/nfsv4/windows/120612/
    https://github.com/kofemann/ms-nfs41-client
    https://github.com/cbodley/ms-nfs41-client
    https://stackoverflow.com/questions/38956130/aws-efs-from-windows-server-2012/46625030#46625030
  4. An approximate solution to the problem was to use the QEMU emulator with the Alpine Linux guest system, which does not require nested virtualisation, installation of the necessary NFS client and SMB server. The idea was that Linux mounts the necessary NFS share and transfers data to the Windows host system via SMB. An attempt was made to install the TAP interface and create a bridge with the LAN interface to access the guest system, but this led to a loss of communication with the host system. Then a successful attempt was made to use the functionality built into QEMU to create a virtual network "User Network (SLIRP)" and "hostfwd=tcp". This made it possible to connect to the guest machine via SSH, but the SMB server could not be redirected in this way. The final solution was to create CIFS share in the host system, mount it in the guest system, mount AWS EFS NFS share and copy the necessary files through the guest system. The copy speed was about 200 Mbit/s. Links to distributions and a list of commands to run:
    https://wiki.alpinelinux.org/wiki/QEMU
    Support alpine linux aws/efs-utils#50

For start guest
qemu-system-x86_64-m 1024-network network user, smb=c:\win -hda alpine.qcow2 qcow2

or

qemu-system-x86_64-m 1024 - network user,hostfwd=tcp::4455-:445,hostfwd=tcp::2222-:22 -network network adapter, model=virtio-hda alpine.qcow2 qcow2

setup -alpine
ip link install eth0
apk add nfs-utils
mounting -t nfs-o nfsvers=4.1, rsize=1048576,wsize=1048576, hard,timeo=600, relay=2, noresvport "username efssharename".amazonaws.com:/home/ /efs
mount.cifs//10.0.2.2/win

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant