Skip to content

Commit 515ee43

Browse files
committed
Open Waydroid from the VM console and keep first-boot apt quiet
Running weston on the VM console now launches Android full-screen (weston.ini autolaunch with a small wrapper) and falls back to a terminal while Waydroid is not initialized; the next steps said to use a headless Weston, which shows nothing, and left out waydroid init. The first-boot scripts of Waydroid and NetBird export DEBIAN_FRONTEND=noninteractive so needrestart cannot draw its dialog on the console.
1 parent 6e06ca7 commit 515ee43

2 files changed

Lines changed: 31 additions & 3 deletions

File tree

‎vm/netbird-server.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ if [[ "$DOCKER_PREINSTALLED" == "no" ]]; then
345345
cat >"$DOCKER_INSTALL_TMP" <<'DOCKEREOF'
346346
#!/usr/bin/env bash
347347
set -Eeuo pipefail
348+
export DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a
348349
exec > /var/log/install-docker.log 2>&1
349350
350351
echo "[$(date)] Starting Docker installation"

‎vm/waydroid-vm.sh‎

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,39 @@ vm_customize "Waydroid binder module" "$WORK_FILE" \
186186
--run-command "grep -qxF binder_linux /etc/modules || echo 'binder_linux' >> /etc/modules" \
187187
--run-command "echo 'options binder_linux devices=binder,hwbinder,vndbinder' > /etc/modprobe.d/waydroid.conf" || exit 1
188188

189+
# `weston` on the VM console opens Android full-screen and returns to the
190+
# console when it is closed; without an initialized Waydroid it opens a terminal.
191+
WESTON_INI_TMP="$TEMP_DIR/weston.ini"
192+
cat >"$WESTON_INI_TMP" <<'INI'
193+
[core]
194+
idle-time=0
195+
196+
[autolaunch]
197+
path=/usr/local/bin/waydroid-ui
198+
watch=true
199+
INI
200+
WAYDROID_UI_TMP="$TEMP_DIR/waydroid-ui"
201+
cat >"$WAYDROID_UI_TMP" <<'UI'
202+
#!/bin/sh
203+
if waydroid status >/dev/null 2>&1; then
204+
exec waydroid show-full-ui
205+
fi
206+
exec weston-terminal
207+
UI
208+
vm_customize "Waydroid UI launcher" "$WORK_FILE" \
209+
--mkdir /etc/xdg/weston \
210+
--upload "${WESTON_INI_TMP}:/etc/xdg/weston/weston.ini" \
211+
--upload "${WAYDROID_UI_TMP}:/usr/local/bin/waydroid-ui" \
212+
--chmod "0755:/usr/local/bin/waydroid-ui" || exit 1
213+
189214
vm_prepare_cloud_image "$WORK_FILE" "$HN" || true
190215

191216
if [[ "$WAYDROID_PREINSTALLED" == "no" ]]; then
192217
WAYDROID_FIRSTBOOT_TMP="$TEMP_DIR/waydroid-firstboot.sh"
193218
cat >"$WAYDROID_FIRSTBOOT_TMP" <<FIRSTBOOT
194219
#!/usr/bin/env bash
195220
set -Eeuo pipefail
221+
export DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a
196222
exec >> /var/log/waydroid-install.log 2>&1
197223
198224
echo "[\$(date)] Starting Waydroid installation"
@@ -255,7 +281,7 @@ display_cloud_init_info "$VMID" "$HN"
255281

256282
if [[ "$WAYDROID_PREINSTALLED" == "yes" ]]; then
257283
INSTALL_STATUS="Pre-installed"
258-
FIRSTBOOT_STEP="Waydroid is pre-installed. Initialize it with: sudo waydroid init"
284+
FIRSTBOOT_STEP="Waydroid is pre-installed."
259285
else
260286
INSTALL_STATUS="First-boot unit waydroid-firstboot.service${WAYDROID_FIRSTBOOT_MARKER:+ (${WAYDROID_FIRSTBOOT_MARKER})}"
261287
FIRSTBOOT_STEP="Waydroid installation continues in the VM; follow it with tail -f /var/log/waydroid-install.log (unit status: systemctl status waydroid-firstboot)"
@@ -267,8 +293,9 @@ vm_print_summary \
267293
"Documentation=https://docs.waydro.id/"
268294
vm_next_steps \
269295
"$FIRSTBOOT_STEP" \
270-
"Start the container with: sudo systemctl start waydroid-container" \
271-
"Run a headless session with: weston --backend=headless & WAYLAND_DISPLAY=wayland-0 waydroid show-full-ui"
296+
"Download Android once: sudo waydroid init && sudo systemctl restart waydroid-container" \
297+
"On the VM console (noVNC, not the serial console) log in and run: weston -- Android opens full-screen; closing it returns to the console." \
298+
"Plain 'waydroid' opens a GTK settings window and needs that Weston session; use 'waydroid show-full-ui' inside it."
272299

273300
FINISH_MESSAGE="VM created. Waydroid installation continues in the VM on first boot."
274301
if [[ "$WAYDROID_PREINSTALLED" == "yes" ]]; then

0 commit comments

Comments
 (0)