Synology Customize Mac & Serial of Xpenology images to run Synology in VMWare

Here are:

  • all my Xpenology packages used to emulate a Synology with VMWare and
  • how to customize their Mac Address as well as their Serial Number

Click to Read More

The DSM images available in the packages above come from these Synology's archives.

You can find here or here how to create a Virtual Synology with theses packages (Notice I have fine-tuned those, among others to put the disks in the right boot order for the DS3617xs).

 

Before importing a package in VMWare, you can update its Mac Address and its Serial to make them unique in your network (E.g.: if you duplicates the images). For that purpose, you need OSFMount, a tool able to update (read and write) the content of .img files.

Run OSFMount and open the disk image file "synoboot.img" (Do not mount it as Ram Drive):

"Select All" the partitions as virtual  disks and uncheck the flag "Read-only drive":

Once opened, double-click on the first drive in the list to open it. It contains the settings to be customized in the file drive:\grub\grub.cfg. Edit that file to change the Serial (set sn) and the MAC address (set mac1):

A new MAC address can be generated using VMWare; via a Network Adapter > Advanced > Generate. Click on the button Generate a few times and copy the value in the file above (removing the various semicolons).

A new Serial can be generated on this site.

Once done with the edition, "Dismount All" the drives in OSFMount. You can now import the virtual machines in VMWare.

Et voilà.

Synology Use a Bridged Network for a Virtual Synology using VMWare

Within the Virtual "Synologies" created as described here and here, I was using NAT for the Network Connection. To use a Bridged Network Connection is not easy, but can work.

Click to Read More

I wanted to reconfigure all my Virtual Synology to use NAT instead of a Bridged Network Connection.

But once this is done, the Virtual Synology does not appear anymore as configured in the Synology Assistant (which opens the Network Wizard). And trying to reach it via a browser, on its admin port,  results in connection timeout.

If I wait for several minutes (sometimes more than 10') and try again and again to reach my various Virtual Synology on its admin port, I finally get them.

I don't know yet why this is not immediate ?!... I seems to be an issue with the Bridged Connection of VMWare under Windows 10.

 

I tried to clean the arp table (Run as Command Prompt as Administrator on Windows and type: arp -d *). But without success. And the problem comes back not only each time the VM is restarted, but also sometimes while running since a while...

I did check that the Mac Address of each Synology (displayed by the Synology Assistant) was correctly defined in VMWare:

See here how to customize the MAC Address of a Synology image.

 

I also checked that the Bridged Connections were correctly configured in VMWare as suggested here:

  1. Be sure your vm is stopped.
  2. Run the VMWare Virtual Network Editor (click Start and search for Virtual Network Editor)
  3. Run it as administrator (or click the button at the bottom of the screen that says, "change settings." VMNet0 will dislpay when running as administrator. Otherwise, it will not be visible)
  4. Highlight VMNet0 and click on "Automatic Settings"
  5. You will see a list of adapters. De-select all but the physical network card. (When I set up up with player, I had selected only the 1. After install of workstation, all of the items were checked.)
  6. Click "OK"
  7. Click "Ok"
  8. Start the VM and test.

 

I tried next various tips from here and here, such as stopping and restarting the vmnetbridge. The best results are achieved by deleting all the virtual adapters in the VMWare Virtual Network Editor, creating a new one bridged to a specific Ethernet Adapter and finally using that one as a "Custom: Specific virtual network" as Network Adapter for each VM.

 

But I still have randomly some VM with a "Connection Failed" status in the Synology Assistant. If I found how to definitively fix this issue, I will post it here.

Synology Synology's Scheduled Tasks

I would like to find how to create Scheduled Tasks to execute a User-Defined Scripts on Synology using commands in a shell script. But I don't find how-to. Here are the only info I was able to get.

Click to Read More

The tasks created via Control Panel > Task Scheduler > Create > Scheduled Task > User-defined Script, are stored in the file /etc/crontab. Ex.:

The tasks id are stored in /usr/syno/etc/scheduled_tasks. Ex.:

[1]
id=1
last work hour=23
can edit owner=1
can delete from ui=1
edit dialog=SYNO.SDS.TaskScheduler.EditDialog
type=daily
action=#common:run#: /usr/local/bin/php73 /var/packages/MODS_ServerMonitor/target/ui/cron/status.cron.php
can edit from ui=1
week=1111111
app name=#common:command_line#
name=Update Server Mon
can run app same time=1
owner=0
repeat min store config=[1,5,10,15,20,30]repeat hour store config=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]simple edit form=1
repeat hour=0
listable=1
app args={"notify_enable":false,"notify_if_error":false,"notify_mail":"","script":"/usr/local/bin/php73 /var/packages/MODS_ServerMonitor/target/ui/cron/status.cron.php"}
state=enabled
can run task same time=0
start day=0
cmd=L3Vzci9sb2NhbC9iaW4vcGhwNzMgL3Zhci9wYWNrYWdlcy9NT0RTX1NlcnZlck1vbml0b3IvdGFyZ2V0L3VpL2Nyb24vc3RhdHVzLmNyb24ucGhw
run hour=0
edit form=SYNO.SDS.TaskScheduler.Script.FormPanel
app=SYNO.SDS.TaskScheduler.Script
run min=0
start month=0
can edit name=1
start year=0
can run from ui=1
repeat min=15

The task can also be displayed via a command line run as root (See here):  sudo synoschedtask --get id = 1

ID: [1]
Name: [Update Server Mon]
State: [enabled]
Owner: [root]
Type: [daily]
Start date: [0/0/0]
Run time: [0]:[0]
Repeat every [15] min (s) until [23]:[45]
Command: [/usr/local/bin/php73 /var/packages/MODS_ServerMonitor/target/ui/cron/status.cron.php]
Last Run Time: Mon Oct 28 23:00:02 2019
Status: [Success]


Synology Use opkg instead of ipkg on Synology

IPKG is not maintained anymore since 2014. As a replacement, one can use Entware, which offers more than 1800 packages.

Click to Read More

First enter a SSH session on your nas as root (See here).

Check if your CPU model is a armv5, armv7, mips, x86-32 or x86-64. You can do so with one of the following command:

  • cat /proc/cpuinfo | grep -m 1 'model name' | cut -d ":" -f 2 | cut -d "@" -f 1
  • uname -a

Create now a folder to install Entware (NB.: The folder /opt may not yet exist. I.e.: Optware may not be installed yet. We will delete it if it exists. If it cannot be deleted - you could have a message that it's in use - then reboot your Synology first).

mkdir -p /volume1/@entware-ng/opt
rm -rf /opt
ln -sf /volume1/@entware-ng/opt /opt

Depending on your CPU, execute one of the following commands

  • For armv5: wget -O - http://pkg.entware.net/binaries/armv5/installer/entware_install.sh | /bin/sh
  • For armv7: wget -O - http://pkg.entware.net/binaries/armv7/installer/entware_install.sh | /bin/sh
  • For mips: wget -O - http://pkg.entware.net/binaries/mipsel/installer/installer.sh | /bin/sh
  • For x86-32: wget -O - http://pkg.entware.net/binaries/x86-32/installer/entware_install.sh | /bin/sh
    For x86-64: wget -O - http://pkg.entware.net/binaries/x86-64/installer/entware_install.sh | /bin/sh

Go now to your DSM and open the "Control Panel". There, select the "Task Scheduler" > "Create" > "Triggered Task" > "User-defined script"

Configure this new task to run at "Boot-up" :

And to run the following commands:

/bin/ln -sf /volume1/@entware-ng/opt /opt
/opt/etc/init.d/rc.unslung start

Finally, to include /opt/bin and /opt/sbin to the PATH variable, add . /opt/etc/profile at the end of /etc/profile with this command:

echo ". /opt/etc/profile" >> /etc/profile

You can now use the command opkg. The first action to do is: opkg update

Check the list of packages available with: opkg -list | more

 

 

NB.: To remove IPKG from your Synology:

  1. umount /opt
  2. rm -R /opt
  3. rm -R /volume1/opt or rm -R /volume1/@optware (depends on where IPKG was installed)
  4. delete every reference to optware in /etc/rc.local
  5. rm /etc/rc.optware
  6. check that there is nothing related to ipkg in /etc/crontab
  7. reboot your NAS

Tips Fix SD card or Memory of external devices not visible

Recently, I plugged on my PC various devices having an internal SD card or an internal Memory. And although I could hear the typical sound made by Windows when a device is plugged in, no new Drive appeared in Windows Explorer. The problem was with a Mounted Network Share using the same letter as the one assigned by Windows to the new Drive.

Click to Read More

Looking into the "Device Manager" console, I didn't see any devices not recognized as illustrated here under. So, the device was correctly recognized and its drivers correctly installed.

I tried different USB cables and different USB ports (both 2.0 and 3.0), but without success either.

Finally, I opened the "Computer Management" Console and looked into the "Disk Management" part. There I saw a Drive greyed out. I noticed that it was assigned with a letter which was actually used by a Mounted Network Drive. I did simply right click on it to "change Drive letter" with another one and it appeared magically into the Windows Explorer. 

To be complete, I have to mention that the conflicting Mounted Network Drive was not available and all letters between C: and the one used for the Mounted Network Drive where in use . This was maybe the actual root cause of Windows assigning the same letter to a new USB Drive.

Et voilà.

Synology Retrieve files and folders from a Synology C2 backup

My Nas Synology died recently and I wanted to retreive some content from my Synology C2 Backup.

Click to Read More

After 3 years being 24/7, my DS1815+ does not turn on anymore when I press the power button. The problem is not with the power supply. I did change it, but with no luck.

Fortunatelly, I was using Hyper Backup to daily compy everything into "Synology C2 backup". 

But it's not possible to retreive a complete foder from the backup via the Synology C2 web page. One can only download file by file :(

To download a complete folder at once, you need the "Synology Hyper Backup Explorer" for desktop available in the Destkop Utilities section of the downloads.