aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-12-30 20:07:42 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-12-30 20:07:42 -0200
commit48b12bda534020898c80553a610796a3b6a33a0d (patch)
treeec1df4244e2cebd1690ab101db46fe34297ef577
parent18493f694b9e61f52af7a4149aba2cb5547d5dee (diff)
downloadkvmx-48b12bda534020898c80553a610796a3b6a33a0d.tar.gz
kvmx-48b12bda534020898c80553a610796a3b6a33a0d.tar.bz2
Adds sound option
-rwxr-xr-xkvmx7
-rw-r--r--kvmxfile4
2 files changed, 10 insertions, 1 deletions
diff --git a/kvmx b/kvmx
index d3d783e..b5182cb 100755
--- a/kvmx
+++ b/kvmx
@@ -390,6 +390,10 @@ function kvmx_up {
spice_opts="$spice_opts -chardev spicevmc,id=spicechannel0,name=vdagent"
fi
+ if [ -z "$sound" ] || [ "$sound" != "0" ]; then
+ sound_opts="-soundhw $sound"
+ fi
+
# Run virtual machine
# See https://en.wikipedia.org/wiki/Nohup#Overcoming_hanging
nohup kvm -m $memory -name $VM \
@@ -397,7 +401,8 @@ function kvmx_up {
$spice_opts \
-chardev "socket,id=monitor,path=$MONITORFILE,server,nowait" -mon chardev=monitor,mode=readline \
-chardev "socket,id=serial0,path=$CONSOLEFILE,server,nowait" -device isa-serial,chardev=serial0 \
- -smp $smp -soundhw ac97 -cpu host -balloon virtio \
+ -smp $smp -cpu host -balloon virtio \
+ $sound_opts \
-net $net_opts \
$qemu_opts &> $LOGFILE < /dev/null &
diff --git a/kvmxfile b/kvmxfile
index 66e19a9..8d8a265 100644
--- a/kvmxfile
+++ b/kvmxfile
@@ -82,6 +82,10 @@ run_xephyr="0"
# Set screen resolution
#resolution="1280x785"
+# Sound
+#sound="0"
+sound="ac97"
+
# Set additional hostfwd mappings
#port_mapping="hostfwd=tcp:127.0.0.1:8080-:80,hostfwd=tcp:127.0.0.1:8443-:443"