FreeBSD 11 Release - bhyve and Windows 7

Hi! :)

Host computer

OS FreeBSD 11 Release
Processor Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (3997.77-MHz K8-class CPU)
real memory = 34359738368 (32768 MB)
avail memory = 33237377024 (31697 MB)
SSD x 2 - Samsung SSD 850 EVO 500GB EMT01B6Q (RAID Stripe - hardware)

Guest.
I install Windows 7 Pro and Ultimate versions under VM bhyve.
Start install Windows 7.
Copynig files very fast, one second!
Installation goes two - three hours on this stage "Expandeding Windows files..."
and three dots move... move... move... install don't freeze, vm bhyve work normal.
But two - three hours... 0% or 3,5,6 or 8%...
kak-ustanovit-windows-7_11_1.jpeg

After install finish all working very quckly, excellent boot, reboot system, RDP, install program, work glass effect(Aero theme), sound, video and etc.

Another system Windows 8, 8.1, Windows Server system, CentOS, FreeBSD and etc.
No problem with long installation, 5 - 10 minutes.


May be who know, why install only Windows 7 is too long ?
With achi problem and installer old, may be this ?

What ideas ?
 
Win 7 is a slow install, but 2-3 hours does seem excessive (30-45 mins is more like it).

What did your bhyve config look like ?
 
grehan@
Thanks for your answer :)
This my config

Code:
# pwd
/vmdata
# cat bhyve_load_win7

Code:
#!/bin/sh
bhyve -c 2 -s 7,fbuf,tcp=0.0.0.0:5900 \
-s 0,hostbridge -s 3,ahci-hd,windows7.img \
-s 4,ahci-cd,win7_pro_x64.iso \
-s 10,virtio-net,tap0 -s 31,lpc -l bootrom,BHYVE_UEFI.fd \
-m 6G -H -w windows7
 
Thanks, I'll see if I can repro that.

Something quick to try is to do the install with a single vCPU (-c 1), and then bump it up post-install.
 
The first phase of an install with Win7 Home Premium, a single vCPU and 'sectorsize=512' appended to the ahci-hd option took ~40 mins. There was quite a bit of that time where the guest was idle, but Vista has similar behaviour during a scripted install in bhyve.
 
The first phase of an install with Win7 Home Premium, a single vCPU and 'sectorsize=512' appended to the ahci-hd option took ~40 mins. There was quite a bit of that time where the guest was idle, but Vista has similar behaviour during a scripted install in bhyve.
Hmm... sectorsize=512 ?! Good information, thanks ;)
You write an interesting point.
I read manual about bhyve(8) command line many times, but not focused on the additional options for ahci-hd.
Ok, i will test too install Win7 again, but set sectorsize=512
 
windows 7:
"windows cannot be installed on this disk", when see a select disk dialog.
After a start install had watching "zero" progress about 2 hours.
bhyvectl --vm=win7 --destroy
 
Hi ! 8 years after, had you solved your issue ?

My config : zfs on FreeBSD 14.2-RELEASE-p1 GENERIC amd64

As per very good Vermaden post : https://vermaden.wordpress.com/2023/08/18/freebsd-bhyve-virtualization/
pkg install -y vm-bhyve-devel bhyve-firmware edk2-bhyve dnsmasq grub2-bhyve tigervnc-viewer rdesktop

Succesfully installed windows 10, works very good !

Unsuccesfully tried many times windows 7, with various ISO files to install windows7 32 and 64 bits
w7 32 bit : fall back to UEFI shell at very beginning
w7 64 bit : install stuck in “Starting Windows” screen for at least 10 hours …

Can anyone kindly help ?
 
Show your config and describe your hardware.
Maybe you have AMD machine?

yes, AMD :
HP PRODESK 800 G1
CPU: Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz (3192.67-MHz K8-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
zfs on FreeBSD 14.2-RELEASE-p1 GENERIC amd64

vm config file :
loader="uefi"
graphics="yes"
cpu=1
memory=2G
ahci_device_limit="8"
network0_type="e1000"
network0_switch="public"
disk0_type="ahci-hd"
disk0_name="disk0.img"
disk0_opts="sectorsize=512"
utctime="no"
bhyve_options="-s 8,hda,play=/dev/dsp,rec=/dev/dsp"

:)
 
Hi ergoblue
I found your question when I faced problems during my attempt to install Windows 7 64bit Professional as a bhyve guest myself and since you posted fairly recent and I believe that this might be helpful for you and others. This is the machine I run bhyve on:
Code:
$ sysctl hw.model
hw.model: AMD A4-5000 APU with Radeon(TM) HD Graphics
$ freebsd-version -kru
14.3-RELEASE
14.3-RELEASE
14.3-RELEASE

I use standard bhyve(8) commands and -k config files but I'm sure you can easily adapt this to vm-bhyve(8).

To save time you can verify whether or not the Windows 7 64bit installation is actually stuck/frozen at the "Starting Windows" screen using a console connection (see FreeBSD Handbook for details):
Code:
# kldload nmdm if necessary
$ grep nmdm /boot/loader.conf
nmdm_load="YES"
# use bhyve -l com1,/dev/nmdm0A then you can connect using cu -l /dev/nmdm0B

During the Windows 7 installation, the console connection gives you access to Windows' "Special Administration Console": SAC>. Type ? to check if the console is still responsive. If you don't get any SAC output after like 10 seconds your Windows 7 installation is stuck and you can bhyvectl --vm=yourWin7VMname --force-poweroff and --destroy.

Windows 7 doesn't like fancy bhyve configs or XHCI tablets (mouse will not work then or later and drivers are hard to find) during installation, let alone loading virtio drivers. You can add all the stuff you need later when the installation was successful. Your mouse will be somewhat usable though but I preferred a keyboard input only installation.

The following was my bhyve -k configfile that worked, I added more cpus and memory.size as well as virtio devices after the installation.

Note:
  • Changing the config requires bhyvectl --vm=yourWin7VMname --destroy.
  • zfs create -V 25G -o volmode=dev zyourpool/vms/win7/disk0 where zyourpool is most likely zroot. Do not use zfs create -p if the parent dataset does not exist, this doesn't work well with volmode=dev.
  • Get the latest virtio drivers from Fedora. Guest tools are not available for Window 7 I think.
  • Since XHCI tablet doesn't work and the default mouse movement is horrible follow the post-installation instructions of vermaden for establishing a Windows 7 RDP connection to get proper mouse movement and easy file transfer from your bhyve machine to the Windows 7 guest system.
  • Verify a frozen installation using nmdm as described above.
  • Replace the UEFI variables file with a fresh copy in case of a failed installation (see remark in config below).
Windows 7 Professional 64bit installation config for bhyve:

Code:
name=yourWin7VMname
cpus=1
cores=1
threads=1
sockets=1
memory.size=2048M
# pick your keyboard layout: /usr/share/bhyve/kbdlayout
keyboard.layout=uk
rtc.use_localtime=true
acpi_tables=false
acpi_tables_in_memory=false
pci.enable_bars=false
destroy_on_poweroff=true
# not sure if you have to wire memory but I thought this makes things more stable
memory.wired=true
x86.strictmsr=false
x86.vmexit_on_hlt=true
x86.vmexit_on_pause=true
pci.0.0.0.device=hostbridge

### no networking devices during installation! ###
# pci.0.2.0.device=virtio-net
# pci.0.2.0.backend=tap0
# pci.0.3.0.device=e1000
# pci.0.3.0.backend=tap1
### add networking devices and virtio drivers after installation ###

pci.0.6.0.device=ahci
pci.0.6.0.port.1.type=cd
# I had a physical Windows 7 CD available
pci.0.6.0.port.1.path=/dev/cd0
# Do not load virtio drivers during installation but configuring the ISO is ok
pci.0.6.0.port.1.type=cd
pci.0.6.0.port.1.path=/path/to/virtio-win-0.1.271.iso
pci.0.6.0.port.2.type=hd
# zfs create -p seems to mount the disk so it would not be avaiable under /dev/zvol
pci.0.6.0.port.2.path=/dev/zvol/zyourpool/vms/win7/disk0
# I believe I had to use 512/512 rather than just 512
pci.0.6.0.port.2.sectorsize=512/512
# Don't forget the the "wait" below requires you to start the VNC connection to make the VM start
pci.0.29.0.device=fbuf
pci.0.29.0.wait=true
pci.0.29.0.rfb=127.0.0.1:5900
# vga=io was important
pci.0.29.0.vga=io
pci.0.29.0.w=1024
pci.0.29.0.h=768
pci.0.29.0.password=hunter2
pci.0.31.0.device=lpc
# NOTE:
# In case of a previous failed installation: always replace BHYVE_UEFI_VARS.fd with a fresh copy from /usr/local/share/uefi-firmware/
# pkg install bhyve-firmware if needed
lpc.bootrom=/path/to/BHYVE_UEFI.fd
lpc.bootvars=/path/to/BHYVE_UEFI_VARS.fd
# use cu -l /dev/nmdm0B to verify if the installation is stuck or not
lpc.com1.path=/dev/nmdm0A
lpc.fwcfg=qemu
 
Many thanks @AndAlooongCameFreeBSD, your config helped to compare and sort out the stuck win7 installation for long time.
Basically i need to turnoff acpitables and viola all went very quick.
loader="uefi"
graphics="yes"
cpu=2
memory=2G
ahci_device_limit="8"
network0_type="e1000"
network0_switch="public"
disk0_type="ahci-hd"
disk0_name="disk0.img"
disk0_opts="sectorsize=512"
utctime="no"
bhyve_options="-s 8,hda,play=/dev/dsp,rec=/dev/dsp -o acpi_tables=false"
uuid="d1b0bb81-5faf-11f0-b46e-4c5f70736ad1"
network0_mac="58:9c:fc:05:5b:7a"

After installation finish I tried removing the parameter to have the original config, but windows 7 still stuck at the loading screen so left the -o acpi_tables=false as it is. Some experts may comment the right way to do it.
 
Back
Top