@gundobaldo66
@SIW2
@Bree
Forget any 3rd party stuff -- it can be done simply via "Bog standard Windows" commands :
One way is to create a vhd file (boot W7 install media, create a vhd file (from install media choose repair system->command prompt get into diskpart, create an efi file via diskpart, clean, convert gpt, create partition efi size=100, format fs=fat32, list vol, assign letter=S.
Now create a vhd virtual disk disk and attach it -- Win 7 does not support vhdx so you have to use a vhd file)
still within diskpart create a vdisk (assume your target disk is E)
create vdisk file=e:\win7sys.vhd maximum=<size you want> type=fixed
when it's done still in diskpart) attach vdisk.
now do list disk again and select the new disk shown -- should be the size of the vdisk created (when making the vdisk you should select a size a bit bigger than the windows partition we are about to create ). create partition primary size=<size> format fs=ntfs quick.Select volume and say assign it as letter=W.
exit diskpart. stay though in the command prompt Assume the iso /dvd is letter D
cd d:\sources
d:
install W7 via dism (examples all over the forum)
e.g
dism /Apply-Image /ImageFile
:\sources\install.wim /Index:1 /ApplyDirW:\ (remember our target disk is W)
Now simply install the bootloader :
cd W:\windows\system32
w:
bcdboot w:\windows /s S: /f UEFI
exit, now reboot -- use the firmware to boot from the USB drive. Finish the OOBE setup , job done !
Now to update etc you have to "poodlefake" windows into thinking it's not on an external drive so get into regedit and set the entry to '0' (or create the key if it doesn't exist).
Change the '1' to '0'. If the entry doesn't exist create it to stop "nags" about don't remove the usb device when running Windows.
(For Windows 10 and 11 you can use vhdx files - better. You do need to set the portableoperatingsystem entry otherwise you can't update to newer releases or clone the system to an internal devive -- it will still think it's on a removable device even though cloned to a fixed one).
Cheers
jimbo