X-Git-Url: https://piware.de/gitweb/?a=blobdiff_plain;ds=inline;f=vm;h=174aedf385883e769757df714fe576db0c6bdbef;hb=09e04d40b7b3abe77e0a3da4b9145e26e0a2dca9;hp=d8abece8e4565aa49e7905c6291738ef94a809f9;hpb=65d310dc8b3b59d3428d9a46c27e2f3594a8b2e9;p=bin.git diff --git a/vm b/vm index d8abece..174aedf 100755 --- a/vm +++ b/vm @@ -5,10 +5,11 @@ image="$1" shift # determine ssh forward port ssh_port=22000 -while echo '' | nc localhost $ssh_port >/dev/null; do +until echo '' | nc localhost $ssh_port 2>&1 >/dev/null | grep -q 'Connection refused'; do ssh_port=$((ssh_port+1)) done echo "Host ssh port: $ssh_port" -qemu-system-x86_64 -enable-kvm -display sdl -m 2048 -drive file="$image",if=virtio \ - -virtfs local,id=src,path=$HOME,security_model=none,mount_tag=home,readonly \ +qemu-system-x86_64 -enable-kvm -display sdl -m 2048 -device virtio-rng-pci \ + -drive file="$image",if=virtio \ + -virtfs local,id=src,path=$HOME,security_model=none,mount_tag=home,readonly=on \ -net nic,model=virtio -net user,hostfwd=tcp::${ssh_port}-:22 "$@"