Skip to content
Snippets Groups Projects
Commit b92ea5a6 authored by Recolic's avatar Recolic :house_with_garden:
Browse files

.use real config as sample

parent 3a8feb6a
No related branches found
No related tags found
No related merge requests found
......@@ -88,13 +88,13 @@ function start_vm_if_not_running () {
local uuid=`uuidgen --namespace @oid --name "qemu.$name" --sha1`
# Check if qemu already running for this instance.
ps aux | grep -F "uuid $uuid" | grep qemu && return 0
ps aux | grep -F "uuid $uuid" | grep qemu > /dev/null 2>&1 && return 0
# start it
[[ ! -f "vm/$name/disk.img" ]] && echo2 "In start_vm, disk image vm/$name/disk.img doesn't exist. Did init_vm fail?" && return 1
echo2 "+ Starting VM $name with options_txt '$options_txt' and uuid $uuid..."
[[ -f "vm/$name/initimg.iso" ]] && options+=(-cdrom "vm/$name/initimg.iso")
nohup qemu-system-x86_64 --uuid "$uuid" -drive file="vm/$name/disk.img",if=virtio -cpu host --enable-kvm -bios /usr/share/edk2-ovmf/x64/OVMF.fd -net nic,model=rtl8139 "${options[@]}" >> tmp/qemu.log 2>&1 & disown
nohup qemu-system-x86_64 --uuid "$uuid" -drive file="vm/$name/disk.img",if=virtio -cpu host --enable-kvm -net nic,model=rtl8139 "${options[@]}" >> tmp/qemu.log 2>&1 & disown
}
function do_init () {
......
# name;options (name will be trimmed, options will be passed as-is)
ubuntucorp ;-m 2G -smp 2 -vnc :10 -net user,hostfwd=tcp::30471-:22
ndpa-build ;-m 8G -smp 4 -vnc :11 -net user,hostfwd=tcp::30472-:22
gitlab-ci-ms;-m 4G -smp 3 -vnc :12 -net user,hostfwd=tcp::30473-:22
devbox ;-m 8G -smp 8 -vnc :13 -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time -nic tap,ifname=vnic0,script=no,downscript=no,mac=10:11:11:11:11:10 -chardev socket,id=chrtpm,path=/tmp/mytpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
ndpa-build ;-m 8G -smp 4 -vnc :11 -net user,hostfwd=tcp::30472-:22 -bios /usr/share/edk2-ovmf/x64/OVMF.fd
gitlab-ci-ms;-m 4G -smp 3 -vnc :12 -net user,hostfwd=tcp::30473-:22 -bios /usr/share/edk2-ovmf/x64/OVMF.fd
devbox ;-m 8G -smp 8 -vnc :13 -bios /usr/share/edk2-ovmf/x64/OVMF.fd -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time -nic tap,ifname=vnic0,script=no,downscript=no,mac=10:11:11:11:11:10 -chardev socket,id=chrtpm,path=/tmp/mytpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment