churchers / vm-bhyve

Shell based, minimal dependency bhyve manager
BSD 2-Clause "Simplified" License
821 stars 174 forks source link

Windows 2016 Server - Boot Failed. EFI DVD/CDROM #271

Open ole-db opened 5 years ago

ole-db commented 5 years ago

Hi,

I tried to install Windows 2016 Server but it fails to boot from iso:

vm create -t windows win2016server
vm install win2016server de_windows_server_2016_updated_feb_2018_x64_dvd_11636745.iso

My win2016server.conf looks like:

uefi="yes"
cpu=1
memory=16G
#network0_type="virtio-net"
network0_type="e1000"
network0_switch="internal"
disk0_type="ahci-hd"
disk0_name="disk0.img"
disk0_opts="sectorsize=512"
uuid="22c73bda-e8ee-11e8-b5c1-901b0edacb37"

graphics="yes"
xhci_mouse="yes"
graphics_listen="127.0.0.1"
graphics_port="5901"
graphics_res="1024x768"
network0_mac="58:9c:fc:05:e9:d4"

On console I see:

Boot Failed. EFI DVD/CDROM
Boot Failed. EFI Hard Drive
.

Did I miss something? By the way, do you think Bhyve is a good choice for Hosting Windows as a production system?

ole-db commented 5 years ago

after deleting the vm, and recreating it still won't start. It gets stuck in the shell. The log:

Nov 18 18:26:30: initialising
Nov 18 18:26:30:  [loader: none]
Nov 18 18:26:30:  [uefi: yes]
Nov 18 18:26:30:  [cpu: 2]
Nov 18 18:26:30:  [memory: 16384M]
Nov 18 18:26:30:  [hostbridge: standard]
Nov 18 18:26:30:  [com ports: com1]
Nov 18 18:26:30:  [uuid: 22c73bda-e8ee-11e8-b5c1-901b0edacb37]
Nov 18 18:26:30:  [utctime: no]
Nov 18 18:26:30:  [debug mode: yes]
Nov 18 18:26:30:  [primary disk: disk0.img]
Nov 18 18:26:30:  [primary disk dev: file]
Nov 18 18:26:30: initialising network device tap6
Nov 18 18:26:30: adding tap6 -> bridge1 (internal addm)
Nov 18 18:26:30: bring up tap6 -> bridge1 (internal addm)
Nov 18 18:26:30: booting
Nov 18 18:26:30:  [bhyve options: -c 2 -m 16384M -Hwl bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -U 22c73bda-e8ee-11e8-b5c1-901b0edacb37]
Nov 18 18:26:30:  [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,ahci-hd,/vm/win2016server/disk0.img -s 5:0,e1000,tap6,mac=58:9c:fc:05:e9:d4 -s 6:0,fbuf,tcp=127.0.0.1:5901,wait -s 7:0,xhci,tablet]
Nov 18 18:26:30:  [bhyve console: -l com1,/dev/nmdm-win2016server.1A]
Nov 18 18:26:30:  [bhyve iso device: -s 3:0,ahci-cd,/vm/.iso/de_windows_server_2016_updated_feb_2018_x64_dvd_11636745.iso]
Nov 18 18:26:30: starting bhyve (run 1)

The ISO is ok. I checked md5 and it boots in virtalbox

matuscak commented 5 years ago

Try adding: graphics_wait="yes"

It will delay start of VM until you connect VNC session. There is usually very short time during which message "Press any key to boot from CD" is displayed, you must not miss it and react quickly, otherwise it ends with the "Boot failed".

I usually press Enter repeatedly from the moment I open VNC session (=VM starts) until I see that Windows installation DVD is being loaded.

ethoms commented 5 years ago

I'm having the same problem, I've tried several Windows 7 and 10 iso's. I'm also using FreeBSD 11.2 and the latest byhve-firmware (uefi-edk2-bhyve-0.2,1). I have bypassed vm-bhyve alltogether and doing it the pure bhyve way (byhve and bhyvectl), creating the tap and bridge myself etc. I just can't get any Windows to boot. I'm following many guides including this one:

https://www.ateamsystems.com/tech-blog/howto-windows-10-bhyve-w-freebsd-11/

I am able to get Ubuntu 18.04.1 server installed without any issue at all, both using grub2-bhyve and UEFI. So it's nothing to do with my installation and/or VNC client.

Worth noting, I am using the recommeded slot numbers (lpc is using 31). This is not a vm-bhyve issue,it's a byhve + windows uefi issue.

ole-db commented 5 years ago

I can't say what changed in the mean time. But I updated the base system. Today I gave it a try again. And it just works as expected :-)

# cat /vm/win2016server/win2016server.conf 
loader="uefi"
cpu=2
memory=16384M
network0_type="e1000"
network0_switch="internal"

disk0_type="ahci-hd"
disk0_name="disk0.img"
uuid="22c73bda-e8ee-11e8-b5c1-901b0edacb37"
debug="yes"

graphics="yes"
xhci_mouse="yes"
graphics_listen="127.0.0.1"
graphics_port="5901"
graphics_wait="yes"
network0_mac="58:9c:fc:05:e9:d4"
utctime="no"

# vm install win2016server de_windows_server_2016_updated_feb_2018_x64_dvd_11636745.iso
Starting win2016server
  * found guest in /vm/win2016server
  * booting...

 # sockstat -4 -l | grep 5901
root     bhyve      9565  7  tcp4   127.0.0.1:5901        *:*
ethoms commented 5 years ago

I can't recall exactly the details of this issue. However, I eventually got a Windows ISO to install. From the best of my recallection it was the ISOs themselves. An authentic copy of Windows should work, but many of the custom ISOs (e.g performance editions) do not boot, the bhyve UEFI loader doesn't like them.

DISCLAIMER: I was wanting a performance edition for a smaller disk and memory footprint, I have legitimate product keys.

Consider the issue resolved for me, it was not a vm-bhyve issue.

I do have another issue though, again not vm-bhyve related: I can't get the Windows virtio-net to work properly. Whilst the virtio-net built into Ubuntu 18.04 server worked amazingly well, in Windows it's still CPU bound, and just playing 1080p video over RDP is enough to peg a couple Intel Haswell cores to over 80%. So I'm using th e1000 emulation since it's less CPU bound than the seemingly broken Windows virtio-net drivers. I tried several versions of the virtio-net drivers, all had the same behaviour. I spent 2-3 full days on it before I gave up.