Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lima-vm
GitHub Repository: lima-vm/lima
Path: blob/master/templates/experimental/vnc.yaml
2621 views
1
# A template to run ubuntu using display: vnc
2
3
minimumLimaVersion: 2.0.0
4
5
base:
6
- template:_images/ubuntu-lts
7
- template:_default/mounts
8
9
vmType: "qemu"
10
video:
11
display: "vnc"
12
13
provision:
14
- mode: system
15
script: |
16
#!/bin/bash
17
set -eux -o pipefail
18
command -v Xorg >/dev/null 2>&1 && exit 0
19
export DEBIAN_FRONTEND=noninteractive
20
# x-terminal-emulator x-session-manager x-window-manager
21
apt-get install -y xorg xterm openbox hsetroot tint2 slim
22
printf "auto_login yes\ndefault_user {{.User}}\n" >>/etc/slim.conf
23
# configure some nice lima green, set up panel and apps
24
printf "hsetroot -solid \"#32CD32\" &\ntint2 &\n" >>/etc/xdg/openbox/autostart
25
sed -i 's/Clearlooks/Clearlooks-Olive/' /etc/xdg/openbox/rc.xml # go for green
26
apt-get install -y --no-install-recommends dillo xfe # x-www-browser +explorer
27
- mode: system
28
script: |
29
#!/bin/bash
30
set -eux -o pipefail
31
systemctl set-default graphical.target
32
systemctl isolate graphical.target
33
probes:
34
- description: "Xorg to be installed"
35
script: |
36
#!/bin/bash
37
set -eux -o pipefail
38
if ! timeout 30s bash -c "until command -v Xorg >/dev/null 2>&1; do sleep 3; done"; then
39
echo >&2 "Xorg is not installed yet"
40
exit 1
41
fi
42
hint: See "/var/log/cloud-init-output.log" in the guest
43
message: |
44
Use a VNC viewer or noVNC, to connect to the display:
45
46
* VNC Display: see <file://{{.Dir}}/vncdisplay>
47
* VNC Password: see <file://{{.Dir}}/vncpassword>
48
49