Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

This is for discussing general topics about how to use VirtualBox.
ecccc3
Posts: 20
Joined: 1. Aug 2022, 03:02

Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by ecccc3 »

Hi again

Windows 10 and Debian UEFI on my PC's mass memory ( hard disk ) :
booting the PC I can select an OS ( Windows Boot Manager or debian ) with the BIOS menu . Isn't possible with the VirtualBox's virtual BIOS ( the Boot Manager ) ? With the physical hard disk access :

cd C:\Program Files\Oracle\VirtualBox
VBoxManage internalcommands createrawvmdk -filename "C:\Users\0\VirtualBox VMs\0\0.vmdk" -rawdisk \\.\PhysicalDrive0

and creating a new virtual machine with Boot Order: Hard Disk in 1st , SATA Port 0: 0.vmdk ( of course ) then starting this vm I only can boot on Windows 10 , I doesn't find how to boot Debian , with the VirtualBox's virtual BIOS menu , the VirtualBox's UEFI Interactive Shell ?
Last edited by ecccc3 on 14. Aug 2022, 16:11, edited 1 time in total.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by mpack »

Of course it's possible. VirtualBox can do anything a real PC can do, because it is a real PC.

If the VM has access to the entire disk, and if the disk contains a boot manager that offers a boot time selection then that selection will appear in the VM.

Bear in mind however that the VM should not access parts of the disk already in use by the host OS. Luckily you probably are blocked by the host OS from doing that. If it was allowed then it would seriously corrupt the drive.
ecccc3
Posts: 20
Joined: 1. Aug 2022, 03:02

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by ecccc3 »

OK but how ?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by mpack »

How what? I already told you the circumstances needed for it to act the same as the host.
ecccc3
Posts: 20
Joined: 1. Aug 2022, 03:02

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by ecccc3 »

How to select , boot Debian in VirtualBox instead of Windows ?
if the disk contains a boot manager that offers a boot time selection
I don't think so : maybe like all the PCs , boot manager is a part of the BIOS , which are probably in the CMOS , not the disk .
On the disk there's the EFI system partition ( ESP ) with EFI\Microsoft\ etc , EFI\debian\ etc .

In the VirtualBox's Boot Manager there's just " UEFI VBOX HARDDISK VB705a168b-8575d8b9 " , not Windows Boot Manager and debian .
Last edited by ecccc3 on 14. Aug 2022, 11:52, edited 2 times in total.
AndyCot
Posts: 296
Joined: 29. Feb 2020, 03:04

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by AndyCot »

The CMOS standard is 50bytes of NVRAM (MC146818 IC data sheet).

BIOS do not include a boot manager, some bios's allow you to select the partition to boot from (BIOS loads one page from sector X in the partition and starts to execute code from that sector).

Sounds like you need to look up how boot sectors work and how boot managers work as you using "buzz" words you have heard without known what they actually mean or what they are used for in the PC boot scheme.
ecccc3
Posts: 20
Joined: 1. Aug 2022, 03:02

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by ecccc3 »

BIOS loads one page from sector X in the partition and starts to execute code from that sector
Isn't the old , legacy boot scheme ? With MBR ( master boot record ) then PBR ( partition boot record ) ? Now ( and that I use ) it's UEFI and ESP .
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by fth0 »

I'll try and give you some answers to your questions from your different threads:

On your host, you have a UEFI BIOS and a physical hard disk with (at least) three partitions: ESP, Windows, Debian. While Windows is running, it will prevent VirtualBox from accessing the ESP (probably) and the Windows partition in raw disk mode. The background reason is that in a modern OS, the current state of a hard disk consists of the contents of the hard disk itself and the contents of the disk caches inside the OS. If the OS would allow another OS to access the hard disk at the same time, that would lead to disk corruption eventually.

In consequence, you cannot add the complete physical hard disk or even the ESP to a VirtualBox VM running under the Windows OS. It should be possible to add the Debian partition as a second disk drive (in raw mode) to a VM with a first virtual disk drive containing an ESP, though. But that's a rather complicated setup and perhaps not worth the hassle.

OS installations in a PC/VM usually know that they were installed after booting from a legacy BIOS with MBR or a UEFI BIOS with GPT. In consequence, you must use the corresponding virtual BIOS type in a VirtualBox VM when using raw disk mode. Note that the VirtualBox (U)EFI BIOS is independent of the hosts UEFI BIOS and has its own settings.
ecccc3
Posts: 20
Joined: 1. Aug 2022, 03:02

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by ecccc3 »

Finally a good reply fth0 thanks ( are you developer , not just a moderator ? ) for viewtopic.php?f=6&t=106689 .

But using https://docs.microsoft.com/en-us/troubl ... ing-on-off still " With a Debian live ( e.g. debian-live-11.4.0-amd64-xfce+nonfree.iso ) on VirtualBox I can only read the original ESP , C: , D: but I didn't succeed to mount the ext2 " can't read superblock on /dev/sda3 " " ( for the ESP I used mount /dev/sda1 /mnt ) .

But for this topic still the question : How to select , boot Debian in VirtualBox instead of Windows ?
Should I write a new ticket ?
Last edited by ecccc3 on 15. Aug 2022, 17:34, edited 1 time in total.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by fth0 »

I'm not a moderator, and also not a VirtualBox developer, but I've accumulated some knowledge in the past decades. ;)

The "can't read superblock" usually means that the first sector of the partition (VBR for Windows, superblock for Linux) either couldn't be read or had not the expected contents.
ecccc3 wrote:How to select , boot Debian in VirtualBox instead of Windows ?
I already sketched a possible method in my previous post (the "two disks" approach). Iff Debian is installed in its partition in a way that it could be booted from a UEFI BIOS and from a legacy BIOS, you could alternatively try the method described in 9.7.1.2. Access to Individual Physical Hard Disk Partitions, providing your own MBR.

But it's possible that I didn't understand your question correctly. Please elaborate on your question in that case.
ecccc3
Posts: 20
Joined: 1. Aug 2022, 03:02

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by ecccc3 »

I don't understand you don't understand .

Read my 1st post and
In the VirtualBox's Boot Manager there's just " UEFI VBOX HARDDISK VB705a168b-8575d8b9 " , not Windows Boot Manager and debian .
Attachments
.jpg
.jpg (122.12 KiB) Viewed 5381 times
Screenshot 2022-08-14 140610.png
Screenshot 2022-08-14 140610.png (96.48 KiB) Viewed 5537 times
Last edited by ecccc3 on 15. Aug 2022, 12:47, edited 2 times in total.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by fth0 »

In the VirtualBox (U)EFI BIOS Boot Manager, you can only select the device (0.vmdk in your case). Try to select the EFI loader for Debian in Boot Maintenance Manager > Boot From File ...

In addition to that, the green turtle in the status bar of the VM's window indicates that your host (and VirtualBox) is running under Hyper-V, and the choice of animal is deliberate. ;)
ecccc3
Posts: 20
Joined: 1. Aug 2022, 03:02

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by ecccc3 »

your host (and VirtualBox) is running under Hyper-V
I tried ( with https://www.itechtics.com/enable-hyper- ... s-10-home/ , I've Windows 10 Home , I don't wanna buy Pro ... ) then uninstalled Hyper-V with Turn Windows features on or off ? It's not truly uninstalled ? How to ?

I'm just tired of dat heavy RAM closed-source OS Window$ ... but I've some video games ( GTA V Online , Rocket League ... ) on Losedow$ not Linux :( .

Which .efi should I select ?
Attachments
VirtualBox_._15_08_2022_07_15_44.png
VirtualBox_._15_08_2022_07_15_44.png (5.81 KiB) Viewed 5410 times
Last edited by scottgus1 on 15. Aug 2022, 14:09, edited 2 times in total.
Reason: removed expletive
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by scottgus1 »

The abbreviated expletive you used has been removed. Please keep the forum clean.

Regarding Hyper-V see HMR3Init: Attempting fall back to NEM (Hyper-V is active). Note especially the info about Windows Home and the Windows Features box.

There are times where VMs can run under Hyper-V. However, where you're trying to boot a physical partition along with a virtual disk boot loader, it might be necessary to remove Hyper-V from the mix, just to be sure.

You have 6 processors in the VM. 2 is the sweet spot for a VM, until you install 3rd-party multi-processor-aware apps in the VM's OS. 2 also seems to work well if Hyper-V is enabled on the host. Roll processors back to 2 for now. You can put them back up to a higher number later after you have a working VM.

The name of your VM is a single period. That might cause trouble somewhere. Be prepared to start over with an alphanumeric name.

Assuming you're in the correct place for the EFI boot loader selection (I personally don't know) there are only 4 different selections. You can try all of them to see what happens. FWIW, as a guess, I'd try "grubx64.efi" first, since Linux boot loaders are called "grub".
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Cannot select an OS with the virtual BIOS if multiple OSs on single memory ?

Post by fth0 »

Use shimx64.efi to directly boot a Linux kernel without using GRUB or the MokManager. If it doesn't work, try the FallBack.
Post Reply