|
| 1 | +# A template to run ubuntu using display: vnc |
| 2 | +# This template requires Lima v0.15.0 or later. |
| 3 | +images: |
| 4 | +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. |
| 5 | +- location: "https://cloud-images.ubuntu.com/releases/23.04/release-20230926/ubuntu-23.04-server-cloudimg-amd64.img" |
| 6 | + arch: "x86_64" |
| 7 | + digest: "sha256:1e35473cea5e1b827b91ad6ebb43b605a00d506c11f66c75076c424ae5372440" |
| 8 | +- location: "https://cloud-images.ubuntu.com/releases/23.04/release-20230926/ubuntu-23.04-server-cloudimg-arm64.img" |
| 9 | + arch: "aarch64" |
| 10 | + digest: "sha256:46d4f3874831fc28e0edcf24b86b6b8017e0492fa848d951cfa3c7b520b2d2fa" |
| 11 | +# Fallback to the latest release image. |
| 12 | +# Hint: run `limactl prune` to invalidate the cache |
| 13 | +- location: "https://cloud-images.ubuntu.com/releases/23.04/release/ubuntu-23.04-server-cloudimg-amd64.img" |
| 14 | + arch: "x86_64" |
| 15 | +- location: "https://cloud-images.ubuntu.com/releases/23.04/release/ubuntu-23.04-server-cloudimg-arm64.img" |
| 16 | + arch: "aarch64" |
| 17 | + |
| 18 | +mounts: |
| 19 | +- location: "~" |
| 20 | +- location: "/tmp/lima" |
| 21 | + writable: true |
| 22 | + |
| 23 | +vmType: "qemu" |
| 24 | +video: |
| 25 | + display: "vnc" |
| 26 | + |
| 27 | +provision: |
| 28 | +- mode: system |
| 29 | + script: | |
| 30 | + #!/bin/bash |
| 31 | + set -eux -o pipefail |
| 32 | + command -v Xorg >/dev/null 2>&1 && exit 0 |
| 33 | + export DEBIAN_FRONTEND=noninteractive |
| 34 | + # x-terminal-emulator x-session-manager x-window-manager |
| 35 | + apt-get install -y xorg xterm openbox hsetroot tint2 slim |
| 36 | + printf "auto_login yes\ndefault_user ${LIMA_CIDATA_USER}\n" >>/etc/slim.conf |
| 37 | + # configure some nice lima green, set up panel and apps |
| 38 | + printf "hsetroot -solid \"#32CD32\" &\ntint2 &\n" >>/etc/xdg/openbox/autostart |
| 39 | + sed -i 's/Clearlooks/Clearlooks-Olive/' /etc/xdg/openbox/rc.xml # go for green |
| 40 | + apt-get install -y --no-install-recommends dillo xfe # x-www-browser +explorer |
| 41 | +- mode: system |
| 42 | + script: | |
| 43 | + #!/bin/bash |
| 44 | + set -eux -o pipefail |
| 45 | + systemctl set-default graphical.target |
| 46 | + systemctl isolate graphical.target |
| 47 | +probes: |
| 48 | +- description: "Xorg to be installed" |
| 49 | + script: | |
| 50 | + #!/bin/bash |
| 51 | + set -eux -o pipefail |
| 52 | + if ! timeout 30s bash -c "until command -v Xorg >/dev/null 2>&1; do sleep 3; done"; then |
| 53 | + echo >&2 "Xorg is not installed yet" |
| 54 | + exit 1 |
| 55 | + fi |
| 56 | + hint: See "/var/log/cloud-init-output.log". in the guest |
| 57 | +message: | |
| 58 | + Use a VNC viewer or noVNC, to connect to the display: |
| 59 | +
|
| 60 | + * VNC Display: see <file://{{.Dir}}/vncdisplay> |
| 61 | + * VNC Password: see <file://{{.Dir}}/vncpassword> |
0 commit comments