Skip to content

Fix Ubuntu "Installing Linux" hang and desktop runtime (should address #87) - #120

Open
EzYDark wants to merge 1 commit into
jamesstringer90:mainfrom
EzYDark:fix/ubuntu-runtime
Open

Fix Ubuntu "Installing Linux" hang and desktop runtime (should address #87)#120
EzYDark wants to merge 1 commit into
jamesstringer90:mainfrom
EzYDark:fix/ubuntu-runtime

Conversation

@EzYDark

@EzYDark EzYDark commented Aug 31, 2026

Copy link
Copy Markdown

Warning

This pull request was mostly vibecoded with Codex using GPT-5.6 Sol Extra High. It was tested on the hardware and software documented below, but it has not received an independent human code review. Treat the implementation as untrusted until reviewed.

Related issue: #87 - VM Stuck on installing

Relation to issue #87

This PR should address the Ubuntu 26.04 case reported in #87.

The issue log reaches VM created and started and begins the IDD probe, but never shows the guest agent connecting or installation completing. That matches the visible result of the locally reproduced failure.

In the local reproduction, the confirmed failure sequence was:

base-only package index
incompatible package versions selected
apt rejected the offline build dependencies
gcc and DKMS were unavailable
guest-agent binaries were not compiled
guest agent could not connect
AppSandbox remained on Installing Linux

After applying this patch, a fresh Ubuntu 26.04.1 VM reached agentOnline: true and installComplete: true.

Issue #87 does not contain the guest's first-boot log, so an identical root cause cannot be proven until the reporter retests. The issue also mentions Windows 11 guests. This PR does not change Windows provisioning and should not be treated as a complete fix for the Windows case.

Summary

This fixes a reproduced Ubuntu VM provisioning failure that left AppSandbox stuck indefinitely on Installing Linux.

It also fixes problems discovered after provisioning:

  • Firefox did not launch
  • App Center did not open
  • Ubuntu Settings displayed controls without text
  • Kernel modules and guest services were missing
  • Display capture could reuse an invalid framebuffer ID

Before the fix

Installation remained stuck

The Ubuntu disk was built and the VM was running according to HCS, but AppSandbox continued showing Installing Linux because the guest agent had not been built and could not connect.

screenshot1

Ubuntu Settings rendered without text

Settings opened, but most labels and text were missing. Guest logs later showed GTK using Mesa's D3D12 Vulkan renderer and reporting VK_ERROR_OUT_OF_POOL_MEMORY.

screenshot2

Root causes and fixes

Problem Confirmed cause Fix
Installing Linux never completed Offline dependency resolution used only Ubuntu's base package index. The point-release root filesystem contained newer packages from updates and security, causing exact-version conflicts during apt installation Merge the release, updates, and security package indexes before resolving the dependency closure
The guest agent never connected The failed apt transaction left gcc, DKMS, matching kernel headers, and other build dependencies unavailable. The guest binaries were therefore never compiled Add build-essential, dkms, the exact kernel headers, and agent dependencies as required prefetch seeds
Required packages could be omitted silently Missing seed packages and kernel headers were warnings or optional lookups Make the prefetch helper return an error when a required seed or exact kernel-header package is unavailable
Firefox and App Center did not launch VHDX construction does not preserve extended attributes, so snap-confine lost the Linux capabilities required by Snap applications Restore the packaged capabilities from /usr/lib/snapd/snap-confine.caps during first boot
Settings displayed controls without text GTK4 selected Mesa's experimental D3D12 Vulkan renderer, which produced VK_ERROR_OUT_OF_POOL_MEMORY Set GDK_DISABLE=vulkan for GTK applications without disabling OpenGL
Display capture could show a stale or blank frame The display agent read p->fb_id after freeing the DRM plane structure Copy the framebuffer ID before freeing the plane

Implementation

  • Download package indexes for the Ubuntu release, updates, and security pockets
  • Merge those indexes in release, updates, security order so later records are available to the existing resolver
  • Add build-essential, dkms, matching kernel headers, agent libraries, and openssh-server to the dependency seeds
  • Return an error from the prefetch helper when a required seed or matching header package is missing
  • Restore snap-confine capabilities during first boot using Ubuntu's packaged capability data
  • Add first-boot checks for the Snap capabilities and GTK renderer policy
  • Write GDK_DISABLE=vulkan to /etc/environment and /etc/environment.d/90-appsandbox-gtk.conf
  • Preserve the DRM framebuffer ID before releasing the plane data

Test environment

This is the tested configuration, not a statement of minimum requirements.

Host hardware

Component Tested configuration
Computer HUAWEI KLVL-WXX9
Processor AMD Ryzen 7 4800H
CPU layout 8 physical cores, 16 logical processors
Physical memory 16 GiB
Physical GPU AMD Radeon Graphics
GPU driver 31.0.21925.1001

Host software

Component Tested version
Host OS Microsoft Windows 11 IoT Enterprise LTSC, 64-bit
Windows version 10.0.26100, build 26100
AppSandbox host application 0.1.4.0
Provisioning helper Release build of the patched iso-patch.exe
Patched helper SHA-256 10102802223EB5E70C448439CFB6F0D58F987A19FE0BDC7DD7DDE2C56A603644
Ubuntu ISO ubuntu-26.04.1-desktop-amd64.iso
ISO SHA-256 601E30FBF5D97759367C632E2C33630665039B7E2158FD068403DA3CCF1BDA1F

The built helper and the helper installed in the AppSandbox release directory had the same SHA-256 hash.

Fresh regression VM

Setting Value
vCPUs 4
RAM 4096 MB
Virtual disk 32 GB
GPU Default GPU using GPU-PV
Network NAT
SSH Enabled with a deployed key
Guest session Wayland
Guest kernel 7.0.0-30-generic

Recorded guest software

Component Tested version
Ubuntu 26.04.1 Desktop, AMD64
Kernel headers 7.0.0-30.30
build-essential 12.12ubuntu2.26.04.2
GCC 15.2.0
DKMS 3.2.2
GNOME Settings 50.3
GTK 4.22.4
libadwaita 1.9.1
Mesa Vulkan drivers 26.0.8
snapd 2.76.3
Firefox Snap 154.0.1-1, revision 8803
App Center / snap-store Revision 1390

Automated verification

  • Built the patched iso-patch.exe in Release mode
  • Provisioned a new Ubuntu 26.04.1 VM from the tested ISO
  • Confirmed agentOnline: true
  • Confirmed installComplete: true
  • Confirmed the agent, audio, display, and input services were active
  • Confirmed /dev/dxg was present
  • Confirmed the exact kernel headers were installed
  • Confirmed the DKMS-built asb_drm and dxgkrnl modules were present
  • Confirmed the expected snap-confine capabilities
  • Confirmed GDK_DISABLE=vulkan reached the desktop session
  • Successfully ran snap run firefox --version
  • Successfully entered the Firefox Snap shell
  • Confirmed the current boot log did not contain the previous snap-confine capability error
  • Confirmed the current boot log did not contain VK_ERROR_OUT_OF_POOL_MEMORY
  • Started GNOME Settings in the desktop user session
  • Opened the AppSandbox display endpoint successfully and observed it report ready

Manual verification

The repaired VM was also checked through the interactive AppSandbox display:

  • Settings rendered its labels and controls
  • Firefox opened
  • App Center opened
  • The desktop accepted input
  • The display continued updating during interaction

Known limitations

  • The issue VM Stuck on installing #87 reporter used a GTX 1060 with GPU-PV and Ubuntu kernel 7.0.0-14-generic; this PR was tested with AMD Radeon Graphics and kernel 7.0.0-30-generic
  • The reporter must retest before the Ubuntu case in VM Stuck on installing #87 can be considered confirmed
  • Windows guest provisioning is unchanged
  • The existing host caller still logs a dependency-prefetch failure as a warning and continues VHDX creation
  • Existing VMs that already completed first boot must be rebuilt or repaired separately

GTK policy scope

GDK_DISABLE=vulkan disables GTK's Vulkan backend for the guest environment. It does not disable GTK's OpenGL renderer.

Resolve offline build dependencies against the Ubuntu release, updates, and security repositories. Include the required build tools and matching kernel headers so the guest agent can build and complete installation instead of leaving AppSandbox stuck on Installing Linux.

Restore snap-confine capabilities, disable GTK Vulkan rendering while retaining OpenGL, and preserve the DRM framebuffer ID before freeing the plane data.
@EzYDark

EzYDark commented Sep 2, 2026

Copy link
Copy Markdown
Author

Ready to test pre-release of those fixes:
https://github.com/EzYDark/appsandbox/releases/tag/v0.1.4-ubuntu-fixes-test.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant