Monday, November 11, 2013

How To Reset ESXi Trial License

WARNING: This is for education/informational testing/development purposes only, and should not be used on a production server.

WARNING: This trick will only work with an ESX(i) stand alone server.  It will not work if the ESX(i) server is connected to a vCenter Server, as the vCenter Server knows better than to let you do this.  (you can always remove and readd the ESX(i) server to vCenter.)

To reset your ESX 4.x, ESXi 4.x and ESXi 5.x 60 day evaluation license:
  1. Login to the TSM through SSH or Shell
  2. Remove the following two files:
    1. /etc/vmware/vmware.lic
    2. /etc/vmware/license.cfg
  3. Reboot server
If your ESX server is connected to a vCenter server, please remove the ESX server first.  Once the steps above are completed, you can add it back to the vCenter server.

Sample commands:
rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg
reboot




For ESXi 5.1 and ESXi 5.5, you may need to continually remove the license files as the server reboots for this to work.  The following should do this quite nicely:

rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg
reboot ; while true ; do
    rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg
done




An alternative shows that restarting the services should works just as well as rebooting the server:
# For ESXi 5.0
rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg
services.sh restart
# For ESXi 5.1
rm -r /etc/vmware/license.cfg
cp /etc/vmware/.#license.cfg /etc/vmware/license.cfg
/etc/init.d/vpxa restart

The alternative also shows a method for resetting the trial license while connected to vCenter server.  I still think removing and re-adding the ESXi server is cleaner.




19 comments:

  1. No need to disconnect from vCenter Server or reboot required.

    rm -r /etc/vmware/license.cfg
    cp /etc/vmware/.#license.cfg /etc/vmware/license.cfg
    /etc/init.d/vpxa restart

    ReplyDelete
    Replies
    1. Patrick, you awesome dude from the internet. This works for ESXi 6!

      Delete
    2. Patrick, many thanks to you man! Live long and be happy!

      Delete
    3. Thank you!! is there a limit to amount of times you can do this?

      Delete
    4. Hi,

      Is this work ?? if host contain VMs??

      Delete
    5. Yes. The only issue I had was that I waited till they expired completely in a lab and I had to reboot the hosts in that cluster. Restarting the services did not work. Also, when the day came that they were SUPPOSED to expire the next time, the hosts still disconnected from VCenter, but I was able to just add them back. All VM's kept running, of course. Clearly one would not mess around with this in a production environment.

      Delete
  2. Is that safe to use (will they send lawsuit)?

    ReplyDelete
    Replies
    1. If you're not using it for business, most likely not. I have my test beds use this on top of my VMUG licenses. I think they are smart enough to know that the more people that know how to use their product the more it will proliferate.

      Delete
  3. Hi im fairly new to this. when resetting the trial, i would migrate the vms, key in the commands on the host and reboot right? lets say we have 3 hosts and vCenter is on the last one. When i reach the last host i would migrate the vms out. In the process of doing so, should i migrate vCenter out too? im abit confused in how to approach the situation.

    ReplyDelete
    Replies
    1. If you check out Patrick Reynolds' post you don't have to do the reboot. You should however move the VMs to another host. That includes vCenter. Don't overthink it, it really is just that simple :)

      Delete
  4. How to reset the vcenter license, as the esxi host issue is fixed but now the vcenter says it expires in 5 days? please assist.

    ReplyDelete
  5. Try reseting the time back. I my case the vcenter is getting it's time stamp through the ntp server (dc).

    ReplyDelete
    Replies
    1. It will change the time, but it seems like the license won't extend/ renew.

      Delete
  6. In not so distant future the emphasis on local applications is evaluated to contract the ascent of half and half, numerous usefulness applications in view of HTML 5 whatever other overhauled rendition. 4k video downloader license key

    ReplyDelete
  7. I know this is a long dead thread but does anyone know if this will work for ESXi6.5U2?????????

    Thank you in advance!!!

    ReplyDelete
    Replies
    1. Yes, it is working for me on our 6.5.0 Update 1, Build 5969303.

      Delete