-
Notifications
You must be signed in to change notification settings - Fork 1
/
ubuntu_18_04_virtualbox_ova.json
92 lines (92 loc) · 4.04 KB
/
ubuntu_18_04_virtualbox_ova.json
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
"variables": {
"ssh_name": "ubuntu",
"ssh_pass": "ubuntu",
"hostname": "ubuntu"
},
"builders": [
{
"type": "virtualbox-iso",
"guest_additions_mode": "disable",
"guest_os_type": "Ubuntu_64",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"1024"
]
],
"iso_url": "http://cdimage.ubuntu.com/releases/18.04.2/release/ubuntu-18.04.2-server-amd64.iso",
"iso_checksum": "a2cb36dc010d98ad9253ea5ad5a07fd6b409e3412c48f1860536970b073c98f5",
"iso_checksum_type": "sha256",
"output_directory": "ubuntu_18_04_virtualbox",
"shutdown_command": "echo '{{user `ssh_pass`}}'|sudo -S shutdown -P now",
"disk_size": 262144,
"format": "ova",
"headless": false,
"http_directory": "hosted",
"http_port_min": 10082,
"http_port_max": 10089,
"ssh_host_port_min": 2222,
"ssh_host_port_max": 2229,
"ssh_username": "{{user `ssh_name`}}",
"ssh_password": "{{user `ssh_pass`}}",
"ssh_port": 22,
"ssh_wait_timeout": "30m",
"vm_name": "ubuntu_18_04_ova",
"boot_wait": "10s",
"boot_command": [
"<esc><wait>",
"<esc><wait>",
"<enter><wait>",
"/install/vmlinuz<wait>",
" auto<wait>",
" console-setup/ask_detect=false<wait>",
" console-setup/layoutcode=us<wait>",
" console-setup/modelcode=pc105<wait>",
" debconf/frontend=noninteractive<wait>",
" debian-installer=en_US<wait>",
" fb=false<wait>",
" initrd=/install/initrd.gz<wait>",
" kbd-chooser/method=us<wait>",
" keyboard-configuration/layout=USA<wait>",
" keyboard-configuration/variant=USA<wait>",
" locale=en_US<wait>",
" netcfg/get_domain=vm<wait>",
" netcfg/get_hostname=vagrant<wait>",
" grub-installer/bootdev=/dev/sda<wait>",
" noapic<wait>",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/appenlight_preseed.cfg<wait>",
" -- net.ifnames=0 console=ttyS0,115200n8 <wait>",
"<enter><wait>"
]
}
],
"provisioners": [
{
"type": "file",
"source": "./hosted/ttyS0.conf",
"destination": "/tmp/ttyS0.conf"
},
{
"type": "shell",
"inline": [
"sleep 15",
"echo '{{user `ssh_pass`}}'|sudo -S echo 'uname -a'",
"echo '{{user `ssh_pass`}}'|sudo -S apt-get clean",
"echo '{{user `ssh_pass`}}'|sudo -S rm -rf '/var/lib/apt/lists/*'",
"echo '{{user `ssh_pass`}}'|sudo -S apt-get clean",
"echo '{{user `ssh_pass`}}'|sudo -S apt-get update",
"echo '{{user `ssh_pass`}}'|sudo -S apt-get -y upgrade ",
"echo '{{user `ssh_pass`}}'|sudo -S apt-get -y install python2.7 python acl python-pexpect python-setuptools python-pip-whl",
"echo '{{user `ssh_pass`}}'|sudo -S sed -i 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g' /etc/default/grub",
"echo '{{user `ssh_pass`}}'|sudo -S update-grub",
"echo '{{user `ssh_pass`}}'|sudo -S sed '/# The primary network /,$d' /etc/network/interfaces",
"echo '{{user `ssh_pass`}}'|sudo -S bash -c \"echo # The primary network interface' >> /etc/network/interfaces\"",
"echo '{{user `ssh_pass`}}'|sudo -S bash -c \"echo 'auto eth0' >> /etc/network/interfaces\"",
"echo '{{user `ssh_pass`}}'|sudo -S bash -c \"echo 'iface eth0 inet dhcp' >> /etc/network/interfaces\""
]
}
]
}