Have look at possible portable versions for virtualbox, vmware workstation, ms virtualserver, etc?
Of all virtualisation softwares, QEMU is maybe the easiest one : portable, little or no dependency, etc ...
Now question is : why would you run a VM in Winpe?
Is not this easier to "just" boot another machine over the network since you are into booting over the network.
About SMB, consider other solutions such as iscsi, aoe, etc to take it lower into the OSI layers and not have to mess with ACL's.
Cheers,
Erwan
I completely forgot about QEMU! Good shout, I'll take a look next weekend when I have a bit of time
As for running VMs in WinPE, my project is going to run services anyway, why not make it able to run anything?
iSCSI is certainly an option to explore, I know its relatively simple getting iSCSI Initiator in there and I can script it easily.
The problem is at the server end for making iSCSI LUNs on the fly, but its very easy with SMB - I use SMB all the time and can deal with ACLs. Go look at the state machine for iSCSI, fuck building that lol https://tools.ietf.org/html/rfc7143
Below worked fine.
qemu-system-x86_64.exe file version=(2.1.3.0)
qemu-system-x86_64.exe -boot d -m 2048 -cdrom "E:\10PE2\ISO\Win10PESE_x64.iso" -L "E:\Qemu\pc-bios"
My Setup= Toshiba Satellite C655D-S5518 w/6G Ram, 1T SSD, Booting Grub4Dos --> Win10PESE_x64.iso== 2.25G
I also run PeBakery on Toshiba to build the very .iso that it boots from.
The qemu I am using is the one that comes with PeBakery.
(Above is a dedicated field-laptop running Win10_x64 and RTL-SDL's)
I currently have an HP Proliant ML150 Gen3, 2 Quad Cpus, with Raid10 Arrays. @16G Ram ECC
That I run a Win7PE_x64 on and use for testing and simple file sharing.
I would be happy to see some of the code you have, In return I can assist.
Regards
RoyM
Fantastic to hear! I'll grab that version and throw it in the provisioning script to see if i can get it to boot and auto start a VM.
Next will come network support...
As for the code, it starts with a TFTP Server just to boot a rom-o-matic build of iPXE to start the fun stuff.
I'm using a good .NET library called TFTP.net that's very event-y.
It also starts an HTTP Server for all boot files and WIMs, which I'm going to build database interaction into so you can define what you want each client to load and what config to run.
iPXE then pulls down a config depending on the MAC address of the boot NIC:
chain --autofree http://pecloud.hexagon.red/ipxe/${net0/mac}/menu.ipxe || echo ${HTTP_ERR}
I then wrote an HTTP router similar to ExpressJS to handle the same kind of syntax, which in the future when I hook it up to a db should simplify things:
Sub InitPXERoutes()
_parentRouter.AddRoute("/boot.ipxe", AddressOf ChainLoader)
_parentRouter.AddRoute("/boot.cfg", AddressOf BootConfigLoader)
_parentRouter.AddRoute("/menu.ipxe", AddressOf MenuLoader)
_parentRouter.AddRoute("/wimboot", AddressOf Wimboot)
_parentRouter.AddRoute("/windows.ipxe", AddressOf WinLoader)
_parentRouter.AddRoute("/windows/bootmgr", AddressOf Windows)
_parentRouter.AddRoute("/windows/boot/bcd", AddressOf Windows)
_parentRouter.AddRoute("/windows/boot/boot.sdi", AddressOf Windows)
_parentRouter.AddRoute("/windows/sources/boot.wim", AddressOf Windows)
_parentRouter.AddRoute("/init.ps1", AddressOf PowerShellInit)
_parentRouter.AddRoute("/init/:macaddress/init.ps1", AddressOf PowerShell)
_parentRouter.AddRoute("/ipxe/:macaddress/menu.ipxe", AddressOf IPXEInit)
End Sub
Select Case context.Request.Url.AbsolutePath
Case "/windows/bootmgr"
HttpRouter.returnFile(context, "C:\Users\Dan\Documents\hbcd\x64\bootmgr")
Case "/windows/boot/bcd"
HttpRouter.returnFile(context, "C:\Users\Dan\Documents\hbcd\x64\boot\bcd")
Case "/windows/boot/boot.sdi"
HttpRouter.returnFile(context, "C:\Users\Dan\Documents\hbcd\x64\boot\boot.sdi")
Case "/windows/sources/boot.wim"
HttpRouter.returnFile(context, "C:\PESE\ISO\TI\WIM\sources\boot.wim")
End Select
It's very simple at the moment for testing things but I can't wait to build it into something that could deploy a whole farm of servers in a matter of minutes!
Arguably I could have done a very similar thing with a linux based OS (which would probably be better for VM Stuff) but my original idea was to run .NET apps native without mono.