Windows installation -------------------- Not too much complication here other than the 2 reboots during install. The trick is to have the CD configured only for the first boot. It has to be removed from the bhyve command line for the second and subsequent boots, since there isn't currently a boot selection in UEFI and a CD is automatically given preference, resulting in an endless cycle of CD installs. For Windows-desktop installs, the ahci-cd drive *must* be kept there, and a 0-byte file used instead e.g. 'touch null.iso'. For Windows Vista/7/Server2k8 installs, the sector size of the ahci-hd hard drive image should be forced to 512 bytes using using the 'sectorsize=512' parameter. There are currently some slot limitations with UEFI: - AHCI devices must be in slots 3/4/5/6 - The PCI-ISA bus aka lpc must be in slot 31 - virtio-net devices can be in any slot. virtio-block devices have an issue with descriptor overflow that is being worked on, so avoid using it for the time being. You'll want at least a 30G disk image for windows. A typical command-line would look like: bhyve \ -c 2 \ -s 0,hostbridge \ -s 3,ahci-hd,/images/win.img \ -s 4,ahci-cd,/images/win_repack.iso \ -s 10,virtio-net,tap0 \ -s 31,lpc \ -l com1,/dev/nmdm0A \ -l com2,/dev/nmdm1A \ -l bootrom,/path/to/BHYVE_UEFI.fd \ -m 2G -H -w \ windows (Note the UEFI binary file can be grabbed from http://people.freebsd.org/~grehan/bhyve_uefi/BHYVE_UEFI_20151002.fd) The "-A" option isn't used here since UEFI generates it's own ACPI tables. Another concept to learn is the Windows "SAC" (aka EMS) serial console, which provides a BMC-like interface to Windows. There are a number of built-in commands, and it can also create DOS prompts and switch between them with it's mux. This will be used to monitor the installation process on com1. https://technet.microsoft.com/en-us/library/cc785873%28v=ws.10%29.aspx Installation slows down with more vCPUs. I'd recommend using 1-2 until the third/final stage, and then firing up the number that you want. I've not done more than 8. Another point - 'bhyvectl --destroy' shouldn't be used between invocations of bhyve, unless all resources of the VM need to be released. Steps ===== 1. First boot: Windows install, stuff copied from the CD to the hard drive. After booting, and about ~15 secs, there will be two additional channels available in the SAC console. These are for output of the autoinstall process: SAC> EVENT: The CMD command is now available. SAC> EVENT: A new channel has been created. Use "ch -?" for channel help. Channel: SACSetupAct SAC> EVENT: A new channel has been created. Use "ch -?" for channel help. Channel: SACSetupErr SAC>ch Channel List (Use "ch -?" for information on using channels) # Status Channel Name 0 (AV) SAC 1 (AV) SACSetupAct 2 (AV) SACSetupErr 1a. You can connect to channel 1 and watch stuff fly by. After about 1 minute, the first version of the install on channel1, SACSetupAct, will exit back to SAC, but you can then immediately reconnect for the 2nd phase. This will move reasonably quickly to the main extract: nPEArchiveOldWindowsFoldersDoneCheckpoint" successfully set. 2015-06-01 17:45:40, Info [0x06412c] IBSLIB SetCheckpoint: Checkpoint("Wi nPEImageApplyReadyCheckpoint") in progress... 2015-06-01 17:45:40, Info [0x06412e] IBSLIB SetCheckpoint: Checkpoint "Wi nPEImageApplyReadyCheckpoint" successfully set. 2015-06-01 17:45:40, Info [0x06009e] IBS DeployWIMImage:Calling IDepWI MImageResolved::Apply... 2015-06-01 17:45:40, Info [0x0606cc] IBS Calling WIMApplyImage (flags = 0x180)... .. and will set here for about ~5 mins, using up lots of CPU as it copies stuff from the ISO to the hard drive, very visible with 'top -H' on the host. It then starts installing the virtio drivers which takes a few minutes (could be reduced by pruning out unnecessary Windows versions and driver types when doing the extract above). After this is done, the VM will shut done, ready for the 2nd phase. This phase takes about ~8 mins on an IvyBridge desktop. 2. Second boot, from the hard drive, for SYSPREP. For this next step, the CD has to be taken out from the command line so Windows can be booted from the hard drive. The SACSetupAct and SACSetupErr channels are available in this phase, but take a good ~25 seconds to come up. However, the SYSPREP phase is much quicker. bhyve will spit out some errors for unimplemented SATA commands but these can be ignoredk: Unsupported cmd:5d Unsupported cmd:5d Unsupported cmd:f5 There is a progress indicator for the install on SACSetupAct channel: plete = 2, Progress = 33% (33%) 2015-06-01 18:16:36, Info SYSPRP SPPNP: Status: Active 2015-06-01 18:16:36, Info SYSPRP SPPNP: Status: Total = 6, Com plete = 2, Progress = 33% (33%) When it's done, Windows reboots and the VM exits. This phase takes 2min30sec on the IvyBridge desktop. 3. Third boot, Windows proper, first time. Also without the CD configured. This boot is a little slow. It takes ~40 secs for CMD to be available, and gobs of CPU are used for quite a long time (~15 mins ?). It appears that Windows does a whole lot of work during this time, but it eventually does settle down. Still not perfect: server 2016 appears to use ~2% host CPU when idle. Shutdown is also a little slow on the first real boot. The virtio interface should use DHCP by default, but you can override that using the 'i' command from the SAC console or your favourite command-line net tool. The XML auto-install script enables RDP with just password auth, and allows RDP through the firewall so you should be able to connect via RDP to the VM once it's up. The XML unattend scripts set up by default the "Administrator" account with a password of "Test123". To find out the IP address if DHCP is used, the 'i' command in SAC will display it. Note that RDP isn't available for quite a few minutes on the first boot. You'll see rejected connections, but it will eventually let you in. Even then, the server manager takes a few more minutes to show up. FreeRDP works great as a client, but doesn't support dynamic window sizing. The Microsoft Remote Desktop client for OSX works well.