Created
January 21, 2016 01:47
-
-
Save andrealbinop/44aa03dc446435902a80 to your computer and use it in GitHub Desktop.
Powershell script that creates tinycore linux vm with virtualbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$PSDefaultParameterValues += @{'New-RegKey:ErrorAction' = 'Stop'} | |
$name = "softplan-javavm" | |
$repo = "http://tinycorelinux.net/6.x/x86/release" | |
$tinyCoreIso = "TinyCore-current.iso" | |
Write-Host "`n1. Criando maquina virtual`n" | |
VBoxManage createvm --name $name --register --basefolder . | |
VBoxManage modifyvm $name --ostype Linux --clipboard hosttoguest --nic1 nat --vram 16 --memory 1024 --acpi on --boot1 dvd | |
Write-Host "`n2. Criando HD com com 10gb de capacidade`n" | |
VBoxManage createmedium disk --filename "$name.vdi" --size 10240 | |
VBoxManage storagectl $name --name "IDE Controller" --add ide | |
VBoxManage storageattach $name --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium "$name.vdi" | |
Write-Host "`n3. Configurando imagem do linux utilizada: $tinyCoreIso" | |
if(-Not (Test-Path -Path $tinyCoreIso)) { | |
Invoke-WebRequest "$repo/$tinyCoreIso" -OutFile $tinyCoreIso | |
} | |
VBoxManage storageattach $name --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium $tinyCoreIso | |
Write-Host "`n4. Inicializando maquina virtual`n" | |
VBoxManage startvm $name --type gui | |
Write-Host "`n5. Criação completa. Após inicialização, abrir o terminal e executar:`tce-load -wi openssl.tcz && wget -O - https://gist.github.com/andreptb/30bc0c9300d188833b3c/raw | sh`n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment