From ed356361fd254a9e19eb29e18ce4396a450fe6c7 Mon Sep 17 00:00:00 2001 From: Sakirnth Nagarasa Date: Wed, 9 Mar 2022 17:13:09 +0100 Subject: Linux VM should be created correctly with preseed file. --- libexec/container/create-qemu | 2 +- share/build-scripts/qemu | 1 + share/config/vm.conf.in | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 share/config/vm.conf.in diff --git a/libexec/container/create-qemu b/libexec/container/create-qemu index 8abd861..d56ac89 100755 --- a/libexec/container/create-qemu +++ b/libexec/container/create-qemu @@ -161,7 +161,7 @@ fi case "${CONFIG_TEMPLATE}" in '') - CONFIG_TEMPLATE="/usr/share/${SOFTWARE}/config/container.conf.in" + CONFIG_TEMPLATE="/usr/share/${SOFTWARE}/config/vm.conf.in" ;; esac diff --git a/share/build-scripts/qemu b/share/build-scripts/qemu index 6fd8248..ebffa1f 100755 --- a/share/build-scripts/qemu +++ b/share/build-scripts/qemu @@ -961,6 +961,7 @@ Commands () -e "s|^bind=.*|bind=${BIND}|g" \ -e "s|^bind-ro=.*|bind-ro=${BIND_RO}|g" \ -e "s|^network-veth-extra=.*|network-veth-extra=${HOST_INTERFACE_NAME}:eno1|g" \ + -e "s|@PRIMARY_TAP@|${HOST_INTERFACE_NAME}|g" \ "${CONFIG}/${NAME}.conf" if [ "${NETWORK_NUMBER}" -ge 2 ] diff --git a/share/config/vm.conf.in b/share/config/vm.conf.in new file mode 100644 index 0000000..688fb97 --- /dev/null +++ b/share/config/vm.conf.in @@ -0,0 +1,39 @@ +# compute-tools: @NAME@ + +[start] +cnt.auto=false +cnt.container-server= +# FIXME bridge +cnt.network-bridge=tap-@SHORTNAME@-ma1:bridge-oob +cnt.overlay= +cnt.overlay-options= +bind= +bind-ro= +boot=yes +capability= +directory=/var/lib/machines/@NAME@ +drop-capability= +link-journal=no +machine=@NAME@ +private-users=no +register=yes + +[vm] +memory=4G +bios=/usr/share/OVMF/OVMF_CODE.fd +serial=mon:telnet::@PORT@,server,nowait +raw-options=-cpu host -smp cores=8,threads=2 +# FIXME: absolut path +drive=format=raw,file=/var/lib/machines/@NAME@.img,if=ide,index=0 +vm.netdev=tap,id=eno1,ifname=@PRIMARY_TAP@,script=no,downscript=no -device virtio-net-pci,netdev=eno1,addr=1 +#vm.netdev=user,id=slirp -device virtio-net-pci,netdev=slirp,addr=7 + +[limit] +BlockIODeviceWeight= +BlockIOReadBandwidth= +BlockIOWeight= +BlockIOWriteBandwidth= +CPUQuota= +CPUShares= +MemoryLimit= +TasksMax= -- cgit v1.2.3