X-Git-Url: https://piware.de/gitweb/?a=blobdiff_plain;f=vm;h=174aedf385883e769757df714fe576db0c6bdbef;hb=3ee45886642a0872bdc45a7f40a43b05e53ccbed;hp=14f24837c037fec4bdb8d2afe32a5e9e99c618d8;hpb=a62d9c01805afce7e182bd0aed88b245fbadd2ee;p=bin.git diff --git a/vm b/vm index 14f2483..174aedf 100755 --- a/vm +++ b/vm @@ -5,11 +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 -device virtio-rng-pci \ -drive file="$image",if=virtio \ - -virtfs local,id=src,path=$HOME,security_model=none,mount_tag=home,readonly \ + -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 "$@"