OLD | NEW |
(Empty) | |
| 1 # const |
| 2 VMS="$HOME/VirtualBox VMs" |
| 3 DISK2="box-disk2.vdi" |
| 4 DISK2_SIZE_GB=8 |
| 5 |
| 6 # find paths |
| 7 VM=`ls "$VMS" | grep libadblockplus-android-ci-vm` |
| 8 VM_PATH="$VMS/$VM" |
| 9 echo "Found VM in $VM_PATH" |
| 10 |
| 11 DISK2_PATH="$VM_PATH/$DISK2" |
| 12 if [ -f "$DISK2_PATH" ] |
| 13 then |
| 14 echo "Disk already added, exiting" |
| 15 exit 0 |
| 16 fi |
| 17 |
| 18 # stop VM |
| 19 echo "Stopping VM..." |
| 20 vagrant halt |
| 21 |
| 22 # create disk 2 |
| 23 echo "Creating $DISK2 ..." |
| 24 DISK2_SIZE_MB=$(( $DISK2_SIZE_GB * 1024 )) |
| 25 |
| 26 VBoxManage createhd --filename "$DISK2_PATH" --size "$DISK2_SIZE_MB" || exit 1; |
| 27 echo "Done" |
| 28 |
| 29 # attach disk 2 to VN |
| 30 echo "Attaching disk 2..." |
| 31 VBoxManage storageattach "$VM" --storagectl "SATA Controller" --port 1 --device
0 --type hdd --medium "$DISK2_PATH" || exit 1; |
| 32 echo "Done" |
| 33 |
| 34 # vboxmanage list hdds |
| 35 # vboxmanage closemedium disk <uuid> --delete |
| 36 |
| 37 # start VM and mount disk 2 |
| 38 echo "Starting VM..." |
| 39 vagrant up |
| 40 |
| 41 echo "Adding partition..." |
| 42 vagrant ssh -- /vagrant/vagrant-mount-disk.sh |
| 43 |
| 44 echo "Done" |
OLD | NEW |