-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·28 lines (19 loc) · 950 Bytes
/
build.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
#!/bin/bash
SCRIPT_PATH="$(readlink -f "$0")"
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
XML_FILE="/tmp/debian-vm-base.xml"
LATEST_IMAGE=$(lynx -dump -listonly -nonumbers https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/ | grep standard | grep -v log | grep -v contents | grep -v packages | head -n 1)
echo y | ship --vm delete debian-vm-base
echo n | ship --vm create debian-vm-base --source "$LATEST_IMAGE"
sed -i '/<\/devices>/i \
<console type="pty">\
<target type="serial" port="0"/>\
</console>' "$XML_FILE"
virsh -c qemu:///system undefine debian-vm-base
virsh -c qemu:///system define "$XML_FILE"
echo "Building of VM Complete.Starting might take a while as it might take a bit of type for the vm to boot up and be ready for usage."
ship --vm start debian-vm-base
./view_vm.sh "y" # Enable the serial console using "systemctl enable --now [email protected]"
./setup.sh
./view_vm.sh "n"
./release.sh