可以通过以下办法
1、
开启虚拟机
2、
打开终端开启root账户 :sudo passwd -u root 输入当前用户的密码
3、
为root账户设置密码:sudo passwd root 设置root密码,输入两次
4、
测试root账户: su 输入root密码,进入root终端