-
Notifications
You must be signed in to change notification settings - Fork 0
/
vmbuildubuntu.sh
50 lines (43 loc) · 994 Bytes
/
vmbuildubuntu.sh
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
#!/bin/bash
# choose mirror size
MIRROR="http://us.archive.ubuntu.com/ubuntu"
#MIRROR="http://trane/ubuntu"
# choose sute (precise=12.04)
SUITE=saucy
# choose architecture
ARCH="amd64"
#ARCH="i386"
VMNAME="node5"
MYOCTET=5
ROOTSIZE=6000
SWAPSIZE=1024
# login/password into VM
# we will change the password immediately
ADMIN="vmuser"
INITPWD="vmpass"
vmbuilder kvm ubuntu \
--suite="$SUITE" \
--flavour=virtual \
--arch="$ARCH" \
--libvirt=qemu:///system \
--hostname="$VMNAME" \
--bridge=br0 \
--ip="192.168.8.$MYOCTET" \
--mask=255.255.255.240 \
--gw=192.168.8.1 \
--dns=192.168.8.1 \
--domain=localdomain \
--user="$ADMIN" \
--name=Administrator \
--pass="$INITPWD" \
--dest=/var/lib/libvirt/images/$VMNAME \
--rootsize="$ROOTSIZE" \
--swapsize="$SWAPSIZE" \
--mem=512 \
--addpkg=puppet \
--addpkg linux-image-generic \
--install-mirror="$MIRROR" \
--components main,universe,restricted,multiverse \
--firstboot=/etc/vmbuilder/firstscripts/firstboot.sh \
--debug \
--verbose \