Powered By Blogger

2016/04/14

OVM 3 X86 PVM / Recover Root password (How to Get in PVM Single User Mode)

Just a quick and short post about recovering root password of an Oracle VM for X86 Paravirtualized Virtual Machine (PVM). The process is quite straight and consists of:

  1. locate the VM ID, Repository name and Physical Server which hosts the VM
  2. manually boot the VMs
  3. From Pygrub proceeds as we'll do on a Physical system (boot in single User Mode -either by appending S to the kernel boot parameters or using rd.break on Systemd-). 
Below is an illustration of these three  little steps for a RHEL6 PVM. 
The Virtual Machine name on which I'm willing to recover the password is stiv-vm1   

1.  Get that Paravirtualized VM ID, Repository name and Physical Server Name(knowing that the VM Name is stiv-vm1):

These three information (PVM ID, Repostory Name and Physical Server Name ) are all that we need to locate the configuration file of the PVM (vm.cfg). To get these information, we need to get connected to OVM Command Line Interface  which is by default reachable on ssh/port 10000. From there, we can get the list of running VMs, show VM details, and retrieve the VM ID, Physical Server's name and repository name 



2. Get On the Physical node, and change directory to get to where this VM configuration is located, the start that VM using xm command.

This is as simple as : cd /OVS/Repositories/<repo_id>/VirtualMachines/<vm_id>
For stiv-vm1 that would be,



On the PyGRUB menu edit the boot entry (e) and add "S" as you would do on classic GRUB then boot (b) and recover the root password as with any physical System.

3. To have OVM Manager reflecting the new state of the VM (from stopped to started),  Restart OVMM Service on the Manager and check the VM Console.

1 comment:

  1. Already thought I've lost the access to my VM, thanks!

    ReplyDelete