The user basically created a statically linked versus a dynamically linked version of rsync which runs without relying on libraries that may or may not be present on ESXi. My initial attempts failed using both a 32/64bit CentOS 5.5 and latest version of rsync 3.0.7 and 3.0.3. The compilation of rsync was successful, but upon executing on ESXi, it immediately had a segmentation fault. I started to think there might be some dependencies in libraries that were used to compile rsync that I was missing. I was also in conversation with Alain Spineux, creator of MKSBackup regarding this same topic and he had found a way to compile rsync based on the article Hacking ESXi by Stjepan Groš.
Stejepan found that using CentOS 3.9, one could compile both statically and dynamically linked binaries without any modifications to ESXi. Though Stejepan did not provide the steps to compile rsync, it is relatively simple to do so. I also found that you do not need to use older 3.0.3 release of rsync, you can use the latest version which is 3.0.7 as of writing this article.
Before we get started, let me remind you of the disclaimer:
*** THIS IS PROBABLY NOT SUPPORTED BY VMWARE, USE AT YOUR OWN RISK ***
Step 1Download and install CentOS 3.9 i386 - You can find a list of download sites here
Step 2With a default installation of CentOS 3.9, you just need to get GCC installed
yum -y install gcc
Step 3Next you will need to download the latest version of rsync which is 3.0.7 here and SCP it to your CentOS system
Step 4Next you will now extract the contents of the rsync-3.0.7.tar.gz
tar -zxvf rsync-3.0.7.tar.gz
Step 5Now you will change into the rsync-3.0.7 directory and run the configure command
Step 6Now you will run the make command which will compile rsync, but you will also be passing in additional flags to create a statically linked binary
make CFLAGS="-static" EXEEXT="-static"
Step 7Finally, you will need to run the strip utility which discards all symbols from object files
You now have a self-contain rsync binary labeled rsync-static found in the current working directory
/tmp/rsync-static --compress --progress --stats -e dbclient -Rr /etc build-centos:/upload
You may have noticed in the command line we are specifying "dbclient", by default rsync will go over SSH but ESXi does not actually have the traditional ssh client that we are all used to. It actually uses dropbear which is tiny SSH server and client which is frequently used in embedded systems such as Busybox.
Alain also found that retrieving peer name may fail and the rsync code currently does not properly handle this failure and just exits. By looking at the clientname.c source code which is part of rsync, Alain noted that even the developers left a comment that states the error could probably be handled without exiting. The fix is to just comment out the rsynerr line which does not force the program to exit when hitting this problem and this can be found on line 171.
I would like to thank Alain for sharing this tidbit of information