1

I try to backup esxi via rsync over ssh. I run rsyc but I get error:

# rsync -e ssh -av root@ip.esxi:file.txt .
sh: rsync: not found
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(635) [receiver=3.0.3]

If I connect with ssh/scp everything is fine.

amiad
  • 161
  • 1
  • 1
  • 7

4 Answers4

8

The rsync command is not part of the default ESXi installation. ESXi uses a modified version of Busybox to provide a limited subset of Linux commands on the console. That's why rsync isn't available. While it's possible to dump a statically-compiled rsync binary onto an ESXi host, this is not the way to handle backups with VMware.

You can use scp, however.

There are better tools for VMware backups and handling virtual machines, though.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
6

rsync is not installed, or not installed in a location that is in your $PATH on the remote side

Regan
  • 1,011
  • 1
  • 7
  • 15
4

You need rsync on your ESXi. You can get a binary here.

Damien Debin
  • 164
  • 4
1

why not mount esxi file systems on a third machine with sshfs and rsync support, like so:

#mount src esxi file system
sshfs root@aaa.bbb.ccc:/vmfs/volumes/ mnt/sshfs/
src="mnt/sshfs/"
vmd="Storage_vmfs5/vm1-data"
#mount dst esxi file system
sshfs root@xxx.yyy.zzz:/datastore-vms/ mnt/tmp/
dst="mnt/tmp/"
#copy vm files
rsync -av --progress --stats --delete --force "$src$vmd" "$dst"
#unmount
fusermount -u $src; fusermount -u $dst
nils-holmberg
  • 311
  • 2
  • 5