forked from 2creatives/vagrant-centos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup
executable file
·59 lines (49 loc) · 1.89 KB
/
setup
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh -e
. ./vars.sh
VBoxManage createvm --name ${NAME} --ostype ${TYPE} --register
VBoxManage modifyvm ${NAME} \
--vram 12 \
--accelerate3d off \
--memory 613 \
--usb off \
--audio none \
--boot1 disk --boot2 dvd --boot3 none --boot4 none \
--nictype1 virtio --nic1 nat --natnet1 "${NATNET}" \
--nictype2 virtio \
--nictype3 virtio \
--nictype4 virtio \
--acpi on --ioapic off \
--chipset piix3 \
--rtcuseutc on \
--hpet on \
--bioslogofadein off \
--bioslogofadeout off \
--bioslogodisplaytime 0 \
--biosbootmenu disabled
VBoxManage createhd --filename "${HDD}" --size 8192
# Swap is recommended to be double the size of RAM.
VBoxManage createhd --filename "${HDD_SWAP}" --size 1226
VBoxManage storagectl ${NAME} \
--name SATA --add sata --portcount 2 --bootable on
VBoxManage storageattach ${NAME} \
--storagectl SATA --port 0 --type hdd --medium "${HDD}"
VBoxManage storageattach ${NAME} \
--storagectl SATA --port 1 --type hdd --medium "${HDD_SWAP}"
VBoxManage storageattach ${NAME} \
--storagectl SATA --port 2 --type dvddrive --medium "${INSTALLER}"
VBoxManage storageattach ${NAME} \
--storagectl SATA --port 3 --type dvddrive --medium "${GUESTADDITIONS}"
VBoxManage startvm ${NAME} --type gui
# This only really caters for the common case. If you have problems, please
# discover your host's IP address and adjust accordingly.
IP=`echo ${NATNET} | sed -nE 's/^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*/\1/p'`
echo 'At the boot prompt, hit <TAB> and then type:'
echo " ks=http://${IP}.3:8081"
sh ./httpd.sh | nc -l 8081 >/dev/null
echo "The box has accepted the kickstart file. It will now go through"
echo "a lengthy install. When it is finished it will shutdown and you"
echo "can run:"
echo
echo " ./cleanup && vagrant package --base ${NAME} --output boxes/${NAME}-`date +%Y%m%d`.box"
echo
echo "to create a Vagrant box."