Browse code

Added the ability to create and attach a 2nd virtual hard disk.

Apollia authored on12/28/2018 17:36:59
Showing5 changed files
... ...
@@ -4,4 +4,5 @@
4 4
 Minimal Ramize-Physave/
5 5
 lupu_devx_528-4.sfs
6 6
 DevX.iso
7
-VirtualBox_Guest_Setup_Scripts.iso
8 7
\ No newline at end of file
8
+VirtualBox_Guest_Setup_Scripts.iso
9
+Private/
9 10
\ No newline at end of file
10 11
new file mode 100644
... ...
@@ -0,0 +1,61 @@
1
+#!/bin/bash
2
+
3
+readonly Script_Title="Create VM - 2 HD LH64_602_B2 - 4 GiB RAM, 8 optical drives, no internet, bidir clipboard"
4
+
5
+readonly Fillepath____This_Script=$(realpath "${BASH_SOURCE[0]}")
6
+	readonly Follpath____This_Script=$(dirname "$Fillepath____This_Script" )
7
+
8
+		readonly Follpath____Helpers=$(readlink -m "$Follpath____This_Script/../../Helpers")
9
+			readonly Fillepath____Create_VMs="$Follpath____Helpers/Create VMs"
10
+		
11
+		readonly Follpath____Package_Libraries=$(readlink -m "$Follpath____This_Script/../../../Package Libraries")
12
+		readonly Follpath____Package_Config=$(readlink -m "$Follpath____This_Script/../../../0000-Config")
13
+
14
+
15
+cd "$Follpath____Package_Libraries"
16
+
17
+source "Console and Dialog Box Messaging"
18
+source "Requiring"
19
+
20
+
21
+VM="2 HD LH64_602_B2 - 4 GiB RAM"
22
+#OS="Linux_32"
23
+OS="Linux_64"
24
+
25
+RAM=4096
26
+VRAM=128
27
+
28
+nic1="none"
29
+
30
+
31
+storage_controller_name="SATA_Controller"
32
+storage_controller_type="sata"
33
+
34
+quantity_of_optical_disc_drives_beyond_required_1st_four=4
35
+
36
+
37
+Platz="Virtual Hard Disk File for VirtualBox"
38
+
39
+hard_disk_for_1st_storage_controller="$(platz "$Platz" )"
40
+	result_code="$?"; [ "$result_code" != 0 ] && { echo "Can't proceed, missing platz: $Platz"; exit 2; }
41
+
42
+
43
+Platz="2nd Virtual Hard Disk File for VirtualBox"
44
+
45
+second_hard_disk_for_1st_storage_controller="$(platz "$Platz" )"
46
+	result_code="$?"; [ "$result_code" != 0 ] && { echo "Can't proceed, missing platz: $Platz"; exit 2; }
47
+	
48
+	
49
+
50
+clipboard="bidirectional"
51
+audio="alsa"
52
+
53
+Follpath____ISOs="/root/apbin/ISOs/For VirtualBox"
54
+
55
+Fillepath____Puppy_ISO="$Follpath____ISOs/Lighthouse64-6.02-B2-UserSpecRamDisk.iso"
56
+Fillepath____DevX="$Follpath____ISOs/Devx-L64_602.sfs.iso"
57
+Fillepath____Guest_Additions="$Follpath____ISOs/VBoxGuestAdditions.iso"
58
+Fillepath____Guest_Setup_Scripts="$Follpath____ISOs/APSK_VirtualBox_Guest_Setup_Scripts.iso"
59
+
60
+
61
+source "$Fillepath____Create_VMs"
0 62
\ No newline at end of file
... ...
@@ -317,6 +317,13 @@ if [ ! -z "$hard_disk_for_1st_storage_controller" ]
317 317
 then
318 318
 	let "current_portnum++"
319 319
 	VBoxManage storageattach "$VM" --storagectl "$storage_controller_name" --type hdd --medium "$hard_disk_for_1st_storage_controller" --port "$current_portnum"
320
+	
321
+	if [ ! -z "$second_hard_disk_for_1st_storage_controller" ]
322
+	then
323
+		let "current_portnum++"
324
+		VBoxManage storageattach "$VM" --storagectl "$storage_controller_name" --type hdd --medium "$second_hard_disk_for_1st_storage_controller" --port "$current_portnum"
325
+		
326
+	fi
320 327
 fi
321 328
 
322 329
 	
323 330
new file mode 100644
... ...
@@ -0,0 +1,21 @@
1
+#!/bin/bash
2
+
3
+readonly Script_Title="Create example 5 MB virtual hard disk"
4
+
5
+
6
+readonly Fillepath____This_Script=$(realpath "${BASH_SOURCE[0]}")
7
+	readonly Follpath____This_Script=$(dirname "$Fillepath____This_Script" )
8
+
9
+
10
+Follpath____Tmp_Diskhome="/tmp/APSK/VirtualBox Guest Setup Scripts Workspace/Example Virtual Hard Disks"
11
+
12
+
13
+mkdir --parents "$Follpath____Tmp_Diskhome"
14
+
15
+cd "$Follpath____Tmp_Diskhome"
16
+
17
+
18
+VBoxManage createhd --filename "2nd-Example-5-MB-Virtual-Hard-Disk.vdi" --size 5 --variant fixed
19
+
20
+
21
+rox "$Follpath____Tmp_Diskhome"
0 22
\ No newline at end of file
1 23
new file mode 100644
... ...
@@ -0,0 +1,10 @@
1
+#!/bin/bash
2
+
3
+readonly Script_Title="Set platz for virtual hard disk file for any new VM"
4
+
5
+
6
+readonly Fillepath____This_Script=$(realpath "${BASH_SOURCE[0]}")
7
+	readonly Follpath____This_Script=$(dirname "$Fillepath____This_Script" )
8
+
9
+
10
+noteplatz '2nd Virtual Hard Disk File for VirtualBox' '/tmp/APSK/VirtualBox Guest Setup Scripts Workspace/Example Virtual Hard Disks/2nd-Example-5-MB-Virtual-Hard-Disk.vdi'