We moved this page to our Documentation Portal. You can find the latest updates here. |
Issue
I need to get into Windows recovery or safe mode to run startup repair/chkdsk or similar.
Environment
OnApp all versions
Windows VMs
Resolution
Getting a Windows VM into Windows Recovery can be a little bit tricky at times, but there are some tricks to make it easier. These tricks are different for KVM vs XEN hypervisors.
Steps for KVM HV, repeat these as long as it can be hard to get in:
1. Open up VNC console of the VM and keep it open.
2. Turn off the VM and get the VM's identifier (usually found in the url: "yyy.com/virtual_machines/xxxxx").
3. SSH into the HV, where the VM is located.
4. Turn on the VM.
5. Be sure the VNC console is connected to the VM.
6. Once the VM is online, run a command "virsh reboot <VM_ID>". This will simulate the reset button, but it shouldn't turn off the VNC console.
7. Press the F8 rapidly in the VNC console until the boot menu, similar to the one attached, shows up. From there choose "repair your computer" for recovery and "safe mode" for safe mode.
XEN takes a little more effort, because the reset command disconnects the VNC console, meaning you have to refresh the VNC console with f5 key again and again until you get in at the right time.
Steps for XEN, repeat these as long as it can be hard to get in:
1. Open up the VNC console of the VM and keep it open.
2. Turn off the VM and get VM's identifier (usually found in the url: "yyy.com/virtual_machines/xxxxx").
3. SSH into the HV, where the VM is located.
4. Turn on the VM.
5. Be sure the VNC console is connected to the VM.
6. Once the VM is online, run a command "xm reset <VM_ID>". This will hard shutdown the VM and restart it. This disconnects the VNC console from the VM, so you will need to refresh the VNC console (f5) until it lets you in. Sometimes it won't let you in on time so you will have to restart.
7. Once inside, press the F8 rapidly in the VNC console until boot menu, similar to the one attached, shows up. From there choose "repair your computer" for recovery and "safe mode" for safe mode.
Note that you can also use xm pause/unpause as well as virsh suspend/resume to pause the VM while you start up the VNC console.