Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lima-vm
GitHub Repository: lima-vm/lima
Path: blob/master/templates/experimental/alsa.yaml
2622 views
1
# A template to run ubuntu using device: default
2
3
minimumLimaVersion: 2.0.0
4
5
base:
6
- template:_images/ubuntu-lts
7
- template:_default/mounts
8
9
vmType: qemu
10
audio:
11
device: default
12
13
provision:
14
- mode: system
15
script: |
16
#!/bin/bash
17
set -eux -o pipefail
18
test -e /lib/modules/$(uname -r)/kernel/sound/pci/hda/snd-hda-intel.ko* && exit 0
19
apt-get install -y linux-modules-extra-$(uname -r)
20
modprobe snd-hda-intel
21
- mode: system
22
script: |
23
#!/bin/bash
24
set -eux -o pipefail
25
command -v aplay >/dev/null 2>&1 && exit 0
26
apt-get install -y --no-install-recommends alsa-utils
27
probes:
28
- description: "alsa to be installed"
29
script: |
30
#!/bin/bash
31
set -eux -o pipefail
32
if ! timeout 30s bash -c "until command -v aplay >/dev/null 2>&1; do sleep 3; done"; then
33
echo >&2 "alsa is not installed yet"
34
exit 1
35
fi
36
hint: See "/var/log/cloud-init-output.log" in the guest
37
message: |
38
To get a list of all available audio devices:
39
$ sudo aplay -L
40
To test the audio device, use something like:
41
$ sudo speaker-test -c2 -twav
42
43