force boot from multiple bootable virtual drives
force boot from multiple bootable virtual drives
Running Alpine Linux as a guest with two bootable virtual drives on the SATA virtual controller. I need to force the system to boot from a particular virtual drive but nothing seems to work. The SATA port number doesn't change which drive boots... sometimes it will boot from the drive on port 0 and sometimes it will boot from port 1. I can't seem to find a way to guarantee which drive it boots from. Under Linux, I have one drive configured as sda and the other as sdb so I can see which one has been used to boot.
-
- Volunteer
- Posts: 5678
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: force boot from multiple bootable virtual drives
Please reproduce the boot from SATA port 1 (which perhaps is unexpected behavior), provide a (zipped) VBox.log file from that run, and I'll tell you how to work around the issue.
Just kidding, I'll tell you anyway (but please provide the log file nonetheless):
VirtualBox only boots from the first 4 IDE, SATA and SCSI devices. Add a few additional virtual DVD drives to the SATA controller, so that you have at least 5 devices, and move one of the virtual hard disks to the highest SATA port of the 5 devices.
Just kidding, I'll tell you anyway (but please provide the log file nonetheless):
VirtualBox only boots from the first 4 IDE, SATA and SCSI devices. Add a few additional virtual DVD drives to the SATA controller, so that you have at least 5 devices, and move one of the virtual hard disks to the highest SATA port of the 5 devices.
Re: force boot from multiple bootable virtual drives
Thanks for the reply. Unfortunately that appears to only work if there is only one bootable virtual hard drive. It is true that If you have just one virtual drive on SATA 4 (with drives on the lower SATA ports) it won't boot but I put the second drive at SATA 6 with the drive I want to boot from on SATA 0 (with DVD drives on 1-5) and it still boots from the drive on SATA 6. I remote the virtual hard drive from SATA 6 and the one attached to SATA 0 boots but as soon as I put the other drive back (SATA 6) that's the one that boots.
-
- Volunteer
- Posts: 5678
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: force boot from multiple bootable virtual drives
I successfully tested my suggestion myself before writing about it. Please provide a (zipped) VBox.log file from a VM run with this special configuration. Shut down the VM before copying the log file, so that the statistics are complete.
Re: force boot from multiple bootable virtual drives
I have uploaded the log file.
- Attachments
-
- VBox-post.log
- (89.42 KiB) Downloaded 7 times
-
- Volunteer
- Posts: 5678
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: force boot from multiple bootable virtual drives
As I wrote, I'm also interested in the statistics, and if you zip the log file, it won't be too large to attach it to the post. The statistics show how many sectors are read/written from/to each virtual hard disk ...
As an educated guess, which boot loader or boot manager do you use (GRUB?), and how does it search for the bootable partitions (by UUIDs)? If alpine_backup.vdi began as a copy of alpine.vdi, you may have shot yourself in the foot.
As an educated guess, which boot loader or boot manager do you use (GRUB?), and how does it search for the bootable partitions (by UUIDs)? If alpine_backup.vdi began as a copy of alpine.vdi, you may have shot yourself in the foot.
Re: force boot from multiple bootable virtual drives
Sorry about that, I have now uploaded the complete file zipped.
Alpine uses Syslinux for the bootloader. When I was researching this from the linux side, everything seemed to point to BIOS settings so that is why I turned to posting here. I was hoping to find a way to have virtualbox force the boot order.
You are correct that alpine_backup.vdi began as a copy of alpine.vdi but that UUID has been changed, although I need to go back and check that.
Alpine uses Syslinux for the bootloader. When I was researching this from the linux side, everything seemed to point to BIOS settings so that is why I turned to posting here. I was hoping to find a way to have virtualbox force the boot order.
You are correct that alpine_backup.vdi began as a copy of alpine.vdi but that UUID has been changed, although I need to go back and check that.
- Attachments
-
- VBox-post.zip
- (29.41 KiB) Downloaded 5 times
-
- Volunteer
- Posts: 5678
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: force boot from multiple bootable virtual drives
Just in case, I'm talking about the Linux-specific UUIDs, not the VirtualBox-specific UUIDs.
-
- Volunteer
- Posts: 5678
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: force boot from multiple bootable virtual drives
Well, here's something for you to figure out:
A professional tip: If you start the VM from within a terminal using VirtualBoxVM --startvm "alpine" --debug, you can unpause and pause the VM and watch the statistics live.VBox-post 2.log wrote:00:01:41.462541 /Public/Storage/AHCI0/Port0/BytesRead 27244032 bytes 00:01:41.462576 /Public/Storage/AHCI0/Port5/BytesRead 107935744 bytes 00:01:41.462578 /Public/Storage/AHCI0/Port5/BytesWritten 2418688 bytes
Re: force boot from multiple bootable virtual drives
If I shutdown and restart the VM a few times eventually I get the following and the VM boots from SATA 0
It appears to be random with no set number of restarts and if I restart the VM after it boots correctly, it changes back to SATA 5 and so on.
Code: Select all
00:00:57.295651 /Public/Storage/AHCI0/Port0/BytesRead 121007616 bytes
00:00:57.295655 /Public/Storage/AHCI0/Port0/BytesWritten 2189312 bytes
00:00:57.295720 /Public/Storage/AHCI0/Port5/BytesRead 13651968 bytes
-
- Volunteer
- Posts: 5678
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: force boot from multiple bootable virtual drives
Good candidates for a random selection are all bus or device enumerations, be it in VirtualBox or in Syslinux. I'd try to stop inside the Syslinux boot menu and investigate from which device Syslinux has been loaded, either from within Syslinux or with the VirtualBox debug mode. Depending on the results, you could then investigate what happened before or after the Syslinux boot menu.
BTW, you don't need any debugging experience for the VirtualBox debug mode. After executing the command that I provided, you simply unfold the statistics in the right window, and (un-)pause the VM in the VM window's menu, just like when running without the debug mode.
BTW, you don't need any debugging experience for the VirtualBox debug mode. After executing the command that I provided, you simply unfold the statistics in the right window, and (un-)pause the VM in the VM window's menu, just like when running without the debug mode.
Re: force boot from multiple bootable virtual drives
Thanks for your help. I will see what I can come up with using the debug mode.
Re: force boot from multiple bootable virtual drives
Just looking at this topic in connection with another issue, and finding it prompts a question. Quoting from your second post (19. Apr 2022, 22:36)...
Reading this sentence it seems that with this arrangement, namely virtual hard drives at both SATA 0 and SATA 6, effectively "bookending" or "wrapping" the other attached devices, the randomness you described in your first post is gone; and that the boot from SATA 6 is reliable, with things set up this way. Am I reading this correctly? If so it's definitely something useful to know, even if for now unexplained. Or was it merely a passing phase?Montagar wrote:...I remove the virtual hard drive from SATA 6 and the one attached to SATA 0 boots but as soon as I put the other drive back (SATA 6) that's the one that boots.
Re: force boot from multiple bootable virtual drives
When I add the second drive it usually boots from that one. However, that is not always the case and it will become random on subsequent reboots with both drives attached anyway. So unfortunately there is no guarantee as to which drive will boot when they are both attached.milverton wrote:Just looking at this topic in connection with another issue, and finding it prompts a question. Quoting from your second post (19. Apr 2022, 22:36)...Reading this sentence it seems that with this arrangement, namely virtual hard drives at both SATA 0 and SATA 6, effectively "bookending" or "wrapping" the other attached devices, the randomness you described in your first post is gone; and that the boot from SATA 6 is reliable, with things set up this way. Am I reading this correctly? If so it's definitely something useful to know, even if for now unexplained. Or was it merely a passing phase?Montagar wrote:...I remove the virtual hard drive from SATA 6 and the one attached to SATA 0 boots but as soon as I put the other drive back (SATA 6) that's the one that boots.
-
- Volunteer
- Posts: 5678
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: force boot from multiple bootable virtual drives
Were you able to discover if the randomization takes place in VirtualBox or in Syslinux?