Make Synology DS, NFS, Ubuntu, and VirtualBox Play Nice-Nice

Share

I have a Synology DiskStation (DS209j) that I use on a primarily Windows network, but in some cases I want to access the DS shares from Ubuntu virtual machine running inside VirtualBox. There’s no sense mounting them as Windows shares with the DS supports NFS, so I went that route in stead. (Besides, some application still have trouble with Samba shares.)

I was scratching my head over a “access denied by server while mounting” error until I realized that VirtualBox was getting in the way. Here are the steps I took to get it up and running properly:

  1. In the VirtualBox menu of the virtual machine , select Devices > Network Adapters… and choose Bridge Adapter instead of the default NAT. This takes your virtual machine out of the private network it has with the host computer and makes it a first-class citizen on the network your host computer is on, with its own IP address.
  2. Check the guest machine’s IP address by opening Applications > Accessories > Terminal and typing “ifconfig”. It will probably start with “192.168”, but you’ll need all four parts if you want to limit access to just that machine.
  3. Log into Synology DiskStation Manager as admin, and click Management.
    1. Under Information, click Status and note the network IP address of your DiskStation. It will probably start with “192.168”, but you’ll need all four parts of the IP address.
    2. Under File Sharing, click NFS, and make sure it’s enabled.
    3. Under Privileges, click Shared Folder. Select the folder one you want to mount using NFS, and click NFS Privileges at the top of the list to add a new privilege. Use the IP address of the guest machine to lock access down to that specific machine, or use wildcards to allow access accross your local network (e.g. “192.168.*.*”).
    4. Before you close the NFS Privileges window, note the “Mount path” at the bottom of the list. It will probably look something like “/volume1/MyShare”
  4. To automatically mount the NFS share when you start up, go back to the Terminal window on the guest machine.
    1. Create a directory to use as a mount location. For example if you want to use “MyDSData” in your home folder, type “sudo mkdir /home/YourUserName/MyDSData”. Enter your password when prompted.
    2. Type “sudo gedit /etc/fstab” in the same Terminal window, and edit then add the line below  line to the end of the file. (It’s all one line.) Instead of “[DS IP Address]” use the IP address of your Synology DS, instead of “[Mount path]” type the mount pah, and instead of [Mount location] type the directory you made above. Don’t leave out the colon or the spaces.

      [DS IP Address]:[Mount path] [Mount location] nfs rw,hard,intr,nolock,nfsvers=3 0 0

      For example: “192.168.1.42:/volume1/MyShare /home/alex/MyDDData nfs rw,hard,intr,nolock,nfsvers=3 0 0”

Share

Leave a Reply

Your email address will not be published. Required fields are marked *