Skip to content

Commit

Permalink
Support docker hosts non-hw accel virtualization
Browse files Browse the repository at this point in the history
Closes #25
  • Loading branch information
Fernando Alvarez committed Dec 14, 2016
1 parent f3c957b commit d46a322
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions startvm
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ configureNetworks () {

# MAIN

#enable KVM support onl if the host supports it
if [[ $(grep -e vmx -e svm /proc/cpuinfo) ]]; then
KVM_OPTS="$KVM_OPTS -enable-kvm "
fi

# Debugging mode
if [ "$1" = "bash" ]; then
export LAUNCHER=$LAUNCHER
Expand All @@ -229,7 +234,7 @@ if [ "$1" = "bash" ]; then
export DNS_SERVERS=$DNS_SERVERS
export KVM_BLK_OPTS=$KVM_BLK_OPTS
export KVM_OPTS="$KVM_OPTS -nographic"
alias launcher="$LAUNCHER -enable-kvm $KVM_BLK_OPTS $KVM_OPTS $KVM_CPU_OPTS $KVM_NET_OPTS"
alias launcher="$LAUNCHER $KVM_BLK_OPTS $KVM_OPTS $KVM_CPU_OPTS $KVM_NET_OPTS"
exec bash
fi

Expand Down Expand Up @@ -297,5 +302,5 @@ if [[ "$ENABLE_DHCP" == 1 ]]; then
$DNSMASQ $DNSMASQ_OPTS
fi

echo "INFO: Launching $LAUNCHER -enable-kvm $KVM_BLK_OPTS $KVM_OPTS $KVM_VIDEO_OPTS $KVM_CPU_OPTS $KVM_ARGS $@ $KVM_NET_OPTS"
eval exec $LAUNCHER -enable-kvm $KVM_BLK_OPTS $KVM_OPTS $KVM_VIDEO_OPTS $KVM_CPU_OPTS "$@" $KVM_NET_OPTS
echo "INFO: Launching $LAUNCHER $KVM_BLK_OPTS $KVM_OPTS $KVM_VIDEO_OPTS $KVM_CPU_OPTS $KVM_ARGS $@ $KVM_NET_OPTS"
eval exec $LAUNCHER $KVM_BLK_OPTS $KVM_OPTS $KVM_VIDEO_OPTS $KVM_CPU_OPTS "$@" $KVM_NET_OPTS

0 comments on commit d46a322

Please sign in to comment.