Bhyve now supports Windows 2012 (Say goodbye to VirtualBox?)

Hey guys, has anyone here actually had success on booting Windows in bhyve(8)?

I updated the system and then
followed the instructions on http://docs.freebsd.org/cgi/getmsg.cgi?fetch=0+0+current/freebsd-virtualization

Prepared the ISO, no problems there but then, when booting the VM I get nothing.

Code:
bhyve \
>       -c 2 \
>       -s 0,hostbridge \
>       -s 3,ahci-hd,win.img \
>       -s 4,ahci-cd,win_repack.iso \
>       -s 10,virtio-net,tap0 \
>       -s 31,lpc \
>       -l com1,/dev/nmdm0A \
>       -l com2,/dev/nmdm1A \
>       -l bootrom,BHYVE_UEFI_20151002.fd \
>       -m 2G -H -w \
>       windows

Afterwards I try to connect to serial console using:
Code:
cu -l /dev/nmdm1A -s 9600

It says: Connected

And then that's it.
Any tips would be greatly appreciated
 
I've tried 2012r2 in the latest version of vm-bhyve.
Anyone is welcome to test it out themselves or even try a different windows version. (Apparently pretty much everything Vista and later has been run by bhyve devs)
There's some instructions on the github page.

Biggest issue is of course needing to run CURRENT and create your own ISO. After that it runs like any other supported guest:
Code:
# vm create -s 30G -t windows winguest
# vm install winguest win_repack.iso
(wait 20-25 minutes while the guest installs and reboots twice - reboots visible in the guest log file /path/to/vm/dir/winguest/vm-bhyve.log)
# vm console winguest
(then type 'i' to get the IP address assigned by DHCP)
 
I'd like to report that Windows 2012 in bhyve(8) works fine, and I was able to pass through USB3 controller to it. My Thinkpad T430 has two USB controllers, so I kept one with FreeBSD, and use another with Windows.
That's definitely a great thing which makes me getting rid of VirtualBox.
 
Last edited:
I'd like to report that Windows 2012 in bhyve(8) works fine, and I was able to pass through USB3 controller to it. My Thinkpad T430 has two USB controllers, so I kept one with FreeBSD, and use another with Windows.
That's definitely a great think which makes me getting rid of VirtualBox.
Is it possible with BHYVE to pass just a single USB port or just a single plugged device like with Virtualbox?
 
So does that mean I can, simply put, access a bhyve-run copy of Windows 10 in a separate window (or something) on my FreeBSD-CURRENT desktop?
Currently I have to use Linux & VMPlayer to that effect (runs Fullscreen, supports my webcam and microphone -- which VBox under FreeBSD does not).

Then, of course, using a native tool that's part of base would be just wonderful and I'll get rid of my Linux altogether in that case. Is it the time now?
Can an already installed Windows-10 HD (or vmdk for that matter) be used, I wonder?
 
If you build the latest bhyve code from the projects/bhyve_graphics svn you can get VNC access to the guest. The graphics performance is nothing spectacular though, it's mainly useful for installation or tasks you can't do via RDP/ssh/whatever.

As mentioned by aragats, you can't pass through individual USB devices at the moment (there was supposed to be a GSOC project for this a few years ago but I have no idea what happened to it). However, most motherboards have more than one USB controller, so it is possible to pass through one of them to the guest. It might just take a bit of trial-and-error to find out which physical ports are on which controller. In aragats case he passed through a USB3 controller, which will have made it simpler if he only had one USB3 controller, as the ports are fairly easy to tell apart.

It is possible to convert a vmdk file into a raw file using the qemu-image tool. I don't know whether this would work with Windows though unless the old hypervisor happened to use the exact same disk emulation as bhyve (AHCI). Windows is funny about moving between different hardware.
 
If you build the latest bhyve code from the projects/bhyve_graphics svn you can get VNC access to the guest. The graphics performance is nothing spectacular though, it's mainly useful for installation or tasks you can't do via RDP/ssh/whatever.

As mentioned by aragats, you can't pass through individual USB devices at the moment (there was supposed to be a GSOC project for this a few years ago but I have no idea what happened to it). However, most motherboards have more than one USB controller, so it is possible to pass through one of them to the guest. It might just take a bit of trial-and-error to find out which physical ports are on which controller. In aragats case he passed through a USB3 controller, which will have made it simpler if he only had one USB3 controller, as the ports are fairly easy to tell apart.

It is possible to convert a vmdk file into a raw file using the qemu-image tool. I don't know whether this would work with Windows though unless the old hypervisor happened to use the exact same disk emulation as bhyve (AHCI). Windows is funny about moving between different hardware.
OK thank you! I'll give it a try... VNC is rather slow as per my experience.
 
I cannot see myself saying goodbye to VirtualBox on my FreeBSD host. My last purchase of a Microsoft product was XP which runs my Bible-related apps, and I have many, which I never plan to retire. So, I give my XP virtual machine (VM) one of my two monitors in full screen and it runs better on my Xeon E3-1225 v3 than it ever did natively on older 32 bit platforms. I set the resolution of the monitor to match my laptop's, which also runs FreeBSD, and I log in to XP via rdesktop. Crashes to XP are extremely rare and never has the file system become corrupted. Beautiful.

Further, It's too easy to try out some Linux distro or a FreeBSD setup in a VM. Just this morning I setup a DHCP/TFTP server and client using the VirtualBox Internal Networking. I'm taking baby steps in my learning. Next will come a router. At other times I have built packages in a VirtualBox VM.

My primary print server is a 32 bit box running CUPS. My backup print server is a 32 bit box using LPD. Since the latter is greatly simplified using only LPD, I wondered if I could run it from a Live CD--something I had never made. I successfully built the CD in a VirtualBox VM.

I have played around a little with other hypervisors, and bhyve, and though it all fascinates me, I just can't find a practical application on our little LAN.

If bhyve ever supported XP that would be a game changer, but that's not going to happen.
 
pwr2srv cannot say the same about my Win XP installation in qemu FreeBSD. It worked for some time, then started slowing down... all the way to becoming almost unusable. Just the way it happens to the real MS Win installation...

Oh yea, and I really admire you guys who manage to make it work for such LOOONG time :) You must have a secret agreement with that corporation LOL. It was, in fact, my failure to be happy with Win 95 which pushed me to explore UNIX OS's. Then Linux degraded and FreeBSD evolved to be the smoothest OS... etc.

But now I'm running Win 10 in VMPlayer 12 under Ubuntu 16 installed on ZFS in the same pool with my FreeBSD and am VERY glad.

So yes, whatever be it with bhyve, to VirtualBox I had to say goodbye. Though the reason is more or less laughable: it's because it doesn't support my web-camera and my microphone doesn't work in it! I personally could never care less, but the project I need Win 10 for just happens to require at least the mike for interaction. So... will have to wait until the VirtualBox extension pack gets supported in FreeBSD -- which doesn't seem to depend on FreeBSD developers, does it?
 

My experiences were the same on the real hardware, but my XP VM really is frozen in time, I hope, so there is no slowing. I don't add any apps or make changes and browsing the web is a near no-no. Also, I don't have any need for anything USB, just bi-directional cut-and-paste and Guest Additions. The attached virtual drives add up to about 50GB. The office suite is Office 97 with many Word macros to make things play nicely together. I keep Firefox up to date and my writings and the virtual drives backed up to a separate FreeBSD box. My XP setup and most of the apps really began life on real hardware with NT4, then moved to 2000, to XP, then virtualized.

Confession: I have never used QEMU.

Has it been that "LOOONG"? My, how time flies.
 
Hi :)

Load bhyve under VMWare Workstation 10.0.1
Guest OS FreeBSD 11.0-RC2 r305704
Followed the instructions on https://wiki.freebsd.org/bhyve/Windows
Prepared the ISO (Windows 7 Ultimate x64), no problems.

list catalog
Code:
# ll -h
total 3173988
-rwxr-xr-x  1 root  wheel  2.0M Sep 12 01:15 BHYVE_UEFI.fd*
-rw-r--r--  1 root  wheel  3.0G Sep 12 01:27 install.iso
drwxr-xr-x  8 root  wheel  512B Sep 12 01:16 iso-win/
-rw-r--r--  1 root  wheel  20G Sep 12 01:28 windows7.img

My steps
1. Start bhyve
Code:
# bhyve -c 1 -s 0,hostbridge -s 3,ahci-hd,windows7.img -s 4,ahci-cd,install.iso -s 10,virtio-net,tap0 -s 31,lpc -l com1,/dev/nmdm0A -l bootrom,BHYVE_UEFI.fd -m 2G -H -w windows7
2. Connect
Code:
# cu -l /dev/nmdm0B -s 9600

and after few minutes, on screen only this

Code:
Computer is booting, SAC started and initialized.                            
                                                                            
Use the "ch -?" command for information about using channels.
Use the "?" command for general help.
SAC>
EVENT: The CMD command is now available.
SAC>

In instruction about this moment
...
... If you only see the CMD channel with another version of Windows, your installation has probably had an error with regard to license keys. To exit the CMD channel back to SAC, type exit...
...


I try add ProductKey in file AutoUnattend.xml
But no result...

Help me, please :)
 
To be honest, if you're running 11-RC2 it will probably be easier to just use a standard windows CD and install via VNC. At least then you can run through the graphical install like normal and see any errors if they come up. With the unattended install you have to get everything just right, then you're flying pretty blind when it actually installs.

To do that you'll want to make sure you have the most recent firmware (I don't know where yours came from). The easiest way these days is to install sysutils/bhyve-firmware which will put it in /usr/local/share/uefi-firmware/.

Then just add a graphics device to bhyve
Code:
-s 7,fbuf,tcp=0.0.0.0:5900,wait -s 8,xhci,tablet

Once started you can connect to the FreeBSD's IP address with a VNC client and install the guest.
 
To be honest, if you're running 11-RC2 it will probably be easier to just use a standard windows CD and install via VNC. At least then you can run through the graphical install like normal and see any errors if they come up. With the unattended install you have to get everything just right, then you're flying pretty blind when it actually installs.

To do that you'll want to make sure you have the most recent firmware (I don't know where yours came from). The easiest way these days is to install sysutils/bhyve-firmware which will put it in /usr/local/share/uefi-firmware/.

Then just add a graphics device to bhyve
Code:
-s 7,fbuf,tcp=0.0.0.0:5900,wait -s 8,xhci,tablet

Once started you can connect to the FreeBSD's IP address with a VNC client and install the guest.

Thanks!!! Great!!! :))))
All start immediately and i connect from VNC (use UltraVNC Viewer)
use this command in shell
Code:
# bhyve -c 1 -s 7,fbuf,tcp=0.0.0.0:5900,wait -s 8,xhci,tablet -s 0,hostbridge -s 3,ahci-hd,windows7.img -s 4,ahci-cd,MSDN_CD_Win7x64_Ultimate.iso -s 10,virtio-net,tap0 -s 31,lpc -l bootrom,BHYVE_UEFI.fd -m 2G -H -w windows7

but work only keyboard, mouse don't capture in VNC windows, need install driver ?

and one moment, but i think this problem with my VMWare Workstation and resources for a virtual machine, between step install Windows 7, wait 2-3 minutes(create disk, copy files and etc) will try more RAM memory for VM :)
 
Ahh sorry, the xhci mouse might not be supported in Windows 7 by default.
Try removing -s 8,xhci,tablet. The mouse tracking isn't brilliant without the xhci mouse but it should be good enough to get it up and running.
 
This may seem like a question coming from ignorance of VB. That's because I rarely use or configure VB. Most of my VB time was shortly after Sun acquisition. I wasn't that enthralled with it. Plus - I'm skeptical of software with proprietary bits. Is any of it still proprietary? The same ignorance (mine) goes along with BHyve, but I'm not a system admin - maybe that's a factor. I use QEMU with near native speed for my purposes, although not for Windows. So, is QEMU considered un-applicable in this realm for some reason? I guess it's because QEMU is not (by original intent, especially without KVM) a virtualization farm system, and all you sys-admins use VB and BHyve for that aspect mainly?

Of course you are.

So, back to KVM/Qemu for your specific purposes: Is it entirely unsuited?
 
I don't know much about QEMU but it seems far more Linux-orientated. I also believe it mainly relies on KVM to provide near-native performance.
Bhyve is effectively KVM for FreeBSD. It's a very lightweight hypervisor, 100% designed on/for FreeBSD, making full use of hardware virtualisation features (VT-x,VT-d,etc) - In fact it won't work without VT-x.

Maybe VirtualBox is better than the credit I give it, but I tend to see it as more of a hobby/workstation hypervisor. Bhyve & KVM are more like ESXi/Hyper-V.
 
One other thing, if you install Windows in bhyve using a standard install CD, you'll probably find there's no network as it won't have drivers for the virtio-net network device. Easiest thing to do is get the ISO image of the drivers, then boot the guest up with that ISO file attached.
 
Back
Top