diff --git a/4.2/start-qemu b/4.2/start-qemu index 897fac2..908443c 100755 --- a/4.2/start-qemu +++ b/4.2/start-qemu @@ -25,7 +25,8 @@ if [ -z "${QEMU_NO_SSH:-}" ]; then fi qemuPorts+=( ${QEMU_PORTS:-} ) -if [ -e /dev/kvm ]; then +if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then + # https://github.com/tianon/docker-qemu/issues/4 qemuArgs+=( -enable-kvm ) elif [ "$hostArch" = "$qemuArch" ]; then echo >&2 diff --git a/5.0/start-qemu b/5.0/start-qemu index 897fac2..908443c 100755 --- a/5.0/start-qemu +++ b/5.0/start-qemu @@ -25,7 +25,8 @@ if [ -z "${QEMU_NO_SSH:-}" ]; then fi qemuPorts+=( ${QEMU_PORTS:-} ) -if [ -e /dev/kvm ]; then +if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then + # https://github.com/tianon/docker-qemu/issues/4 qemuArgs+=( -enable-kvm ) elif [ "$hostArch" = "$qemuArch" ]; then echo >&2 diff --git a/5.1/start-qemu b/5.1/start-qemu index 897fac2..908443c 100755 --- a/5.1/start-qemu +++ b/5.1/start-qemu @@ -25,7 +25,8 @@ if [ -z "${QEMU_NO_SSH:-}" ]; then fi qemuPorts+=( ${QEMU_PORTS:-} ) -if [ -e /dev/kvm ]; then +if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then + # https://github.com/tianon/docker-qemu/issues/4 qemuArgs+=( -enable-kvm ) elif [ "$hostArch" = "$qemuArch" ]; then echo >&2 diff --git a/5.2/start-qemu b/5.2/start-qemu index 897fac2..908443c 100755 --- a/5.2/start-qemu +++ b/5.2/start-qemu @@ -25,7 +25,8 @@ if [ -z "${QEMU_NO_SSH:-}" ]; then fi qemuPorts+=( ${QEMU_PORTS:-} ) -if [ -e /dev/kvm ]; then +if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then + # https://github.com/tianon/docker-qemu/issues/4 qemuArgs+=( -enable-kvm ) elif [ "$hostArch" = "$qemuArch" ]; then echo >&2 diff --git a/start-qemu b/start-qemu index 897fac2..908443c 100755 --- a/start-qemu +++ b/start-qemu @@ -25,7 +25,8 @@ if [ -z "${QEMU_NO_SSH:-}" ]; then fi qemuPorts+=( ${QEMU_PORTS:-} ) -if [ -e /dev/kvm ]; then +if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then + # https://github.com/tianon/docker-qemu/issues/4 qemuArgs+=( -enable-kvm ) elif [ "$hostArch" = "$qemuArch" ]; then echo >&2