Commit 43adc833 authored by karthickraja kamaraj's avatar karthickraja kamaraj 😃

Creating new virtual instance on cli

parent 26b00629
#### VirtualBox Guest Creation from VMDK.
# * Installing the downloaded the extension pack into the virtualbox.
# `VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.36-105129a.vbox-extpack`
# * Decide the configuration for the guest.
# - Guest-Virtual-instance name.
# Memory
# partition name
# - partition no
#* Execute the below commands after setting up variables.
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.36-105129a.vbox-extpack
VBoxManage createvm --name $instance_name --register
VBoxManage modifyvm $instance_name --memory $ram_size --acpi on --boot1 disk
VBoxManage modifyvm $instance_name --ostype Debian
VBoxManage storagectl $instance_name --name "IDE Controller" --add ide
cd $HOME/VirtualBox\ Vms/$instance_name/
VBoxManage internalcommands createrawvmdk -filename $instance_name.vmdk -rawdisk $partition_name -partitions $partition_no -relative
VBoxManage storageattach $instance_name --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium ./$instance_name.vmdk
vboxmanage hostonlyif create
vboxmanage hostonlyif ipconfig vboxnet0 --ip
VBoxManage modifyvm $instance_name --nic1 nat
vboxmanage modifyvm $instance_name --nic2 hostonly --hostonlyadapter2 vboxnet0
echo "Instance $instance_name created successfully."
echo "Opening the instance in "
nohup VBoxHeadless --startvm $instance_name --vrde on &
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment