-
Notifications
You must be signed in to change notification settings - Fork 106
/
run-sandbox.ps1
30 lines (25 loc) · 1.05 KB
/
run-sandbox.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
param ($vcodec)
$template = @'
<Configuration>
<vGPU>Enable</vGPU>
<Networking>Default</Networking>
<MappedFolders>
<MappedFolder>
<HostFolder>{2}</HostFolder>
<SandboxFolder>C:\Users\cloud-morph</SandboxFolder>
</MappedFolder>
</MappedFolders>
<LogonCommand>
<Command>C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Bypass -F C:\Users\cloud-morph\run-app.ps1 {0} {1} sandbox {3} -vcodec {4}</Command>
</LogonCommand>
</Configuration>
'@
# To install Virtual Box Image. Copy FFMPEG to VM
# Create Sandbox Config
$localEthernetIP = (Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias ethernet).IPAddress
# pass variables in orders to template
$template -f $args[0], $args[1], "$PWD", $localEthernetIP, $vcodec | Out-File -FilePath .\run-sandbox.wsb
# x86_64-w64-mingw32-g++ $PSScriptRoot\winvm\syncinput.cpp -o $PSScriptRoot\winvm\syncinput.exe -lws2_32 -lpthread -static
powershell -ExecutionPolicy Bypass -F "setup-sandbox.ps1"
# Run Sandbox
.\run-sandbox.wsb