[Question]: Mounting WinPE ISO and Working on Installed OS Drive
Is your question not already answered in the FAQ?
- [X] I made sure the question is not listed in the FAQ.
Is this a general question and not a technical issue?
- [X] I am sure my question is not about a technical issue.
Question
TL;DR
I'm seeking guidance on whether it's possible to mount a WinPE ISO and work on a drive containing an already installed OS, specifically to create an image with prepackaged software after running sysprep on the previously installed OS contained in storage/.
Could you please advise on the following:
- Is it possible to mount a WinPE ISO and work on the drive containing the installed OS as described?
- If so, what changes or additional configurations are required to achieve this?
Thank you for your assistance in advance!
Setup
Here is my storage/ directory structure:
[4.0K] ./
├── [4.0K] shared/
│ └── [ 566] readme.txt*
├── [ 0] boot.iso*
├── [ 64G] data.img*
├── [2.9G] HBCD_PE_x64.iso*
├── [ 18] windows.mac*
├── [ 4] windows.old
├── [3.5M] windows.rom*
├── [528K] windows.vars*
└── [ 5] windows.ver*
I've attempted the following compose.yml configuration, but it results in the Windows logo appearing without booting into WinPE:
services:
windows:
image: dockurr/windows
container_name: windows
environment:
VERSION: "win10"
BOOT_INDEX: "1"
devices:
- /dev/kvm
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 3389:3389/tcp
- 3389:3389/udp
stop_grace_period: 2m
restart: on-failure
volumes:
- ~/github/windows/storage/HBCD_PE_x64.iso:/storage/boot.iso
- ~/github/windows/storage:/storage
I do not understand so well how you ended up with these files in/storage. To start you have a boot.iso, but this project does nothing with a boot.iso (its from another project called qemu-docker but not used here). Secondly you have a file called windows.old which is only used when legacy booting Windows XP. So you have a very strange collection of files and I dont know what you did.
Also I do not know where you got this HBCD_PE_x64.iso so there is no way for me to try it myself.
First of all, thank you for the quick response for taking the time to resolve my question.
I've retried the entire procedure documented below and got the bootable .iso running.
However, I'm still not certain on how to properly map the installed partition, so it's visible in the bootable WinPE's diskmgmt.msc.
Clarification
Apologies for the confusion, I was indeed switching between qemu-docker and docker-windows.
-
HBCD_PE_x64.isorefers to Hiren's Boot CD, a bootable toolkit based onWinPE- Any bootable media can be substituted here.
-
boot.isocomes from an attempt to mapHBCD_PE_x64.isoas the boot drive incompose.ymlvolumes: - ~/github/windows/storage/HBCD_PE_x64.iso:/storage/boot.iso
Steps to Reproduce
-
Download
tiny11_2311_x64.isomanually -
Rename
tiny11_2311_x64.isotocustom.isoand place instorage/- Alternatively, map to location directly as suggested in the README.md (line 156)
-
Update
compose.yml:- Map
storage/ - Map
win11x64.xml(unattended install)volumes: - ~/github/dockur-windows/storage:/storage - ~/github/dockur-windows/assets/win11x64.xml:/run/assets/win11x64.xml
- Map
-
Remove the following from
compose.yml, sincesrc/install.sh:195seems to matchcustom.iso:environment: VERSION: "win11" -
Let installation complete after running:
docker-compose up -d -
Inspect via
localhost:8006and shut down after install with:docker-compose down- After installation, your
storage/should look like this (custom.isonow missing):[4.0K] ./ ├── [4.0K] shared/ │ └── [ 566] readme.txt ├── [ 64G] data.img ├── [ 0] windows.boot ├── [ 18] windows.mac ├── [3.5M] windows.rom ├── [528K] windows.vars └── [ 5] windows.ver
- After installation, your
In a comment on Issue #362 (Boot from ISO After Installation), you suggested setting
BOOT_INDEXenvironment variable to a value lower than 3.
-
Modify
compose.ymland rundocker-compose up -d:- Set
BOOT_INDEX - Attempt to map
HBCD_PE_x64.isotocustom.isoenvironment: BOOT_INDEX: "1" volumes: # Add (or place `HBCD_PE_x64.iso` as `custom.iso` in `storage/`): - ~/path/to/your/file/HBCD_PE_x64.iso:/storage/custom.iso # Keep: - ~/github/dockur-windows/storage:/storage # Remove: # - ~/github/dockur-windows/assets/win11x64.xml:/run/assets/win11x64.xml
- Set
-
Open
localhost:8006and rundiskmgmt.mscinside the bootable WinPE.iso, where only thevirtio-win-0.1.248shows up, not the drives created in previous installation.
I guess it is normal that the drive doesnt show up, because Windows PE do not have the drivers build-in to read/recognize the Virtio SCSI disks. Normally these drivers are installed during the automatic installation (via the unattended.xml file).
So you need a copy of the Hirens PE ISO that has VirtIO drivers, but I do not think such thing exists.
I dont understand why you need this PE ISO at all? You can just install normal Win11 via the normal way, and if you want to manipulate another disk image with it, you can just rename that disk image to data2.img and place it in /storage2 and it will be a secondary disk inside Windows.
I never used WinPE, but I cannot imagine it contains a tool that you cannot run under normal Windows. So why make everything so complicated?
@kroese Thanks, you're totally right! :)
Solution
- install
tiny11_2311_x64.isonormally - to manipulate another disk image with it:
-
rename installed disk (
data.img) image todata2.img -
place it in
/storage2 - boot normally
- resolve disk signature collision
-
rename installed disk (
Troubleshooting Offline Disk Due to Signature Collision
Summary
diskpart
list disk
select disk X
uniqueid disk
uniqueid disk id=xxxxxxxx-...
online disk
exit
-
Elevated Command Prompt (Run as Administrator):
-
diskpart(start the diskpart utility) -
list disk - Identify offline disk by its number (e.g., Disk 1).
-
select disk X(replace X with the offline disk number) -
uniqueid disk(display the disk's current unique identifier) -
Assign a new unique ID to the selected disk:
uniqueid disk id=xxxxxxxx(replace xxxxxxxx with a random 8-digit hexadecimal number, e.g.uniqueid disk id=1234abcd) -
online disk(bring the selected disk online) -
exit(exit the diskpart utility)
-
-
exitCommand Prompt and reopendiskmgmt.msc(Disk Management) - Action → Rescan Disks