VM refuses to boot - how to diagnose and troubleshoot

Discussions related to using VirtualBox on Windows hosts.
Post Reply
JJJones
Posts: 48
Joined: 22. Apr 2022, 02:24
Primary OS: MS Windows other
VBox Version: OSE Debian
Guest OSses: WinXP, Win7

VM refuses to boot - how to diagnose and troubleshoot

Post by JJJones »

Overview
A VM from VHD, that has worked for 10+ years has suddenly stopped booting in VirtualBox.
A couple days ago when I attempted to boot it, the guest CPU went to 100% (and remains there forever) and it freezes on the WinXP boot page. (See more details below.)
I restored a backup of the VHD that worked fine a couple weeks ago and now it fails also, but with different symptoms: after the VirtualBox banner/boot page the screen just stays black with no CPU nor IO registered (as shown from 'Machine > Session Information').

I get that somehow the latest VHD became corrupted or something preventing it from booting properly, but how did a backup VHD that did work correctly 2-3 weeks ago stop working?

Detailed chronology of the situation.
  • 2010 - Convert old WinXP system to VHD and use VirtualBox to create a VM and use. Works wonderfully for years on a DELL Win7 Host with Intel I3.
  • 2022 April
    • Win7 Host motherboard fries. Disk drives are good.
    • Get new Win11 Home machine with Ryzen 5 5600G processor and 2TB SSD system drive.
    • Move WinXP.vhd to new system drive from backup.
    • Install VirtualBox v6.1.32, create VM and WinXP virtual machine boots up and all is fine. Boot and reboot this VM several times without issue.
    • At some point Win11 does an upgrade overnight and reboots the host computer. This shuts down all apps including my running VM.
    • Was dealing with trying to get the old Win7 host to boot into VirtualBox for a few weeks. (See other post in these forums on this topic.)
    • During this 2-3 week period, I did not boot my WinXP VM and VirtualBox upgraded to v6.1.34.
    • 2 days ago I tried to boot the WinXP VM, which I hadn't touched in 2-3 weeks. The guest CPU usage goes to 100% and stays there. The VM never boots and seems to eventually hang on the WinXP startup page; the first thing you would normally see after the VirtualBox banner page. I have let it run for 2 hours and no progress. The guest CPU stays at 100% the entire time.
    • I revert back to VirtualBox v6.1.32; same results.
    • If I double-click on the VHD in Windows File Explorer, I can see the VHD contents and all files. First time however, I got a message that there was an issue and that I should run a scan and repair. Before running the scan and repair, I could definitely see all of my software project files and saw no problems. I let the scan and repair run and finish. It reported no issues and said the drive was good. A dismount and subsequent mount of the VHD in File Explorer opened the contents without any messages. After dismount/eject and again tried to boot the VM. Same problem.
    • I can recover from this. I have backups of all software changes made on this VM. I will just boot from the original WinXP.VHD used above initially and restore software changes to that. As per above, this file originally booted just fine and I interacted with it multiple times in VirtualBox successfully.
    • When I attempt to boot from this same exact file, after the VirtualBox banner page, I get a black screen and nothing ever happens. No messages, no guest cpu usage, nothing.
Arrrggggg!!!! How do I go about troubleshooting this one?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: VM refuses to boot - how to diagnose and troubleshoot

Post by scottgus1 »

JJJones wrote:Win11 does an upgrade overnight
Windows updates can turn on things that enable Hyper-V, which can impede or stop Virtualbox.
JJJones wrote:reboots the host computer. This shuts down all apps including my running VM.
Yep, Windows Updates does that. If you have Pro, you can use Group Policy Editor to get Updates to not reboot the PC or even download/install updates until you're ready. With Home, you have to be more diligent about watching for the updates and shutting down the VMs.
JJJones wrote:This shuts down all apps including my running VM.
...
I got a message that there was an issue and that I should run a scan and repair.
XP used to ask for this too after an unexpected power-off, which is what Windows Updates caused.

***************************

Please right-click the guest in the main Virtualbox window's guest list, choose Show Log.

Search the far left tab's log for this text:

Attempting fall back to NEM

If you find it, Hyper-V is enabled. See HMR3Init: Attempting fall back to NEM (Hyper-V is active).

If you don't find that text, save the far left tab's log, zip the log file, and post the zip file, using the forum's Upload Attachment tab.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: VM refuses to boot - how to diagnose and troubleshoot

Post by fth0 »

JJJones wrote:How do I go about troubleshooting this one?
In comparison to your other topic, this is probably an easy one, well understood, and you're in good hands with scottgus1 here. :)

To summarize the sequence of events:

The Windows update probably activated a Windows feature using Hyper-V. Starting the Windows XP VM with VirtualBox running under Hyper-V, Windows XP marked the virtual hard disk as in use (dirty), and since Windows XP wasn't shut down properly, it couldn't mark the virtual hard disk as clean again. On the next Windows XP startup, this led to the scan and clean recommendation.
JJJones
Posts: 48
Joined: 22. Apr 2022, 02:24
Primary OS: MS Windows other
VBox Version: OSE Debian
Guest OSses: WinXP, Win7

Re: VM refuses to boot - how to diagnose and troubleshoot

Post by JJJones »

So hopeful right now... LOL - Thx scottgus1 and fth0!

So, just searched the VBox.log as per scottgus1 recommendation.
scottgus1 wrote:Please right-click the guest in the main Virtualbox window's guest list, choose Show Log.
Search the far left tab's log for this text: Attempting fall back to NEM
Found "HM: HMR3Init: Attempting fall back to NEM: AMD-V is not available"

I have run out of time for today, so I will review the link in your post later tonight if time allows or first thing tomorrow morning and post an update back here.
VBox.log
VBox.log
NEM.png (42.36 KiB) Viewed 2767 times
JJJones
Posts: 48
Joined: 22. Apr 2022, 02:24
Primary OS: MS Windows other
VBox Version: OSE Debian
Guest OSses: WinXP, Win7

Re: VM refuses to boot - how to diagnose and troubleshoot

Post by JJJones »

Followed instructions per the link you referenced.
bcdedit.png
bcdedit.png (27.64 KiB) Viewed 2750 times
Shutdown and unplugged for 60 seconds (20 seconds recommended).

Upon reboot, same results. The VM just appears to freeze on the black screen after the VirtualBox banner page.

I found a link online about also disabling the Hyper-V Windows Feature. I checked and at this point it was still selected.
Hyper-V-Feature.png
Hyper-V-Feature.png (33.63 KiB) Viewed 2750 times
I unchecked it and rebooted. Same results.

Attached is the VBox.log file you asked for.
Attachments
VBox.zip
(23.81 KiB) Downloaded 2 times
JJJones
Posts: 48
Joined: 22. Apr 2022, 02:24
Primary OS: MS Windows other
VBox Version: OSE Debian
Guest OSses: WinXP, Win7

Re: VM refuses to boot - how to diagnose and troubleshoot

Post by JJJones »

Update: It turns out that this is the proper DISM command for Win11.
dism.png
dism.png (10.99 KiB) Viewed 2748 times
Which, as it turns out, is just what I turned off in the Windows Features dialog in the screenshot of my last post.

None-the-less, I did both the bcdedit and dism commands again... shutting down now and will update when the system comes back up and I test.
JJJones
Posts: 48
Joined: 22. Apr 2022, 02:24
Primary OS: MS Windows other
VBox Version: OSE Debian
Guest OSses: WinXP, Win7

Re: VM refuses to boot - how to diagnose and troubleshoot

Post by JJJones »

Same results unfortunately. Hangs after VirtualBox banner page on a black screen.

Sigh...
JJJones
Posts: 48
Joined: 22. Apr 2022, 02:24
Primary OS: MS Windows other
VBox Version: OSE Debian
Guest OSses: WinXP, Win7

Re: VM refuses to boot - how to diagnose and troubleshoot

Post by JJJones »

Stop the press!!!

Somewhere in here, after the problem initially occurred, I had removed and rebuilt the VMs from the current and backup VHDs specifying only 1 CPU; where it had always run with 2 CPUs. I didn't see how it would matter.

At this point, I thought, well, why not recreate it with 2 CPUs. I did, and IT WORKS!!!

Haven't seen anything about there being a problem with changing the number of CPUs that a VM/VHD uses. But this seems to have solved the problem for now.

I will update if anything else funky occurs.

Thanks for all the help and attention!!!
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: VM refuses to boot - how to diagnose and troubleshoot

Post by BillG »

On later versions of Windows it does not matter, but with XP it does. Multiple CPUs were new (Windows XP Home only supported 1 CPU). Changing to 2 CPUs when you had installed the OS using one (and vice versa) was not a trivial operation. Google hardware abstraction layer (HAL).
Bill
JJJones
Posts: 48
Joined: 22. Apr 2022, 02:24
Primary OS: MS Windows other
VBox Version: OSE Debian
Guest OSses: WinXP, Win7

Re: VM refuses to boot - how to diagnose and troubleshoot

Post by JJJones »

@BillG Thx.

So, it appears that the problem was created by a Windows 11 update and reboot.
Resetting the Hyper-V windows properties failed to fix the problem, until I built the VM with 2 CPUs.

That would seem to be the whole picture and solution to this issue. Post-mortem fyi.
fe3
Posts: 3
Joined: 6. May 2022, 10:24

Re: VM refuses to boot - how to diagnose and troubleshoot

Post by fe3 »

I had a similar problem. My Ubuntu guest did not start on my Windows host. On an identical machine it worked without problems.

The problem was the installed Windows feature: Virtual Machine Platform

After disabling this feature, I was able to start the guest without problems.
Post Reply