VirtualBox

Opened 14 years ago

Last modified 6 years ago

#6979 new defect

Hard disk boot order

Reported by: Sasquatch Owned by:
Component: virtual disk Version: VirtualBox 3.2.4
Keywords: boot order Cc:
Guest type: other Host type: other

Description

When you have several hard drives set in your VM and the actual boot disk is SATA or on any other controller than IDE, while you have an IDE hard drive attached, it will fail to boot. There is no way to set the controller priority in the VM settings for booting the VM. The first detected hard drive is tried, but never another if that one fails.

Here is one of the examples, though the issue describes something else too: http://forums.virtualbox.org/viewtopic.php?f=6&t=31956 The first reply (second post) is the vital one.

It is reported for version 3.2.4, but I think this problem exists in all versions where more controllers are available. It doesn't matter which host or Guest you have. It also appears that the OS you want to boot using the boot menu (F12) may fail.

I have attached two log files, it's the same VM, one where I let it boot without intervention and it just stays on a black screen with a blinking _ and 100% CPU on one core. It tries to boot from a data VDI, it doesn't contain an OS. The second log is where I selected the proper device (AHCI SATA drive) and got the error "A Boot Error Occurred".

Attachments (2)

VBox_failed_boot_non-boot_IDE.log (66.9 KB ) - added by Sasquatch 14 years ago.
Let it continue without intervention.
VBox_failed_boot_device_chosen.log (71.8 KB ) - added by Sasquatch 14 years ago.
Selected boot device, failed to boot error appears.

Download all attachments as: .zip

Change History (10)

by Sasquatch, 14 years ago

Let it continue without intervention.

by Sasquatch, 14 years ago

Selected boot device, failed to boot error appears.

comment:1 by Scott Armitage, 14 years ago

If this functionality were to be added, I think it would be worthwhile to actually set the specific boot device (i.e. controller and port), not just the controller. Most BIOSs allow you to specify e.g. "1st HDD", "4th HDD", etc., so this should not be outside the scope of the virtual machine.

This would probably be best stored in the machine's XML definition, with an option in the settings GUI for selecting the specific boot device.

comment:2 by Daevid Vincent, 14 years ago

I have to agree that the lack of a "boot" flag in the XML is causing me a lot of grief right now.

I have a .vdi disk that just went bad for some unknown reason. It kernel panics but there IS data on the drive. Luckily I had just exported to .ovf two weeks ago, so I had a .vmdk image handy. I have changed the XML to load the .vmdk and all is fine. NOW I added the .vdi but every time I try and boot, VB ALWAYS tries to boot from the corrupt disk?!?! WTF. I've used F12 and picked "primary" (as it should be) and also "slave" and in BOTH cases, VB always boots the broken kernel .vdi version.

So there is data on the .vdi that I want to get off of it, I figured I'd just boot the .vmdk, mount the .vdi as a second drive and start copying/comparring, but I can't even get that far now. :\

I tried changing the order of the <StorageController> block too just in case, and that had no bearing either. So what the hell? What determines which drive will be booted first??

comment:3 by Daevid Vincent, 14 years ago

Okay, I'll recind part of my post. What was REALLY happening for me was that since both the .vdi and the .vmdk were essentially clones of each other, when I was choosing PRIMARY, then GRUB was launching (since both drives had that too) and the root=UUID=9872304871203471023847blahblah was the same UUID and it was getting confused.

Solved by escaping into the grub menu and choosing root=/dev/sda1 which picked the proper partition and drive.

Then I could boot into the working drive and mount /dev/vdi and start copying files to my good drive.

:)

However, I *STILL* think there should be a way to specify the boot drive without having to use F12

comment:4 by Chris Wolf, 14 years ago

You can reconfigure grub to not search for the root device via UUID, but rather by device name, as you suggest, via the grub menu. You can also make this change permanent with the following procedure:

http://communities.vmware.com/message/1583812#1583812

Note the caveats about device name assignment.

in reply to:  4 comment:5 by Ryan, 13 years ago

Replying to chriswolf:

You can reconfigure grub to not search for the root device via UUID, but rather by device name, as you suggest, via the grub menu. You can also make this change permanent with the following procedure:

http://communities.vmware.com/message/1583812#1583812

Note the caveats about device name assignment.

I believe that the original problem was about VirtualBox, which in these cases would not even find the MBR on the SATA disks to load Grub though.

comment:6 by yarda, 9 years ago

I have just hit it too - two empty unbootable IDE disks and one bootable SATA disk. It tried the IDE disk, failed to find MBR and didn't load the grub from the SATA disk. I think it should try all disks or the 'bootable' or maybe 'bootprio' XML tags would be even better.

comment:7 by Sk8nfool, 7 years ago

I am running into this problem also. I have several disks defined two of which are bootable. One is connected to a SATA controller on port 0 and the other is connected to a SCSI controller port 0. The option to select boot order only lets me select "Hard Disk" and not controller/port. This problem has existed for 7 YEARS. Changing the configuration is most inconvenient because the OS's make their own decisions on where hard disks are mounted. Fixing this each time the OS is booted is unreasonable.

comment:8 by stephane_gourichon, 6 years ago

Summary: +1 please provide BIOS settings for boot disk order.

I also have this problem and the solution would be that VirtualBox BIOS accepts, like other BIOSes, to customize boot order.

What's the situation needing this, you mask ask?

  • I am currently working on legacy systems which are intended to be attached as first IDE master.
  • There are benefits in working on virtualized versions of those systems, so I do.
  • In those virtual machines I also attached another system, and boot from one or the other depending on needs. Things are simpler if the old system remains first IDE master.
  • And I need the thing to be able to reboot unattended to the *new* system.

*With a regular BIOS, just say e.g. boot from SATA first.* VirtualBox BIOS does not allow that, as far as I know.

Currently I use kludgy workarounds. It really feels like a limitation of VirtualBox BIOS, doesn't it?

Conclusion: please provide BIOS settings for boot disk order in VirtualBox.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use