aboutsummaryrefslogtreecommitdiff
path: root/travis/setup-guest
blob: 0a671b2fef8c524f5a0420400673801c89ff5ee9 (plain)
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
#!/bin/bash
set -x

unset http_proxy

check_network() {
  ping -c 3 archive.ubuntu.com
}

while check_network ; [ $? -ne 0 ];do
  echo waiting for network to be ready...
  sleep 1
done

add-apt-repository -y ppa:gophers/archive
apt-get -qq update
apt-get install -y qemu libvirt-bin libvirt-dev golang-1.9 ovmf genisoimage
echo -e "<pool type='dir'>\n<name>default</name>\n<target>\n<path>/pool-default</path>\n</target>\n</pool>" > pool.xml
mkdir /pool-default
chmod a+rwx /pool-default
virsh pool-define pool.xml
virsh pool-start default
echo -e 'user = "root"\ngroup = "root"' >> /etc/libvirt/qemu.conf
systemctl restart libvirtd