The test virtual machines provided by Microsoft expire after 90 days, they start shutting down on their own while you are working. There is way to extend it after its expiry.
Open command prompt in admin mode and execute the below command
Restart your machine and then execute the below command in prompt to check the licence information
Now activate your licence
With this trick you can renew your licence 3 times beyond the 90 days expiry.