Solved Win8 in Bhyve from RAW image

Hi,

I'm using vm-bhyve script to run Win8 on bhyve. I don't have ISO to do a normal installation, so I downloaded VirtualBox VM from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ . I have then unzipped the file, extracted VMDK from OVA (it's a normal ZIP file) and then converted VMDK to RAW using qemu-img convert -f vmdk -O raw input.vmdk disk1.img.

The problem I have is how to use this image correctly? I moved the image into the VM's directory and then updated configuration using # vm configure <vm>. I have changed only following section:

Code:
disk0_type="ahci-hd"
disk0_opts="sectorsize=512"
disk0_name="disk1.img"

When I start VM and connect via VNC (vncviewer :5900), I always end up in UEFI interactive shell. I must be missing something obvious here, can you point me to the right direction please? Thanks!
 
Ok so I do not know if this is your issue BUT I face similar issue with BHYVE and WIN...

It seems you're not vncviewer fast enough to press a key to LOAD from CD/BOOTLOADER so go the LONG way.

My window install was an Win10 (Not too familiar with this VM DL from Microsoft)via ISO, FYI I faced similar issue with PARROT and KALI when installing on bhyve (in those cases was a GRUB problem debug same).

UEFI menu
Shell> exit
Bhyve boot screen
Select Boot Manager
ENTER
UEFI BHYVE SATA DVD ROM BHYVE-C572-7018-C3A1 (MIGHT BE DIFFERENT on yours)
ENTER
Press or Select to boot from CD or DVD
ENTER


Good luck...
 
Ok so I do not know if this is your issue BUT I face similar issue with BHYVE and WIN...

It seems you're not vncviewer fast enough to press a key to LOAD from CD/BOOTLOADER so go the LONG way.

My window install was an Win10 (Not too familiar with this VM DL from Microsoft)via ISO, FYI I faced similar issue with PARROT and KALI when installing on bhyve (in those cases was a GRUB problem debug same).

UEFI menu
Shell> exit
Bhyve boot screen
Select Boot Manager
ENTER
UEFI BHYVE SATA DVD ROM BHYVE-C572-7018-C3A1 (MIGHT BE DIFFERENT on yours)
ENTER
Press or Select to boot from CD or DVD
ENTER


Good luck...
Thanks, I tried what you said, but whenever I select either the disk or the DVD, the screen just flickers and immediatelly returns back. I think there must be something wrong with the configuration. Or perhaps the disk from Microsoft is actually not correctly set up? I wonder where should I ask for technical help. Ideally it should be somebody who is developing Bhyve I guess...
 
If you get pass the UEFI it might be installation media / downloaded config environment.... TEST that download with the OVA or VDMK in VirtualBox or Vmware Vsphere...

Outside of that, TEST install with a source ISO (if you can find one)... Something tells me it is the media or maybe like you mention bhyve config issue with new windows8.

Either way let us know your solution if you find it, I am sure I will begin tackling NEW window8 installation on emulated environment pretty soon (Employees just love that warm feeling Microsoft brings), and I am force to install a bunch of VM just so I can have ZFS snapshot in case they click on some random crap..

Keep us posted... 💪
 
If you get pass the UEFI it might be installation media / downloaded config environment.... TEST that download with the OVA or VDMK in VirtualBox or Vmware Vsphere...

Outside of that, TEST install with a source ISO (if you can find one)... Something tells me it is the media or maybe like you mention bhyve config issue with new windows8.

Either way let us know your solution if you find it, I am sure I will begin tackling NEW window8 installation on emulated environment pretty soon (Employees just love that warm feeling Microsoft brings), and I am force to install a bunch of VM just so I can have ZFS snapshot in case they click on some random crap..

Keep us posted... 💪
I have one small achievement to report:
  • I have downloaded installation Win10 ISO instead of VMDK and it works well. The question is, was it because of Win10 vs Win8, or because I used ISO for installation instead of pre-installed VMDK disk?
  • I will try to download VMDK for Win10 later and see if it works or not. If it does, then it's a difference between Win8 and Win10. If not, then it must be that I convert the image incorrectly.
  • I have been using these images with VMWare before, so I know that it works. But that was on Mac.
  • Going to BIOS and selecting the right disk helped during the installation. Once the system has been installed, it's no longer necessary.
Side note: Because I cannot use network (I have problems with using lagg0 with public switch for some reason), I had to create my own disk using mtools. I hope this might help some another lost soul who can't get their networking on bhyve done, but yet wants to import at least some data into the VM with Windows.
 
So it looks like it could be the qemu-img convert command if that is the case...

More options (I didn't get too far with my testing with an OVA I had in an old Vsphere server wanted to transfer it with all content over to bhyve Freebsd box) I was testing with

qemu-img dd

and

dd = you should be able to convert partitions/ova into an ISO/RAW....
OR
Qemu-convert vdmk -> RAW
dd to RAW - > ISO

If you go this route let me know results....
 
So it looks like it could be the qemu-img convert command if that is the case...

More options (I didn't get too far with my testing with an OVA I had in an old Vsphere server wanted to transfer it with all content over to bhyve Freebsd box) I was testing with

qemu-img dd

and

dd = you should be able to convert partitions/ova into an ISO/RAW....
OR
Qemu-convert vdmk -> RAW
dd to RAW - > ISO

If you go this route let me know results....
I think the conversion is definitely a problem. This is what I use to convert VMDK to RAW:

qemu-img convert -f vmdk -O raw <input.vmdk> <output.img>

But it's not probably the file format that Bhyve expects. Here's output of two files:
  • converted.img -> file created by conversion from VMDK to RAW image
  • disk0.img -> file created by Bhyve
Code:
% doas file converted.img
Password:
widle.img: DOS/MBR boot sector MS-MBR Windows 7 english at offset 0x163 "Invalid partition table" at offset 0x17b "Error loading operating system" at offset 0x19a "Missing operating system", disk signature 0xa04afba1; partition 1 : ID=0x7, active, start-CHS (0x0,32,33), end-CHS (0x3ff,254,63), startsector 2048, 83881984 sectors
% doas file disk0.img
Password:
disk0.img: DOS/MBR boot sector MS-MBR Windows 7 english at offset 0x163 "Invalid partition table" at offset 0x17b "Error loading operating system" at offset 0x19a "Missing operating system"; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x231,254,63), startsector 1, 4294967295 sectors

Am I missing some step? I don't quite understand what you mean by using dd to convert RAW to ISO. Why would I do it? I thought that RAW file is what Bhyve wants. Can you give me the exact format of how to use dd to conver it? I couldn't found anything useful in the man pages. The way how I understand it is that it would basically just copy it from one file to another one with ISO file extension - I guess that's not what you mean?
 
Just a small update so I don't forget. The issue is resolved, at least for me. I have downloaded official ISO, did installation and all works perfectly fine. I'm also impressed by how fast bhyve works. The solution was simply to not bother with these preinstalled images, but just to use normal ISO.

The other problem I had (not functional networking) is resolved now as well. I simply created NAT in pf and instructed bhyve to use it. I have wrote it down to my blog post, although the post doesn't focus specifically on NAT, but rather Docker - https://www.boucek.me/posts/docker_in_freebsd/

With that, I'm happy to mark the case as closed :)
 
Back
Top