Skip to content

Instantly share code, notes, and snippets.

@ril3y
Last active August 4, 2025 21:24
Show Gist options
  • Save ril3y/d681411b568dec071236cdb7884ab969 to your computer and use it in GitHub Desktop.
Save ril3y/d681411b568dec071236cdb7884ab969 to your computer and use it in GitHub Desktop.
Remove the MSA requirements from windows11 iso installer

Remove Microsoft Account Requirement from Windows 11 ISO

This script allows you to modify a Windows 11 ISO to bypass the Microsoft Account / cloud login requirement, enabling offline account setup. It works on Kali Linux, Ubuntu, and other Debian-based distributions.


Features

  • Checks and installs required dependencies (xorriso, genisoimage, coreutils, util-linux)
  • Checks available disk space before extracting the ISO (~10 GB required)
  • Injects ei.cfg and oobe.bypassnro to allow local/offline account creation
  • Builds a new bootable ISO
  • Generates SHA256 and SHA1 hashes for verification
  • Cleans up temporary files automatically

Usage

chmod +x remove_msa_from_win11.sh
./remove_msa_from_win11.sh Windows.iso --temp /large/storage/path

Arguments

  • <Windows.iso> – Path to your original Windows 11 ISO
  • --temp /path – Optional: Use a directory with at least 10 GB free space

Example Run

┌──(kali㉿kali)-[~/Desktop]
└─$ ./remove_msa_from_win11.sh Windows.iso --temp .

[*] Mounting ISO...
mount: /home/kali/Desktop/win11mod/mnt: WARNING: source write-protected, mounted read-only.
[*] Copying ISO contents...
[*] Unmounting ISO...
[*] Adding ei.cfg and oobe.bypassnro...
[*] Building new ISO: Windows_NoMSA.iso
xorriso 1.5.6 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:Windows_NoMSA.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 17.7g free
Added to ISO image: directory '/'='/home/kali/Desktop/win11mod/extract'
xorriso : UPDATE :     994 files added in 1 seconds
xorriso : UPDATE :  0.39% done
xorriso : UPDATE :  84.20% done
xorriso : UPDATE :  99.02% done
ISO image produced: 2387503 sectors
Written to medium : 2387503 sectors at LBA 0
Writing to 'stdio:Windows_NoMSA.iso' completed successfully.

[*] Generating SHA256 and SHA1 hashes...
45a143157adc60db2cad7ed583128d0410726cffe0555b8b4f8d100693c67be7  Windows_NoMSA.iso
490419b1c5803da00e839f2daa02c1a7bc8e6744  Windows_NoMSA.iso
[*] Cleaning up temporary files...
[+] Done!
[+] Output ISO: Windows_NoMSA.iso
[+] SHA256: 45a143157adc60db2cad7ed583128d0410726cffe0555b8b4f8d100693c67be7

Verification

To verify the new ISO after transfer:

sha256sum Windows_NoMSA.iso

Expected SHA256:

45a143157adc60db2cad7ed583128d0410726cffe0555b8b4f8d100693c67be7

Next Steps

  1. Attach the new ISO to your VM (TrueNAS, VirtualBox, Proxmox, etc.)
  2. Boot and proceed with the installer
  3. You will now see “I don’t have Internet” and can create a local account
#!/bin/bash
# Remove Microsoft Account requirement from Windows 11 ISO
# Kali / Ubuntu compatible
# Author: ril3y
set -e
REQUIRED_SPACE_MB=10240 # ~10GB required
WORKDIR="/tmp/win11mod"
usage() {
echo "Usage: $0 <windows11.iso> [--temp /large/path]"
exit 1
}
if [ $# -lt 1 ]; then
usage
fi
ISO="$1"
shift
while [ $# -gt 0 ]; do
case "$1" in
--temp)
shift
WORKDIR="$1/win11mod"
;;
*)
usage
;;
esac
shift
done
# --- Validate input ISO ---
if [ ! -f "$ISO" ]; then
echo "[-] ISO not found: $ISO"
exit 1
fi
# --- Detect package manager and install tools ---
if command -v apt >/dev/null 2>&1; then
PKG_INSTALL="sudo apt install -y"
else
echo "[-] Unsupported distro. Please install xorriso/genisoimage manually."
exit 1
fi
NEEDED_CMDS=("mount" "umount" "df" "cp" "xorriso" "mkisofs" "sha256sum" "sha1sum")
MISSING_CMDS=()
for cmd in "${NEEDED_CMDS[@]}"; do
if ! command -v "$cmd" >/dev/null 2>&1; then
MISSING_CMDS+=("$cmd")
fi
done
if [ ${#MISSING_CMDS[@]} -gt 0 ]; then
echo "[*] Installing missing packages: ${MISSING_CMDS[*]}"
$PKG_INSTALL xorriso genisoimage coreutils util-linux
fi
# --- Check free space ---
WORKPARENT=$(dirname "$WORKDIR")
mkdir -p "$WORKPARENT"
FREE_MB=$(df -Pm "$WORKPARENT" | awk 'NR==2 {print $4}')
if [ "$FREE_MB" -lt "$REQUIRED_SPACE_MB" ]; then
echo "[-] Not enough space in $WORKPARENT ($FREE_MB MB free, need ~${REQUIRED_SPACE_MB} MB)"
echo " Re-run with: $0 \"$ISO\" --temp /path/to/big/dir"
exit 1
fi
# --- Prepare work dirs ---
MOUNTDIR="$WORKDIR/mnt"
EXTRACTDIR="$WORKDIR/extract"
sudo umount "$MOUNTDIR" 2>/dev/null || true
rm -rf "$WORKDIR"
mkdir -p "$MOUNTDIR" "$EXTRACTDIR"
# --- Mount ISO ---
echo "[*] Mounting ISO..."
sudo mount -o loop "$ISO" "$MOUNTDIR"
echo "[*] Copying ISO contents..."
cp -rT "$MOUNTDIR" "$EXTRACTDIR"
echo "[*] Unmounting ISO..."
sudo umount "$MOUNTDIR"
# --- Inject bypass files ---
echo "[*] Adding ei.cfg and oobe.bypassnro..."
mkdir -p "$EXTRACTDIR/sources"
sudo tee "$EXTRACTDIR/sources/ei.cfg" >/dev/null <<'EOF'
[Channel]
_Default
[VL]
0
EOF
sudo touch "$EXTRACTDIR/sources/oobe.bypassnro"
# --- Build new ISO ---
OUTPUT_ISO="$(basename "$ISO" .iso)_NoMSA.iso"
echo "[*] Building new ISO: $OUTPUT_ISO"
if command -v xorriso >/dev/null 2>&1; then
xorriso -as mkisofs -iso-level 3 \
-full-iso9660-filenames \
-volid "WIN11_NO_MSA" \
-eltorito-boot boot/etfsboot.com \
-no-emul-boot -boot-load-size 8 -boot-info-table \
-eltorito-alt-boot \
-e efi/microsoft/boot/efisys.bin \
-no-emul-boot \
-o "$OUTPUT_ISO" "$EXTRACTDIR"
else
mkisofs -U -b boot/etfsboot.com \
-no-emul-boot -boot-load-size 8 -boot-info-table \
-eltorito-alt-boot -eltorito-platform efi \
-b efi/microsoft/boot/efisys.bin -no-emul-boot \
-o "$OUTPUT_ISO" "$EXTRACTDIR"
fi
# --- Hash the output ISO ---
echo "[*] Generating SHA256 and SHA1 hashes..."
sha256sum "$OUTPUT_ISO" | tee "$OUTPUT_ISO.sha256"
sha1sum "$OUTPUT_ISO" | tee "$OUTPUT_ISO.sha1"
# --- Cleanup ---
echo "[*] Cleaning up temporary files..."
if mountpoint -q "$MOUNTDIR"; then
echo "[*] Unmounting work mount..."
sudo umount "$MOUNTDIR" || true
fi
sudo rm -rf "$WORKDIR"
echo "[+] Done!"
echo "[+] Output ISO: $OUTPUT_ISO"
echo "[+] SHA256: $(cut -d ' ' -f1 "$OUTPUT_ISO.sha256")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment