X-Git-Url: https://piware.de/gitweb/?p=bin.git;a=blobdiff_plain;f=vm;h=3e94cb753fc756aa0f2c56d1b1ff4361dc6934be;hp=5c497593c55b8acfd171e266133e2704f7cb724a;hb=e0c1c1a8225413d1162dfa39271585a245dc8bb0;hpb=fcd8ef8dd4a9ccd4137ce951efbc81ad83c90820 diff --git a/vm b/vm index 5c49759..3e94cb7 100755 --- a/vm +++ b/vm @@ -5,9 +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 -m 2048 -drive file="$image",if=virtio \ +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 \ -net nic,model=virtio -net user,hostfwd=tcp::${ssh_port}-:22 "$@"