setup_wsl.ps1 2.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ident "@(#)$Format:Food:setup_wsl.ps1:Francois Lange:lanfr144@school.lu:2026/06/14 19:15:22:Francois Lange:lanfr144@school.lu:2026/06/14 19:15:22:980a319e59134ca6511a42ecad9297::$""
  2. # ==============================================================================
  3. # Local Food AI - Windows WSL Setup Script
  4. # Run in Administrator PowerShell on the Windows Host
  5. # ==============================================================================
  6. Write-Host "==========================================================" -ForegroundColor Blue
  7. Write-Host " Starting Windows WSL Setup for Local Food AI..."
  8. Write-Host "==========================================================" -ForegroundColor Blue
  9. # 1. Enable Windows Subsystem for Linux (WSL) and Virtual Machine Platform
  10. Write-Host "`n[1/4] Enabling WSL and Virtual Machine Platform features..." -ForegroundColor Yellow
  11. dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  12. dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  13. # 2. Update WSL kernel
  14. Write-Host "`n[2/4] Updating WSL kernel to the latest version..." -ForegroundColor Yellow
  15. wsl --update
  16. # 3. Install Ubuntu 22.04 LTS with instance name Dopro1
  17. Write-Host "`n[3/4] Installing Ubuntu-22.04 LTS instance named 'Dopro1'..." -ForegroundColor Yellow
  18. Write-Host "This will spawn a terminal window to configure your Unix username & password." -ForegroundColor Cyan
  19. Write-Host "Please set the username to 'lanfr144' when prompted!" -ForegroundColor Cyan
  20. wsl --install -d Ubuntu-22.04 --name Dopro1
  21. # 4. Networking and DNS Configuration instructions
  22. Write-Host "`n[4/4] Installation initiated successfully!" -ForegroundColor Green
  23. Write-Host "----------------------------------------------------------"
  24. Write-Host "POST-INSTALLATION DIRECTIVES:"
  25. Write-Host "1. In the newly opened WSL terminal, complete the Unix account creation."
  26. Write-Host "2. Once logged into WSL, run the following to navigate to your home directory:"
  27. Write-Host " cd ~"
  28. Write-Host "3. Execute the setup_app.sh script inside WSL to configure Docker and launch the project."
  29. Write-Host "----------------------------------------------------------"
  30. Write-Host "==========================================================" -ForegroundColor Blue