# FreeBSD 13 UFS/MBR Install Fails on VMDK, but works fine on VDI



## Allan (May 16, 2021)

I don't know if anyone else had come across this as of yet, but I set out today to see if I could create an OCI compliant image for Oracle Cloud of a minimal FreeBSD 13-RELEASE install.  Part of the requirements for importing a custom image is that it _must_ be a VMDK disk and partitioned with MBR (I don't have this issue with Azure; it seems like Oracle is always playing catchup, but that's another debate for another time on a different forum )

Anyway, the installer will crash (hung system) if I try to use "Auto UFS" on my blank 12GB VMDK disk.  I tried partitioning it manually (via bsdinstall) but I get a very nondescript popup that says "invalid option."  So, I opted to drop to the shell and partition it out by hand using gpart. 

I can partition the drive successfully (`gpart create -s MBR ada0`).  However, the moment I attempt to add the first (boot) partition ( `gpart add -t freebsd-boot -s 512 -l boot ada0`) or any other partition for that matter, gpart errors out with "Invalid option."

However, if I do this on a VDI, it works fine. 

For my workaround, I did the complete install on a VDI and then cloned the medium to a VMDK which then booted with no problem. Is this a known issue that I missed somewhere?  Are there specific settings for a VMDK within VBox that need to be enabled to allow FreeBSD (gpart) to play nicely?


----------



## SirDice (May 17, 2021)

The freebsd-boot partition is for GPT systems, MBR doesn't use it.



Allan said:


> or any other partition for that matter, gpart errors out with "Invalid option."


With MBR you need to create partitions inside a slice. See the examples in gpart(8).


----------



## Allan (May 17, 2021)

SirDice said:


> The freebsd-boot partition is for GPT systems, MBR doesn't use it.
> 
> 
> With MBR you need to create partitions inside a slice. See the examples in gpart(8).



Thanks for the response.  

I hear what you're saying, and I'm going to explore further today, but please keep in mind that it's also failing when I attempt to use the "Auto UFS" option which is the installer doing all the partitioning.  So, to summarize, if I allow the installer to auto partition my blank VDI drive as MBR, it works but if it's a VMDK (also blank), it fails.

For the manual install, I was following the instructions found here:  https://forums.freebsd.org/threads/procedure-for-manual-installation.64370/


----------



## SirDice (May 17, 2021)

Did a quick test install on Virtualbox 6.1 (Windows host) and FreeBSD 13.0 installed just fine with Auto (UFS) and MBR on a VMDK disk.


----------



## Emrion (May 17, 2021)

Same here. Tested dynamically allocated & fixed size for VMDK. They work both.
It's "Auto ZFS" (if you choose MBR) that doesn't work, no matter what the disk is.


----------



## Allan (May 17, 2021)

I should have mentioned I'm on a macOS host.  Sorry.

Problem is, my VMs are on my iMac, but depending on where I am, I could be using a Mac, a Surface (Win10), or even FreeBSD running on an old (white) MacBook or Dell Laptop!  I'm so platform agnostic (the exception being Linux - I avoid that hot mess!) I forget what I'm using sometimes.  Unless I'm sitting directly on my Mac machine, everything is VBoxManage via SSH and RDP or serial port redirection!


----------

