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