when we set up the ubuntu server in the virtual box VM it's likely that the root account is currently locked and does not have a password set. This is a security measure to prevent unauthorized access to the system.
But we can set a password because we have the sudo privilege to the user we created in the step of installing
Log in as the user you created at the time of installing
switch to root user with sudo
set password for root and exit
login as root
#This is the user you created at time ofinstaling whoami #switch to root user with sudo sudo su #set strong password for root passwd # exit from roo exit # test weather we can login with new root password su - root