Commit 837369d4 authored by Stefan Scherer's avatar Stefan Scherer

Nested hypervisor, use bootcommand as workaround for product key popup

parent bfa6a11f
......@@ -66,7 +66,7 @@
<!-- Do not uncomment the Key element if you are using trial ISOs -->
<!-- You must uncomment the Key element (and optionally insert your own key) if you are using retail or volume license ISOs -->
<!--<Key>D2N9P-3P6X9-2R39C-7RTCD-MDVJX</Key>-->
<WillShowUI>OnError</WillShowUI>
<WillShowUI>Never</WillShowUI>
</ProductKey>
<AcceptEula>true</AcceptEula>
<FullName>Vagrant</FullName>
......
powershell.exe -Command "Install-WindowsFeature -Name Containers"
powershell.exe -Command "Install-WindowsFeature -Name Hyper-V"
shutdown /r /t 5 /f /d p:4:1 /c "Reboot for Containters"
net stop winrm
......
rem https://msdn.microsoft.com/virtualization/windowscontainers/quick_start/inplace_setup
powershell.exe -Command "wget -uri http://aka.ms/setupcontainers -OutFile C:\ContainerSetup.ps1"
powershell.exe -Command "wget -uri https://aka.ms/tp4/Install-ContainerHost -OutFile C:\Install-ContainerHost-1.ps1"
set WIMPATH=http://192.168.254.1:8000/ContainerOSImage.wim
set LOCALWIMPATH=C:\Users\vagrant\ContainerOSImage.wim
rem patch the install script, see https://github.com/Microsoft/Virtualization-Documentation/pull/90
powershell.exe -Command "cat C:\Install-ContainerHost-1.ps1 | %%{$_ -replace 'qfe =','qfe = 0 #'} | Set-Content C:\Install-ContainerHost.ps1"
if "%WIMPATH%x"=="x" (
powershell.exe -File "C:\ContainerSetup.ps1"
) else (
powershell.exe -Command "wget -uri %WIMPATH% -OutFile %LOCALWIMPATH%"
)
:waiting
if not exist %LOCALWIMPATH% (
echo Waiting for WimPath %LOCALWIMPATH%
ping 127.0.0.1 -n 5 > nul
goto waiting
)
if exist %LOCALWIMPATH% (
powershell.exe -File "C:\ContainerSetup.ps1" -WimPath %LOCALWIMPATH%
del %LOCALWIMPATH%
) else (
powershell.exe -File "C:\ContainerSetup.ps1"
)
)
powershell.exe -File "C:\Install-ContainerHost.ps1" -HyperV
echo Done with %0
......
echo Sleeping for another minute
ping -n 60 127.0.0.1 >nul: 2>nul:
echo Sleeping until internet is available
@setlocal enableextensions enabledelayedexpansion
@echo off
set ipaddr=8.8.8.8
:loop
set state=down
for /f "tokens=5,7" %%a in ('ping -n 1 !ipaddr!') do (
if "x%%a"=="xReceived" if "x%%b"=="x1," set state=up
)
echo.Link is !state!
ping -n 5 127.0.0.1 >nul: 2>nul:
if "%state%"=="down" goto :loop
endlocal
......@@ -6,7 +6,8 @@
"iso_checksum_type": "md5",
"iso_checksum": "935ba77651210bd1bd71a114c92b0caa",
"headless": false,
"boot_wait": "2m",
"boot_wait": "6m",
"boot_command": [ "<tab><enter>" ],
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "6h",
......@@ -27,7 +28,9 @@
"RemoteDisplay.vnc.port": "5900",
"memsize": "2048",
"numvcpus": "2",
"scsi0.virtualDev": "lsisas1068"
"scsi0.virtualDev": "lsisas1068",
"vhv.enable": "TRUE",
"hypervisor.cpuid.v0": "FALSE"
}
},
{
......@@ -76,6 +79,8 @@
"./scripts/vagrant-ssh.bat",
"./scripts/enable-rdp.bat",
"./scripts/install-containers.bat",
"./scripts/wait-for-uplink.bat",
"./scripts/install-docker.bat",
"./scripts/install-docker.bat",
"./scripts/uac-enable.bat"
]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment