Synology Setup DSM 6.2.2 in a Virtual Synology DS3617xs using VMWare

Here is a step by step "How-To create a Virtual Machine to emulate a DS3617xs running DSM 6.2.2" using VMWare and Xpenology

Click to Read More

Xpenology is a bootloader for Synology’s operating system which is called DSM. It can be used to setup DSM on a PC or in a Virtual Machine like VirtualBox or VMWare.

I am using VMWare 15. But any version from VMWare 11 should work.

 

1: Download and unzip this package, containing:

  • the configuration of the virtual machine (dsm.ovf, dsm.vmx, disk.vmdk and synoboot.vmdk),
  • the xpenology boot file for DS3617xs (synoboot.img) and
  • the image of the DSM 6.2.2 for DS3617xs (DSM_DS3617xs_23739.pat)

Notice that only the image “23739” is compatible with the boot file (Jun’s loader 1.03b).

2: Open VMWare Workstation. If you never configured the default location where you want to create your Virtual Machines, press CTRL-P to open the “Preferences” panel. There, set this default location (I am using D:\VMWare).

3: Go next to "Windows Explorer", in the folder where you have unzipped the package, and double click dsm.ovf. This is going to import the VM into VMWare. Type a name for the new virtual machine (I am using DSM3617 6.2.2) and click “Import”.

4: Here is the outcome to the importation. You can now click on “Power on this virtual machine”. But first, be ready to type F2 in the console to enter the Bios. You will have only 2 seconds to do so!

5: As soon as you have run the VM, click into it to capture the keyboard, and press “F2”. If you missed it, the VM will try to boot from the network. In such a case restart the VM and try again! Once in the Bios, go to the Boot tab and swap the SATA Hard Disk with  the SCSI Hard disk. The VM has indeed to boot with the SATA disk containing the boot loader. Finally, Save and Exit the Bios. The VM will reboot.

6: Again, quickly click into it to capture the keyboard and press the “down arrow” to select the loader for “VMWARE/ESXI” (attention, you don’t have a lot of time to start the selection). Press next Enter and the boot will load. The VM is ready to install the DSM image.

7: Open the “Synology Assistant”, which is more efficient than the page http://find.synology.com to find your VM, and after 1 minute click on “Search”. If you didn’t wait long enough, you will see an Error message (In such a case, click Search “Again”. I never had to do this more than 3 times).

8: Finally, the Assistant will find your VM. A webpage should automatically open (Otherwise, right click on the VM and select “Install”). Click on “Set up” in that page.

9: Click next on the link “Manual Install”.

10: Click on Browse to select the image of the DSM 6.2.2 for DS3617xs and select the file “DSM_DS3617xs_23739.pat” in the folder when you unzipped the package downloaded here previously.

11: Finally, click on “Install Now” and confirm that the installation can override the disk… it’s the virtual SCSI Hard Disk member of the VM. No worry ;)

12: The installation will take a few minutes and once completed, you will see in the VMWare Workstation that the VM is rebooting.

13: On the installation page, you see a count down. If you want to check the status of the VM, you can go back to the Synology Assistant and Click Search. You should see that it’s restarting, etc… and is finally ready. At that moment, you can select the VM and click Connect.

14: You will now be able to login into the VM and configure it. DO NOT select “Install the latest DSM version automatically” or “Install the important updates of DSM automatically”!!! The image 37739 is the latest compatible with the loader used by this VM. Upgrading your DSM will break the VM.

 

15: You have now a DS3617xs with the DSM 6.2.2-23739.

16: DO NOT upgrade or the disk will disappear and the VM won’t work anymore (Someone mentions that mounting the Disk on a SATA controller instead of a SCSI one helped… See here. But it didn’t work for me). Looking into the Synology Assistant, you would see that the Virtual Synology is not configured.

17: It’s now time to use the SCSI Hard Disk to create a first Volume. Open the DSM Main Menu and start the Storage Manager. Go to “Storage Pool” and click “Create”. Use the HDD of 20GB. Next, go to “Volume” and click “Create”. Use the “Storage Pool” created previously.

18: Now, you can upgrade the VM to your version of VMWare. Shutdown the DSM Properly (via the menu on the Buddy Icon in the top-right corner). The VM will soon stop.

 

19: Once the VM stopped, upgrade it by clicking on “Upgrade this virtual machine”.

Et voilà !

Synology Setup DSM 6.2.2 in a Virtual Synology DS918 using VMWare

Here is a step by step "How-To create a Virtual Machine to emulate a DS918 running DSM 6.2.2" using VMWare and Xpenology

Click to Read More

Xpenology is a bootloader for Synology’s operating system which is called DSM. It can be used to setup DSM on a PC or in a Virtual Machine like VirtualBox or VMWare.

I am using VMWare 15. But any version from VMWare 11 should work.

 

1: Download and unzip this package, containing:

  • the configuration of the virtual machine (dsm.ovf, dsm.vmx, disk.vmdk and synoboot.vmdk),
  • the xpenology boot file for DS918+ (synoboot.img) and
  • the image of the DSM 6.2.2 for DS198+ (DSM_DS918+_24922.pat)

2: Open VMWare Workstation. If you never configured the default location where you want to create your Virtual Machines, press CTRL-P to open the “Preferences” panel. There, set this default location (I am using D:\VMWare).

3: Go next to "Windows Explorer", in the folder where you have unzipped the package, and double click dsm.ovf. This is going to import the VM into VMWare. Type a name for the new virtual machine (I am using DSM918 6.2.2) and click “Import”.

4: Here is the outcome to the importation. You can now click on “Power on this virtual machine”. If you want, you may also first increase the Memory, the Processors or the size of the SCSI Hard Disk (Do not touch the SATA Hard Disk which contains the boot loader).

5: As soon as you have run the VM, click into hit to let it capture the keyboard, and press the “down arrow” to select the loader for “VMWARE/ESXI” (attention, you don’t have a lot of time to start the selection). Press next Enter and it will boot.

6: Open the “Synology Assistant”, which is more efficient than the page http://find.synology.com to find your VM, and after 1 minute click on “Search”. If you didn’t wait long enough, you will see an Error message (In such a case, click Search “Again”. I never had to do this more than 3 times).

7: Finally, the Assistant will find your VM. A webpage should automatically open (Otherwise, right click on the VM and select “Install”). Click on “Set up” in that page.

8: Click next on the link “Manual Install”.

9: Click on Browse to select the image of the DSM 6.2.2 for DS918+ and Select the file “DSM_DS919+_24922.pat” in the folder when you unzipped the package downloaded here previously.

10 Finally, click on “Install Now” and confirm that the installation can override the disk… it’s the virtual SCSI Hard Disk member of the VM. No worry ;)

11: The installation will take a few minutes

12: Once the installation complete, you will see in the VMWare Workstation that the VM is rebooting. On the installation page, you see a count down. If you want to check the status of the VM, you can go back to the Synology Assistant and Click Search. You should see that it’s restarting, installing patches, reconnecting and finally ready. At that moment, you can select the VM and click Connect.

13: You will now be able to login into the VM and configure it.

14: It’s now time to us the SCSI Hard Disk to create a first Volume. Open the DSM Main Menu and start the Storage Manager.

15: Go to Volume and click Create. Select the HDD of 20GB, etc...

16: You have now a brand new DS918+ with the DSM 6.2.2-24922 Update 3.

17: Now, you can upgrade the VM to your version of VMWare. Shutdown the DSM Properly (via the menu on the Buddy Icon in the top-right corner). The VM will soon stop.

18: Once the VM stopped, upgrade it by clicking on “Upgrade this virtual machine”.

Et voilà !

Synology Capture a Synology Package during installation

This is an update of a previous post on this topic.

I noticed that since a recent update of DSM, my previous script was not working fine anymore, when trying to capture a spk during installation. So here is an improved version.

Click to Read More


#!/bin/bash
VOLUME=$1
TARGET=$2

#Copy also the expanded package ?
COPYEXPAND=false

if [ -z "$VOLUME" ]; then
echo "usage: capture <source VOLUME> <target dir>"
exit 0
fi

if [ -z "$TARGET" ]; then
echo "usage: capture <source VOLUME> <target dir>"
exit 0
fi

pattern="volume[0-9]+"
if [[ ! $VOLUME =~ $pattern ]]; then
echo "The name of the source volume must be like 'volume<i>' where <i> is numeric"
exit 0
fi

if [ ! -d "/$VOLUME/@tmp" ]; then
echo "Temporary dir not found: /$VOLUME/@tmp"
exit 0
fi

if [ -d "/$VOLUME/@tmp/SynoCapture" ]; then
rm -R "/$VOLUME/@tmp/SynoCapture"
fi

if [ -d "/$VOLUME/@tmp/@synopkg" ]; then
rm -R "/$VOLUME/@tmp/@synopkg"
fi

echo "Press any key to stop the capture"

if [ -t 0 ]; then stty -echo -icanon -icrnl time 0 min 0; fi

count=0
keypress=''
echo "Going to copy the packages into $TARGET/SynoCapture"

if [ ! -d "$TARGET/SynoCapture" ]; then
mkdir "$TARGET/SynoCapture"
fi

while [ "x$keypress" = "x" ]; do
if [ -d "/$VOLUME/@tmp/@synopkg/@download/" ]; then
cp -nlR "/$VOLUME/@tmp/@synopkg/@download/." "/$VOLUME/@tmp/SynoCapture/"
fi

if [ "$COPYEXPAND" = true ]; then
if [ -d "/$VOLUME/@tmp/pkginstall/" ]; then
cp -nlR "/$VOLUME/@tmp/pkginstall/." "/$VOLUME/@tmp/SynoCapture/pkginstall/"
fi
fi
let count+=1
echo -ne $count'\r'
keypress="`cat -v`"
done

if [ -t 0 ]; then stty sane; fi

find "/$VOLUME/@tmp/SynoCapture/" -type f -name '@SYNOPKG_DOWNLOAD_*' -exec sh -c 'x="{}"; mv "$x" "${x}.spk"' \;
if [ "$COPYEXPAND" = true ]; then
if [ -d "$TARGET/SynoCapture/pkginstall" ]; then
rm -R "$TARGET/SynoCapture/pkginstall"
fi
fi
cp -fR "/$VOLUME/@tmp/SynoCapture" "$TARGET/"
rm -R "/$VOLUME/@tmp/SynoCapture"

echo "$count captures done"
exit 0

Now the script will copy only the SPK file into the specified target folder. It's also possible to copy the expanded version by setting the variable COPYEXPAND=true

Also, now, I don't find anymore a folder name "pkglist.tmp" containing files synoserver.enu and otherserver.enu. Those files used to contain the URL's of all SPK available respectively on the official Synology website and on the various SPK servers that you configured in your Package Center > Settings > Package Sources.

To make the capture even easier, I have create a Package named "MODS Package Capture, available on my SPK Server and published on GitHub.

Synology Can't install/uninstall/repair Synology Virtual Machine Manager - Upgrade DSM not possible

I was unable to upgrade my DSM from 6.1.7 to 6.2.1 because it was pretending to be member of a Virtual Machine Manager cluster. Which was not correct as Virtual Machine Manager was not installed 'anymore'.

Click to Read More

I used to test the beta version of Virtual Machine Manager a long time ago. But since a while, Virtual Machine Manager is not installed anymore on my Synology and it was clearly visible neither in the DSM menu nor in the Package Center.

Unfortunately, for some unknown reasons, my DSM thought that it was still part of Virtual Machine Manager cluster. As a consequence I was getting the following warning when upgrading my DSM: "This device is part of a Virtual Machine Manager cluster. Other hosts in the Virtual Machine Manager cluster will also need to be updated".

Trying to upgrade was always failing (without breaking my DSM, fortunately).

I initially thought it could possibly be due to the network Bond I did create. So I tried to remove it via Control Panel > Network. But it failed with the message : "Creating or deleting this bond is prohibited because the operating interfaces includes the cluster interface of Virtualization. Please shutdown these quests and try again: {0}. Creating or deleting the bond is prohibited because of abnormal status of Virtualization cluster, please go to Virtual Machine Manager see the details."

Based on this message, and since it was not installed anymore, I tried to reinstall the Virtual Machine Manager. Unfortunately, the installation was failing and the package was stuck in a "repair" status.

Being unable to 'repair' it by clicking on the "Repair" button, I tried to uninstall it. This was also failing, with the following message: "You cannot remove this package because this Synology NAS is a part of a Virtual Machine Manager Cluster. Please remove the host from the cluster to proceed."

Argh !!!

Bref... I tried to 'erase' the package using my own Package Manager (See my SSPK server). It's doing something similar to the trick explained here to delete all files related to the 'Virtualization' package.

Once the package fully erased, I did reinstall it again but still without any success... And again it was stuck in a "repair" status and I was unable to uninstall it properly.

 

As I couldn't find any config file where I could see that my NAS was a member of a Virtual Machine Manager cluster, I tried to fix myself the installation of the package. I couldn't really fix it (I couldn't see which step of which installation or upgrade script was failing). But I have been able to force the installation to complete by deleting the file '/var/packages/Virtualization/installing'.

Next, the package Virtual Machine Manager appeared in status 'Installed' but 'stopped'. I was however able to "Start" it without any problem !! I could see in this Manager that my NAS indeed used to be configured as a member of cluster.

And, miracle (even without deleting the cluster), running now the upgrade of my DSM finally succeeded !!!

After the upgrade, I did remove my NAS from the cluster.

Et voilà.

[PS] I did use the Virtual Machine Manager a long time ago to test how Windows was running in a VM. It was a bit too slow for me so I did remove the Virtual Machine Manager. Probably that the cluster was not deleted at that time. Hence all the problems here above.

[Edit] Once the DSM upgraded, I did delete the Virtual Machine Manager cluster. But as a consequence, I did lost all connections onto the NAS (ftp, web, plex, ssh, ...). I was only able to see the NAS using the Synology Assistant. TO solve the problem I did shutdown the NAS by pressing the power button for a long period. After the reboot, everything as working fine. No, starting the Virtual Machine Manager, it starts a wizard to create a new cluster.

Synology Search for file on Linux using grep and find

Search for files containing a certain text, on my Synology, ignoring warnings like ' Permission denied'

Click to Read More

Just a note for myself... as I always forgot the syntax :/

Using grep only

grep -rnlw '/path/to/somewhere/' -e 'pattern' 2>/dev/null

grep -rnlw 'text' '/path/to/somewhere/' 2>/dev/null

  • -r or -R is recursive,
  • -n is line number, and
  • -w stands for match the whole word.
  • -l (lower-case L) can be added to just give the file name of matching files.

Using find

find '/path/to/somewhere/' -type f -exec grep "text" '{}' \; -print

Synology Find and kill all tasks running for a service/package on a Synology

I wanted to kill all tasks running on my Synology for a package before uninstalling this one. Here is the how-to:

Click to Read More

The tasks running for a service are all listed in /sys/fs/cgroup/cpuacct/[the service]/tasks

The service can be pgsql, nginx, nmbd, ftpd, sshd, ... or synotifyd, synologd, synobackupd, ... or a package like pkgctl-CloudSync, pkgctl-AudioStation, pkgctl-SurveilanceStation, ...

Ex.:

  • To see all tasks running for Synology's StorageAnalyzer, type something like: cat /sys/fs/cgroup/cpuacct/pkgctl-StorageAnalyzer/tasks
  • To kill all those tasks, type something like: for task in $(cat /sys/fs/cgroup/cpuacct/pkgctl-StorageAnalyzer/tasks); do kill $task; done

Synology License and installation wizard not shown when installing Synology Package

I noticed this morning that my Synology is not showing the License and the Installation Wizard anymore when installing my own Packages (Packages made with my app MODS and hosted on my own SSPK Server).

Click to Read More

I am not yet able to understand why the Installation Wizards and the Licence file of my own packages are not shown anymore, when installing them from my SSPK server via "Package Center" > "Community". But everything works fine when installing them "Manually" via "Package Center" > "Manual Install" (and browsing to pick the spk into the folder of my SSPK server).

The Upgrade Wizards and even the "Confirm settings" screen are also not displayed... While the Uninstallation Wizard works fine in all cases ?!

My DS1815+ is running DSM 6.1.7-15284.

I have compared all the logs created in /var/log/ during the installation and noticed a few differences. First, when installing a package from my SSPK server, there are 'messages' being logged:

2018-11-03T22:26:05+01:00 ... synoscgi_SYNO.Core.Package.Installation_1_install[21663]: resource_api.cpp:163 Acquire service-cfg for [the package I am installing] when 0x0001 (done)

This is logged each time I am installing a package from my SSPK Server but not when install the same package manually.

Next to those messages, the following INFO are also logged in synofeasibilitycheck.log:

2018-11-03T22:25:50+01:00 ... synoscgi_SYNO.Core.Package_1_feasibility_check[21529]: feasibility_check.cpp:87 FeasibilityCheck: [Info] Start feasibility check [package_install] with type [hard].
2018-11-03T22:25:50+01:00 ... synoscgi_SYNO.Core.Package_1_feasibility_check[21529]: feasibility_check.cpp:106 FeasibilityCheck: [Info] [0] of feasibility check [package_install] failed.
2018-11-03T22:25:50+01:00 ... synoscgi_SYNO.Core.Package_1_feasibility_check[21529]: feasibility_check.cpp:79 FeasibilityCheck: [Info] No [package_install] feasibility check config with type [soft].

 

Synology How to backup Photo from a mobile onto a Synology

I used to rely on DS Cloud to backup my complete Android mobile onto my Synology (both internal and external storage). But after Android 4.4.x, the files must be stored under /storage/<your external sd>/Andoid/data/com.synology.dsclooud/files. It means DS Cloud may not backup the DCIM folder locate on the external SD.

The solution is to get rid of DS cloud and use DS File or DS Photo - or a third party, but this a less preferred option for me...

Click to Read More

DS Photo

It has a feature to backup all photos from a mobile (Android or iOS) into one folder/album of the Photo Station. But it means that Photo Station must be installed.

See documentation here (loo for Upload and Download Photos).

It's really slow because it needs to create the thumbnails, etc... for Photo Station and seems even to stop from time to time. You have to open it to check that it runs effectively.

Pay attention to not check the option that frees space. It will deleted the photos on your mobile after the upload.

NB.: It also backup movies ("You can upload photos or videos from ..."), but does not seem to do it as long as all photos are not yet uploaded. Many old videos were not yet uploaded onto my Synology although photos with the same age were already processed. And after the backup of 1000th of photos, I finally saw a long list of videos being uploaded.

DS File

It has a feature to backup all photos and videos into any subfolder of a shared drive. As far as I am concerned, I do backup into a subfolder of my "home" on the Synology.

See documentation here (look for Backing up Photos and Videos).

Pay attention to not check the option that frees space. It will deleted the photos and movies on your mobile after the backup.

DS File can backup photos and videos from all detected locations containing media: DCIM (external storage), Office Lens, PhotosEditor, WhatsApp Images, WhatsApp Video. But you may not specify yourself a custom folder. It's nevertheless the best option to backup all media in my opinion.

Attention, I noticed that DS File consumed a lot of power during the first backup, so it was suggested to be put in deep sleep mode. But doing that stops the backup background process. Compared to DS Photo, it's quite exactly the same behavior and configuration but one can chose the target folder on the Synology. Also, it is much faster (as it does not have to create anything for the Photo Station) and backup all videos and photos simultaneously.

Moment

There is now a new application, named Synology Moment, which also comes with a Backup feature for photos and videos, similar to Photo Station. I didn't test it yet.

(Synology Moment is combined with Synology Drive, an application replacing Cloud Station Server)

SynologyWordpress Solve a 504 Gateway Time out nginx with WordPress on Synology

Recently, accessing WordPress on my Synology started to result in "504 Gateway Time out nginx" errors.

I found the solution here.

Click to Read More

  1. Open a ssh console using Putty as explained here.
  2. Enter root mode by typing: sudo -i
  3. cd /etc/nginx/
  4. chown -hR http:http conf.d/
  5. cd conf.d
  6. vi www.WordPress.conf
    1. Add: proxy_connect_timeout 600;
    2. Modify: proxy_read_timeout 600;

Synology Use a VPN between an Android mobile and a Synology NAS via Proximus network

I spent hours trying to figure out why I couldn't connect my Galaxy S7 onto my Synology using a PPTP VPN on the Proximus 3G/4G Network (Belgium) while it was working fine if connected via WiFi.

Finally, I gave up and configured a L2TP/IPSec VPN. This one worked immediately like a charm, both on WiFi and 3G/4G. I am quite sure this is due to Proximus configuring my profile to use CGN (Carrier Grade NAT).

Click to Read More


I was initially inspired by this post ("Using Synology DiskStation as a VPN server using built-in Android VPN client"). So;

  • I did first configure my Synology VPN Server to use PPTP as explained here (Official Knowledge base Synology)
  • Next, I did open my Synology Firewall (port 1723 for PPTP) via the Control Panel > Security > Firewall > Edit Rules > Edit an entry to Allow > Select Built-in applications > VPN Server (PPTP)

Open Firewall Synology for VPN

  • Then, I did configure my Modem to route the TCP port 1723 to my NAS via Access Control > Port Mapping

Configure Proximus Modem Route

Configure Proximus Modem Route

  • Finally, I configured a PPTP VPN on my Galaxy S7 via Settings > Connections > More connection settings > VPN > ADD VPN

It worked immediately while connecting my Galaxy S7 via WiFi. But if failed while connected via 3G/4G. To investigate, I did enable the firewall of my dd-wrt router (placed between my modem and my NAS) and configured it to send all its firewall messages to the syslog server of my Synology (the "Log Center"). I those logs, I found packets corresponding most probably to the VPN requests from my Galaxy S7 (They were only arriving when I was trying to establish a connection). Those were not coming from my Galaxy S7's IP. Instead, they were coming from another Proximus IP, with a protocol 47 (Generic Route Encapsulation)?! Could this be due to Proximus configuring my profile to use CGN (Carrier Grade NAT)? Unfortunately, I couldn't check and reconfigure this myself as the option is not available anymore via the MyProximus administration interface...

So, I decided to give up with this PPTP VPN and use a more secure but less performant VPN: L2TP/IPSEC with a PSK (IPsec pre-shared key). And miracle, after opening and routing the UDP ports 500, 1701 and 4500, it worked !