Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Powershell script that creates tinycore linux vm with virtualbox
$PSDefaultParameterValues += @{'New-RegKey:ErrorAction' = 'Stop'}
$name = "softplan-javavm"
$repo = ""
$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 - | sh`n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment