summaryrefslogtreecommitdiff
path: root/createvm.sh
diff options
context:
space:
mode:
Diffstat (limited to 'createvm.sh')
-rwxr-xr-xcreatevm.sh21
1 files changed, 19 insertions, 2 deletions
diff --git a/createvm.sh b/createvm.sh
index 3290a95..f9e2511 100755
--- a/createvm.sh
+++ b/createvm.sh
@@ -28,7 +28,7 @@ darkhttpd . --port 8088 &
virt-install --name ${NAME} -r 1536 --vcpus=1 --os-type=linux --os-variant=virtio26 \
--disk pool=default,size=4,format=qcow2 --network bridge=br0,model=virtio \
- --arch i686 --cpu coreduo \
+ --arch i686 --cpu coreduo --graphics none \
--boot kernel=archiso/arch/boot/i686/vmlinuz,initrd=archiso/arch/boot/i686/archiso.img,kernel_args="archisobasedir=archiso/arch archiso_http_srv=http://${HOST}:8088/ script=http://${HOST}:8088/archauto.sh ip=${CLIENT}:::${NETMASK}:${NAME}::off nomodeset i915.modeset=0" &
sleep 15
@@ -43,7 +43,24 @@ virsh dumpxml ${NAME} > ${NAME}.xml
xmlstarlet ed -d '/domain/os/kernel' ${NAME}.xml | xmlstarlet ed -d '/domain/os/initrd' | xmlstarlet ed -d '/domain/os/cmdline' > ${NAME}-new.xml
-virsh define ${NAME}-new.xml
+xmlstarlet ed \
+ -a /domain/devices/rng -t elem -n graphics -v '' \
+ -i /domain/devices/graphics \
+ -t attr -n type -v vnc \
+ -i /domain/devices/graphics \
+ -t attr -n port -v 5909 \
+ -i /domain/devices/graphics \
+ -t attr -n autoport -v yes \
+ -i /domain/devices/graphics \
+ -t attr -n listen -v '0.0.0.0' \
+ -s /domain/devices/graphics -t elem -n listen -v '' \
+ -i /domain/devices/graphics/listen \
+ -t attr -n type -v address \
+ -i /domain/devices/graphics/listen \
+ -t attr -n address -v '0.0.0.0' \
+ ${NAME}-new.xml > ${NAME}-new2.xml
+
+virsh define ${NAME}-new2.xml
virsh start ${NAME}