@ptgay1949
Welcome to HP Forums,
Let's get straight to it!
Hardware failure or system instability can cause the computer to reboot automatically.
The issue could be the RAM, Hard Drive, Power Supply, Graphic Card or External devices: – or it could be an overheating or BIOS issue, that brings me to my question, do you have any overheating issues? and did you make any changes to the BIOS lately?
While you respond to that, here's what you need to do:
(HP doesn't support Ubuntu as of yet, hence I'd request you to troubleshoot only using the Windows OS)
Step 1: Disable the automatic restart option to view error messages
Errors might occur but not display with Automatic restart enabled. Disable this option to allow the computer to display error messages instead of restarting.
-
In Windows, search for and open View advanced system settings.
-
Click Settings in the Startup and Recovery section.
-
Remove the check mark next to Automatically restart, and then click OK.

-
Restart the computer.
The computer no longer restarts automatically when a problem occurs. Instead, a blue screen displays with useful information. You can search for a resolution using the information in the error.
FOR DETAILS & FURTHER INSTRUCTIONS, USE THIS LINK: CLICK HERE (SKIP TO STEP 3)
(By the end of this article all the issues should be resolved)
Keep me posted, as I (Or a trusted colleague) shall follow-up on this case to ensure the concern has been addressed,
And your device is up and running again, only in case you don't get back to us, first!
That said, If the information I've provided was helpful, give us some reinforcement by clicking the solution and kudos buttons,
That'll help us, and others see that we've got the answers!
Good Luck.
Riddle_Decipher
I am an HP Employee