forked from ilude/WindowsPowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVirtualBox-Utils.psm1
More file actions
28 lines (15 loc) · 939 Bytes
/
VirtualBox-Utils.psm1
File metadata and controls
28 lines (15 loc) · 939 Bytes
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
function Create-VM ([Parameter(Mandatory = $True)][string]$name) {
VBoxManage createvm --name "$name" --register --ostype "Ubuntu_64"
VBoxManage clonehd ".\Ubuntu 11.04\Ubuntu 11.04.vdi" ".\$name\$name.vdi"
#VBoxManage modifyvm "$name" --memory 512 --nic1 bridged --nictype1 virtio
#VBoxManage modifyvm "$name" --bridgeadapter1 "Atheros AR5B97 Wireless Network Adapter"
VBoxManage modifyvm "$name" --memory 512
VBoxManage storagectl "$name" --name "SATA Controller" --add sata
VBoxManage storageattach "$name" --storagectl "SATA Controller" --port 0 --type hdd --medium ".\$name\$name.vdi"
VBoxManage modifyvm "$name" --nic1 nat --nictype1 82540EM
VBoxManage modifyvm "$name" --natpf1 "SSH Proxy,tcp,,2222,,22"
VBoxManage modifyvm "$name" --nic2 hostonly --nictype2 82540EM
# VBoxManage list hostonlyifs
VBoxManage modifyvm "$name" --hostonlyadapter2 "VirtualBox Host-Only Ethernet Adapter"
}
Export-ModuleMember