00 draft L-1

Clé USB multi-boot Ventoy (Proxmox + Win11 + Debian)

OS Cible
Progression 0% 0 / 14

Contexte

Construction d'une clé USB unique bootant N ISOs au choix (Proxmox VE, Windows 11 unattended, Debian 13). Étape zéro DR — remplace le flash mono-ISO.

Actions

14
  • Contexte 1 cmd
    $ Commandes
    $ USB 64 GB Ventoy ├── proxmox-ve_8.x.iso (hôte coruscant) ├── en-us_windows_11_business...iso (poste admin + autounattend) ├── debian-13.0-amd64-DVD-1.iso (templates VM Debian) ├── OPNsense-25.x-amd64.iso (firewall — phase later) ├── ventoy/ventoy.json (active autounattend Win11) └── autounattend.xml (réponses Setup Windows)
  • Récupérer le repo minfra-v2 1 cmd 1 verify
    $ Commandes
    PS> winget install --id Git.Git -e --source winget --silent git clone https://github.com/sminard38/minfra-v2.git D:\git\minfra-v2 cd D:\git\minfra-v2\infra\bare-metal\win11
    ✓ Vérifications
    Test-Path D:\git\minfra-v2\infra\bare-metal\win11\autounattend.xml
  • Télécharger Ventoy 1 cmd 1 verify
    $ Commandes
    PS> $dest = "$env:USERPROFILE\Downloads\ventoy.zip" $url = (Invoke-RestMethod https://api.github.com/repos/ventoy/Ventoy/releases/latest).assets | Where-Object name -like 'ventoy-*-windows.zip' | Select-Object -ExpandProperty browser_download_url Invoke-WebRequest $url -OutFile $dest Expand-Archive $dest -DestinationPath "$env:USERPROFILE\Downloads\Ventoy" -Force $Global:VentoyDir = (Get-ChildItem "$env:USERPROFILE\Downloads\Ventoy\ventoy-*" -Directory)[0].FullName Write-Host "Ventoy unzipped: $VentoyDir"
    ✓ Vérifications
    Test-Path "$VentoyDir\Ventoy2Disk.exe"
  • Télécharger les ISOs 2 cmd 1 verify
    $ Commandes
    PS> New-Item -ItemType Directory -Path D:\iso -Force | Out-Null # Proxmox VE — page officielle Start-Process "https://www.proxmox.com/en/downloads/proxmox-virtual-environment/iso" # Windows 11 — page officielle (Business Editions ou ISO grand public) Start-Process "https://www.microsoft.com/software-download/windows11" # Debian 13 — netinst (700 MB) ou DVD-1 (4.5 GB) Start-Process "https://www.debian.org/distrib/" # OPNsense (optionnel, phase later) # Start-Process "https://opnsense.org/download/"
    PS> Get-ChildItem D:\iso\ | Format-Table Name, @{N='GB';E={[math]::Round($_.Length/1GB,2)}}
    ✓ Vérifications
    (Get-ChildItem D:\iso\*.iso).Count -ge 2
  • Vérifier les checksums ISO 1 cmd 1 verify
    $ Commandes
    PS> Get-ChildItem D:\iso\*.iso | ForEach-Object { [pscustomobject]@{ Name = $_.Name SHA256 = (Get-FileHash $_.FullName -Algorithm SHA256).Hash } } | Format-List
    ✓ Vérifications
    (Get-FileHash D:\iso\proxmox-ve*.iso -Algorithm SHA256).Hash
  • Sélectionner + préparer la clé USB 1 cmd 1 verify
    $ Commandes
    PS> # PowerShell admin $d = @(Get-Disk | Where-Object { $_.BusType -eq 'USB' -or $_.MediaType -eq 'Removable Media' }) if (-not $d) { Write-Host "Aucun disque amovible. Brancher la cle." -ForegroundColor Red; return } $d | Format-Table Number, FriendlyName, @{N='GB';E={[math]::Round($_.Size/1GB,1)}}, BusType, PartitionStyle -AutoSize $t = if ($d.Count -eq 1) { $d[0] } else { $d | Where-Object Number -eq [int](Read-Host "Numero") } if (-not $t -or (Read-Host "Wipe $($t.Number) ($($t.FriendlyName)) ? Taper WIPE") -ne 'WIPE') { return } Set-Disk -Number $t.Number -IsReadOnly $false -ErrorAction SilentlyContinue Set-Disk -Number $t.Number -IsOffline $false -ErrorAction SilentlyContinue Clear-Disk -Number $t.Number -RemoveData -RemoveOEM -Confirm:$false $Global:DiskNumber = $t.Number Write-Host "Disque $($t.Number) pret pour Ventoy. `$DiskNumber = $($t.Number)" -ForegroundColor Green
    ✓ Vérifications
    (Get-Disk -Number $DiskNumber).IsReadOnly -eq $false
  • Installer Ventoy sur la clé USB 1 cmd 1 verify
    $ Commandes
    PS> # Install Ventoy en mode GPT/UEFI sur PHYSICALDRIVE$DiskNumber & "$VentoyDir\Ventoy2Disk.exe" VTOYCLI /I /Drive:PHYSICALDRIVE$DiskNumber /GPT # Attendre fin install (Ventoy2Disk fork un sous-process) Start-Sleep -Seconds 8 Get-Volume | Where-Object FileSystemLabel -eq 'Ventoy' | Format-Table DriveLetter, FileSystemLabel, SizeRemaining, Size
    ✓ Vérifications
    (Get-Volume | Where-Object FileSystemLabel -eq 'Ventoy').Count -eq 1
  • Copier les ISOs sur la clé 1 cmd 1 verify
    $ Commandes
    PS> $ventoy = (Get-Volume | Where-Object FileSystemLabel -eq 'Ventoy').DriveLetter Write-Host "Partition Ventoy: ${ventoy}:\" # Copie ISOs (peut prendre 5-15 min selon vitesse USB) Copy-Item D:\iso\proxmox-ve*.iso "${ventoy}:\" -Verbose Copy-Item D:\iso\*windows_11*.iso "${ventoy}:\" -Verbose Copy-Item D:\iso\debian-13*.iso "${ventoy}:\" -Verbose Get-ChildItem "${ventoy}:\*.iso" | Format-Table Name, @{N='GB';E={[math]::Round($_.Length/1GB,2)}}
    ✓ Vérifications
    (Get-ChildItem "$((Get-Volume | Where-Object FileSystemLabel -eq 'Ventoy').DriveLetter):\*.iso").Count -ge 2
  • Activer autounattend Win11 (plugin Ventoy) 1 cmd 2 verify
    $ Commandes
    PS> $ventoy = (Get-Volume | Where-Object FileSystemLabel -eq 'Ventoy').DriveLetter $winIso = (Get-ChildItem "${ventoy}:\*windows_11*.iso")[0].Name $cfg = @" { "control": [ { "VTOY_DEFAULT_MENU_MODE": "0" }, { "VTOY_MENU_TIMEOUT": "10" } ], "auto_install": [ { "image": "/$winIso", "template": "/autounattend.xml" } ] } "@ New-Item -ItemType Directory -Path "${ventoy}:\ventoy" -Force | Out-Null Set-Content -Path "${ventoy}:\ventoy\ventoy.json" -Value $cfg -Encoding utf8 Copy-Item D:\git\minfra-v2\infra\bare-metal\win11\autounattend.xml "${ventoy}:\autounattend.xml" -Force
    ✓ Vérifications
    Test-Path "$((Get-Volume | Where-Object FileSystemLabel -eq 'Ventoy').DriveLetter):\ventoy\ventoy.json"
    Test-Path "$((Get-Volume | Where-Object FileSystemLabel -eq 'Ventoy').DriveLetter):\autounattend.xml"
  • Valider config Ventoy (JSON) 1 cmd 1 verify
    $ Commandes
    PS> $ventoy = (Get-Volume | Where-Object FileSystemLabel -eq 'Ventoy').DriveLetter Get-Content "${ventoy}:\ventoy\ventoy.json" -Raw | ConvertFrom-Json | ConvertTo-Json -Depth 5 Write-Host "ventoy.json OK" -ForegroundColor Green
    ✓ Vérifications
    Get-Content "$((Get-Volume | Where-Object FileSystemLabel -eq 'Ventoy').DriveLetter):\ventoy\ventoy.json" -Raw | ConvertFrom-Json
  • Booter la clé Ventoy en UEFI 1 verify
    ✓ Vérifications
    machine cible affiche menu Ventoy GRUB avec >=2 ISOs listées
  • Maintenance — ajouter / retirer ISO 1 cmd 1 verify
    $ Commandes
    PS> $ventoy = (Get-Volume | Where-Object FileSystemLabel -eq 'Ventoy').DriveLetter # Ajouter une ISO Copy-Item D:\iso\ubuntu-24.04-server.iso "${ventoy}:\" # Retirer une ISO obsolete Remove-Item "${ventoy}:\debian-12*.iso" # Lister contenu Get-ChildItem "${ventoy}:\*.iso" | Sort-Object Name
    ✓ Vérifications
    (Get-ChildItem "$((Get-Volume | Where-Object FileSystemLabel -eq 'Ventoy').DriveLetter):\*.iso").Count -gt 0
  • Maintenance — mettre à jour Ventoy lui-même 1 cmd 1 verify
    $ Commandes
    PS> & "$VentoyDir\Ventoy2Disk.exe" VTOYCLI /U /Drive:PHYSICALDRIVE$DiskNumber
    ✓ Vérifications
    après update, ISOs toujours présentes
  • Sécurité — mot de passe initial Win11 2 cmd
    $ Commandes
    PS> $newPw = bw get password "win-sacha-$(hostname)" Set-LocalUser -Name sacha -Password (ConvertTo-SecureString $newPw -AsPlainText -Force)
    PS> $ventoy = (Get-Volume | Where-Object FileSystemLabel -eq 'Ventoy').DriveLetter Remove-Item "${ventoy}:\autounattend.xml" -Force Remove-Item "${ventoy}:\ventoy\ventoy.json" -Force