Skip to content

Instantly share code, notes, and snippets.

@theRemix
Last active September 8, 2017 06:37
Show Gist options
  • Save theRemix/563883817a4c0236d3d5618ac7b39abc to your computer and use it in GitHub Desktop.
Save theRemix/563883817a4c0236d3d5618ac7b39abc to your computer and use it in GitHub Desktop.
VBox Scripts
#!/bin/sh
# VRDE PORT 3891
## MANUAL WAY, USE IMPORT INSTEAD
#VBoxManage createvm --name "CentOS1" --register
#VBoxManage modifyvm "CentOS1" --memory 512 --acpi on --nic1 bridged --bridgeadapter1 virbr0
#VBoxManage createhd --filename ~/vms/hdds/CentOS1.vhd --size 20000
#VBoxManage storagectl "CentOS1" --name "IDE Controller" --add ide
#VBoxManage storageattach "CentOS1" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium ~/vms/hdds/CentOS1.vhd
#VBoxManage modifyvm "CentOS1" --vrde on
#VBoxManage modifyvm "CentOS1" --vrdeport 3891
## DO NOT NEED TO CREATE THE DISK FIRST
# VBoxManage createhd --filename ~/vms/hdds/CentOS1.vhd --size 20000
# FOR DRY RUN VBoxManage import --dry-run ~/vms/images/CentOS-6.6-x86_64-minimal.ova
VBoxManage import ~/vms/images/CentOS-6.6-x86_64-minimal.ova \
--vsys 0 \
--vmname "CentOS1" \
--memory 512 \
--unit 10 \
--disk ~/vms/hdds/CentOS1.vhd
VBoxManage modifyvm "CentOS1" --acpi on --nic1 bridged --bridgeadapter1 virbr0
VBoxManage modifyvm "CentOS1" --vrde on
VBoxManage modifyvm "CentOS1" --vrdeport 3891
#!/bin/sh
VBOX_NAME=Xenial1
VBOX_PORT=3892
VBoxManage createvm --name "$VBOX_NAME" --register
VBoxManage modifyvm "$VBOX_NAME" --memory 512 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 wlo1
VBoxManage createhd --filename ~/vms/$VBOX_NAME.vhd --size 5000
VBoxManage storagectl "$VBOX_NAME" --name "IDE Controller" --add ide
VBoxManage storageattach "$VBOX_NAME" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium ~/vms/$VBOX_NAME.vhd
VBoxManage storageattach "$VBOX_NAME" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium ~/vms/images/debian-9.1.0-amd64-netinst.iso
VBoxManage modifyvm "$VBOX_NAME" --vrde on
VBoxManage modifyvm "$VBOX_NAME" --vrdeport $VBOX_PORT
#!/bin/sh
VBoxManage createvm --name "WinServer" --register
VBoxManage modifyvm "WinServer" --memory 2048 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 virbr0
VBoxManage createhd --filename ~/vms/hdds/WinServer.vhd --size 20000
VBoxManage storagectl "WinServer" --name "IDE Controller" --add ide
VBoxManage storageattach "WinServer" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium ~/vms/hdds/WinServer.vhd
VBoxManage storageattach "WinServer" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium ~/vms/images/14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.ISO
VBoxManage modifyvm "WinServer" --vrde on
# Windows requires Intel PRO/1000 MT virtual network interface device
VBoxManage modifyvm "WinServer" --nictype1 82545EM
# make sure dvd is first in boot order
VBoxManage modifyvm WinServer --boot1 dvd
# set io apic and chipset
VBoxManage modifyvm "WinServer" --ioapic on
VBoxManage modifyvm "WinServer" --chipset ich9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment