-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
- Loading branch information
1 parent
f6ea584
commit c365809
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# A template to run ubuntu using audio: default | ||
# This template requires Lima v0.23.0 or later. | ||
images: | ||
# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. | ||
- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" | ||
arch: "x86_64" | ||
digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" | ||
- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" | ||
arch: "aarch64" | ||
digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" | ||
# Fallback to the latest release image. | ||
# Hint: run `limactl prune` to invalidate the cache | ||
- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" | ||
arch: "x86_64" | ||
- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" | ||
arch: "aarch64" | ||
|
||
mounts: | ||
- location: "~" | ||
- location: "/tmp/lima" | ||
writable: true | ||
|
||
vmType: "qemu" | ||
audio: | ||
device: "default" | ||
|
||
provision: | ||
- mode: system | ||
script: | | ||
#!/bin/bash | ||
set -eux -o pipefail | ||
test -e /lib/modules/$(uname -r)/kernel/sound/pci/hda/snd-hda-intel.ko* && exit 0 | ||
apt-get install -y linux-modules-extra-$(uname -r) | ||
modprobe snd-hda-intel | ||
- mode: system | ||
script: | | ||
#!/bin/bash | ||
set -eux -o pipefail | ||
command -v aplay >/dev/null 2>&1 && exit 0 | ||
apt-get install -y --no-install-recommends alsa-utils | ||
probes: | ||
- description: "alsa to be installed" | ||
script: | | ||
#!/bin/bash | ||
set -eux -o pipefail | ||
if ! timeout 30s bash -c "until command -v aplay >/dev/null 2>&1; do sleep 3; done"; then | ||
echo >&2 "alsa is not installed yet" | ||
exit 1 | ||
fi | ||
hint: See "/var/log/cloud-init-output.log". in the guest | ||
message: | | ||
To get a list of all available audio devices: | ||
$ sudo aplay -L | ||
To test the audio device, use something like: | ||
$ sudo speaker-test -c2 -twav |