vbox Any guest OS can't boot if emulate it with VirtualBOX

ziomario

Well-Known Member

Reaction score: 36
Messages: 472

Hello again to everyone.

I've installed VirtualBOX and I would like to boot NetBSD 9.2 in raw mode. Let's say that the NetBSD partition is located on /dev/ada1p2,I created a pointer to this partition with the following command :

Code:
VBoxManage internalcommands createrawvmdk -filename /root/"VirtualBox VMs"/NetBSD92/netbsd92.vmdk -rawdisk /dev/ada1p2

then I have attached the VMDK file to my VM. I've opened the VirtualBox GUI,clicked Settings, clicked Storage and under the Controller PIIX4 I have clicked on the Add Hard Disk button, selected Choose existing drive, and then selected the VMDK file I just created. The problem arises when it should start the boot sequence,because it is freezed on the black screen and nothing happens. I have also tried with different Controllers,such as AHCI and virtio-scsi.
 
OP
ziomario

ziomario

Well-Known Member

Reaction score: 36
Messages: 472

given these disk partitions :



Code:
=>                       2048  976771087  ada1  GPT  (466G)

/dev/ada1p1     2048     262144     1  efi  (128M)

/dev/ada1p2     264192  909692909     2  netbsd-ffs  (434G)

909957101        19        - free -  (9.5K)

/dev/ada1p3     909957120   66816015     3  netbsd-swap  (32G)


I tried several combinations and none of them worked. I tried with uefi enabled and with IDE and AHCI controllers and also pointing ada1 ; ada1p1 and ada1p2. never worked.
 
OP
ziomario

ziomario

Well-Known Member

Reaction score: 36
Messages: 472

I've investigated deeply the working of virtualbox on my freebsd installation. I've created a vm using only default values with Windows 10 dvd iso file ,to check if it was able to boot and not,it is not able. When I try to boot Windows from the iso I see only a black screen as before. You can see what are the default values that I'm talking about on the picture attached below. This time I haven't attached any hard disk,but it freezes,at the same way. Can u suggest to me if there are some wrong value that I should remove ? or add ? 10x
 

Attachments

  • Screenshot_20211013_124750.png
    Screenshot_20211013_124750.png
    175.1 KB · Views: 10

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,331
Messages: 38,847

The problem arises when it should start the boot sequence,because it is freezed on the black screen and nothing happens.
You typically create a VMDK from an entire disk, not from a partition of a disk. The whole disk has a thing called a boot sector (track 0; block 0). It's used by a computer to actually boot the system. The VMDK you created only has the information from the partition in it, which lacks a boot sector. It also lacks a partition table, which is also stored in the first few sectors of a disk (and with GPT a copy of that table is stored in the last couple of sectors of a disk). The partition table isn't stored inside the partition. So yeah, I'm not surprised it doesn't boot.

 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,331
Messages: 38,847

I tried several combinations and none of them worked. I tried with uefi enabled and with IDE and AHCI controllers and also pointing ada1 ; ada1p1 and ada1p2. never worked.
It probably isn't going to matter if you used IDE or AHCI. But I'm not sure if the VirtualBox EFI boot is compatible with NetBSD. FreeBSD has had (maybe still does?) some issues with VirtualBox's UEFI implementation too. In any case, the only proper device to passthrough would be ada1, as you need to pass the whole disk (due to boot sectors, partition tables, etc. I mentioned before).
 

astyle

Daemon

Reaction score: 481
Messages: 1,110

Ah, this is a very familiar problem to me... I was able to solve it by paying attention when creating the install ISO - it really needs to be set as bootable by the tool you use to create the ISO.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,331
Messages: 38,847

Example creating VirtualBox vmdk from NetBSD partitions:
Yes, but that seems to create a virtual disk with only the partitions you selected. It's still a "complete" disk image, boot sectors, partition tables and all. That's quite different from creating an image of a partition alone. You can't just take an image of only the partition and expect the system to be able to boot from it.
 

bakul

Active Member

Reaction score: 57
Messages: 119

I don't know if you can use gconcat to create a virtual disk with a partition from a real disk.... You can experiment by creating some memory devices and trying gconcat on that!
 
OP
ziomario

ziomario

Well-Known Member

Reaction score: 36
Messages: 472

Maybe I didn't explain well the last try that I did. I didn't attach any hard disk. I've attached only the iso image file of windows 10 and it didn't boot. I've even changed the title of this thread.
 

astyle

Daemon

Reaction score: 481
Messages: 1,110

Maybe I didn't explain well the last try that I did. I didn't attach any hard disk. I've attached only the iso image file of windows 10 and it didn't boot. I've even changed the title of this thread.
Ahh... with Virtualbox, you kind of have to give it an empty disk with enough space to hold your installation. Just attaching an install iso won't work. You also need to give it enough RAM and CPU cores. Attaching an install ISO is the virtual equivalent of stuffing an install DVD into a physical computer.

Edit: From the screenshot of your VBox settings, I can see a 20GB disk. 20 GB is not enough for Win10. I'd recommend 32 GB on a single disk, rather than a primary and secondary. Let Windows installer decide what to do within the 32 GB of space you gave it.
 

grahamperrin

Daemon

Reaction score: 687
Messages: 2,195

… Windows from the iso … if there are some wrong value …

I'm surprised by the combination of VBoxSVGA and 3D acceleration, only because for a FreeBSD guest, enabling 3D acceleration causes loss of the preference for VBoxSVGA.

Assuming that Microsoft's .iso does not boot with Oracle's guest additions active: try disabling 3D acceleration, and switch to VMSVGA.

Also/alternatively, try disabling UEFI in the guest.
 
Top