# Can Bhyve run a DOS VM



## Phishfry (Jan 27, 2019)

I need a DOS shell from time to time for firmware flashing tools.
Is it possible to create a FreeDOS VM on Bhyve?


----------



## aragats (Jan 27, 2019)

Since bhyve(8) supports only UEFI, it's not possible.
For many purposes emulators/dosbox may be useful.


----------



## Phishfry (Jan 27, 2019)

What about under sysutils/grub2-bhyve ? Would that do it?
http://hype-free.blogspot.com/2008/12/booting-freedos-with-grub.html


----------



## Ordoban (Jan 27, 2019)

I think both options bhyve or dosbox would not work.
DOS and DOS-programs need BIOS functions to run. So even if you get DOS booted in bhyve with grub - it would not run.
Dosbox emulates every pice of hardware with raw CPU power. For firmware flashing tools you need access to the real hardware, but dosbox does not support passthrough.


----------



## rootbert (Jan 27, 2019)

try to boot it via pxe?


----------



## SirDice (Jan 29, 2019)

There's support for CSM UEFI boot. Never tried it but you might be able to CSM boot (Free)DOS. But getting it to boot is one thing. The old MS-DOS used BIOS calls for everything and those likely don't work any more on UEFI. I assume the same holds true for FreeDOS.



```
root@hosaka:~ # pkg which /usr/local/share/uefi-firmware/BHYVE_UEFI_CSM.fd
/usr/local/share/uefi-firmware/BHYVE_UEFI_CSM.fd was installed by package uefi-edk2-bhyve-csm-0.2,1
```


----------



## _martin (Jan 30, 2019)

On FreeBSD the other option would be emulators/virtualbox-ose. It should allow pass-through device.
Even emulators/qemu might be worth checking out. I use it daily, DOS runs there just fine (and with qemu's debugging support it's actually nice way to debug stuff).


----------

