pderwael
Contributor
Contributor

FTP client on ESXi 5

Hi gurus..

I'm running a few VMs on ESXi 5 which I need to backup
My backup facility is remote and only accessible by FTP (not even sftp)

I've been googling for a ftp client on ESXi, and I found posts about ftpput & ftpget (although on ESXi 3 & 4)
I can ssh to the ESXi host, but ftpput & ftpget do not seem to work (not found)

I guess I'm close to the solution, but I must miss the last bits...

13 Replies
pderwael
Contributor
Contributor

Ok, I'm one step further

Downloaded the busybox binary from  busybox.net/downloads/binaries/1.19.0/busybox-x86_64 and made links to ftpput & ftpget

Next step is how to get through the ESXi firewall: the outgoing connection (FTP client) is allowed, but I still can't get through.

~ # ftpput -v -u <user> -p <pass> -P 21 <host.domain.net> /etc/hosts
Connecting to <host.domain.net (IP:21)
ftpput: cmd (null) (null)
ftpput: cmd USER <user>
ftpput: cmd PASS <pass>
ftpput: cmd TYPE I (null)
ftpput: cmd PASV (null)
ftpput: can't connect to remote host (IP): Connection timed out
~ #

0 Kudos
dhabbetichandra
Enthusiast
Enthusiast

The following link may help you

http://vm-help.com/esx/esx3i/ESXi_enable_FTP.php

0 Kudos
pderwael
Contributor
Contributor

Thank you for your post, but I do not need a FTP server, I jst need a  working solution for a FTP client ...

0 Kudos
peetz
Leadership
Leadership

Does it work better when you disable the firewall completely? (Run "esxcli network firewall set --enabled false" in an ESXi shell to disable it).

There are probably more open ports required when you run ftp in active mode. You could also try to configure your FTP server to use passive mode only.

- Andreas

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
0 Kudos
pderwael
Contributor
Contributor

Andreas,

The answer is yes and no ...

I can go through the firewall, but the FTP server  kicks me with a "Connection refused". I need to talk to my backup provider about this

Also, complely disabling a firewall makes me always somewhat nervour, even for the duration of a backup

Thanks!

0 Kudos
peetz
Leadership
Leadership

I would disable the firewall just temporarily to test if it makes a difference...

If it works with the firewall disabled you can be sure that you need to open additional ports on the firewall to make it work.

The message "Connection refused" by the FTP server can also indicate that the FTP server is not able to connect back to the ESXi host, because it is blocked by the firewall.

If you have the chance to try and use FTP passive mode I would definitely go for that, because it is more "firewall friendly" than active mode.

- Andreas

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
0 Kudos
pderwael
Contributor
Contributor

Andreas,

I ran the test with the firewall completely disabled. Getting the "connection refused" tells me that I need to contact my FTP server provider.

Also, passive is not quite possible, as I'm stuck with Busybox ftpput/ftpget on ESXi

Thanks!

0 Kudos
markokobal
Enthusiast
Enthusiast

Hi,

Have you ever manage to solve this? I would also like to upload some files from ESX 5.1. I've downloaded the latest BusyBox binary and tried ftpput, but I get "can't connect to remote host (xxx): Connection timed out". I've verified with my FTP server (pure-ftpd) that user succesfully log's in, but when the actual transfer shoudl begin, nothing happens and I get the "connection timed out" message. Has this something to do active/passive ftp mode? Is BusyBox using active or passive ftp mode?

-- Kind regards, Marko. VCP5
0 Kudos
pderwael
Contributor
Contributor

Hi

No, my issue is still not solved as I would like to see it.

However, I have found that it was easy to copy files to/from my Esxi with scp & sftp: simply enable SSH from the security profile and off you go.

I know, this is still no (S)FTP client, but at least I can manually backup my VMs

I've done this a while ago and I do not remember all the details.

If you need more info, just page me, I will do my best to help Smiley Happy

Hope this helps !

Cheers

0 Kudos
peetz
Leadership
Leadership

Hi,

you can get an FTP client to work in ESXi 5.x when opening the firewall for the FTP client and using active (not passive) mode.

In the following blog post I outlined how to use the ncftpput tool to backup ESXi to a FTP server. The example can be easily modified for other purposes:

http://www.v-front.de/2012/09/the-sbhvl-project-part-2-backup-and.html

- Andreas

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
0 Kudos
jithhago
Contributor
Contributor

Thanks for the tip on disabling the firewall --- that worked for me!

Also, I would check out wget for a ftp client.  That works and also works with credentials:

wget ftp://user:password@host/path

Of course...  this is NOT secure.  The password is sent as plaintext over the network.  So, if security is an issue, don't use ftp.

0 Kudos
Froggiz
Contributor
Contributor

Hi,

i found a way using ncftp

  1. activate ssh on your esxi
  2. download ncftp linux files at adress ftp://ftp.ncftp.com/ncftp/binaries/ncftp-3.2.5-linux-x86_64-glibc2.3-export.tar.gz

    * from windows:

    copy past the url into your web browser

    use winrar to extract files

    upload bin files to your esxi using SFTP option on a ftp client (SFTP is included in ssh)


    * from esxi:

    temporary disable firewall

    esxcli network firewall set --enable false

    get ncftp files

    wget {Archive.tgz}

    create a folder where tar will be extract

    mkdir {TargetFolder}

    extract them

    tar -C {TargetFolder} -xvzf {Archive.tgz}

    once extracted you can move the bin folder to where you want using the command "mv"


  3. in esxi ssh go to the bin folder, find ncftpput (the nftp command to upload file) and add execute rights

    chmod +x ncftpput

  4. disable temporary firewall (due to passive mode)

    esxcli network firewall set --enable false

  5. upload your file !

    ./bin/ncftpput -u {user} -p {pass} -v -z -t 5 -F -P 21 {server} {serverPath} {localFilePath}

    -v = use progress meter (not really usefull)

    -z = resume mode

    -t = timeout in secondes

    -F = passive mode (-E for active mode)

    -P = port


    if you dont use passive mode, u can disable only ftppart of the firewall with the command:

    esxcli network firewall ruleset set -r ftpClient -e false

  6. re-enable firewall

    esxcli network firewall set --enable true

wiki.frogg.fr
Neutro
Enthusiast
Enthusiast

Thank you Froggiz for this useful information on ncftp! Can't belive that vmware didn't add an integrated ftp client to their web interface, i mean cmon guys it's almost 2020!

I've tried using ncftpput to upload a vm files to a backup ftp but i kept getting a "miscellaneous error" while doing so.

Took me some time to find out that the transfer crashed when the upload speed was getting above 100 MB/s.

The problem was due to the default TCP/IP buffer size used by ncftpput that was not large enough for transfering at that speed, probably creating buffer overflows which generated the "miscellanous error".

Thanksfully ncftpput let you change the TCP/IP buffer size with the parameter -B as explained in ncftpput(1) manual page. After setting the TCP/IP buffer size to 999999 the error was gone.

Anyway this is a great way to save VMs on an esxi to a ftp server.

0 Kudos