Commit Graph
25 Commits
Author SHA1 Message Date
James Stringer 2309cec029 Add Linux VM support with GPU-PV
Ubuntu 26.04 LTS guest end-to-end:

- cidata-driven autoinstall pipeline (subiquity user-data + nested
  cloud-init bootcmd) in disk_util.c. Static NAT IP, ssh-via-vsock
  marker, serial-debug kernel cmdline injected into ESP grub.cfg by
  iso-patch.exe. Five separate firstboot pipeline fixes get the VM
  to GDM unattended on Hyper-V Gen 2.

- Linux guest stack under tools/linux/:
    - appsandbox-agent  (vsock :1 control + clipboard helper spawn)
    - appsandbox-audio  (snd-aloop -> vsock :4)
    - appsandbox-display (KMS framebuffer capture -> vsock :2)
    - appsandbox-input  (uinput injection <- vsock :3)
    - appsandbox-clipboard (XCB selection bridge <-> vsock :5/:6)
  Helper binaries staged via release/resources/linux/.

- asb_drm DRM module: virtual single-CRTC display sink the host
  captures over vsock. Platform-bus, DRIVER_GEM/MODESET/ATOMIC/RENDER,
  linear shmem framebuffers. asb-evict-simpledrm.service unbinds the
  EFI simple-framebuffer before display-manager so mutter binds
  asb_drm as the sole DRM card.

- dxgkrnl vendored byte-identical from microsoft/WSL2-Linux-Kernel
  linux-msft-wsl-6.18.y with our DKMS/out-of-tree shim (dxgkrnl_compat.h
  + Kbuild + dkms.conf). Autoinstall late-commands dkms-builds against
  every /target/lib/modules/<kver> so kernel-version drift between ISO
  and post-update reboot still leaves a working .ko.

- wsl-mesa custom build (Mesa 25.3 + d3d12 gallium + microsoft-
  experimental dzn Vulkan). Installs to /opt/wsl-mesa parallel to
  Ubuntu's stock Mesa. Prebuilt tarball for ubuntu-26.04-amd64
  shipped under tools/linux/wsl-mesa/prebuilt/ (21 MB).

- Per-VM GPU acceleration policy:
    - /etc/systemd/user-environment-generators/50-appsandbox-gpu
      emits GALLIUM_DRIVER=d3d12 + LD_LIBRARY_PATH + VK_DRIVER_FILES
      into the user@1000 systemd-user environment when /dev/dxg and
      /opt/wsl-mesa are present. Inherited by every app-*.scope a
      .desktop launch creates.
    - /etc/systemd/user/org.gnome.Shell@.service.d/no-gpu.conf
      UnsetEnvironment= strips these for the compositor — mutter
      stays on llvmpipe so asb_drm scanout works (the d3d12 pipe has
      no GBM compatibility with asb_drm).
    - /usr/local/bin/appsandbox-gpu wrapper for terminal-launched
      opt-in GPU acceleration (probes /dev/dxg; no-op on no-GPU VMs).

- Host changes:
    - vm_display_idd.c, vm_clipboard.c, vm_agent.c, vm_ssh_proxy.c,
      asb_display.c: hcs_service_guid(os_type, port) so the same code
      paths reach the per-OS service identifiers (HV_GUID for Windows,
      vsock template for Linux).
    - asb_core.c: linux_create_thread builds an empty VHDX, cidata
      ISO with extras (agent ELFs, dxgkrnl src, asb_drm src, wsl-mesa
      tarball, wsl-deps libs), and boots the desktop ISO + cidata.
    - hcs_vm.c: HostLxssLib Plan9 share appended for Linux VMs;
      VideoMonitor + ComPorts retained for serial debug.
    - gpu_enum.c/h: gpu_append_lxsslib_share helper.
    - vm_clipboard.c file-drop support (CF_HDROP / x-special/gnome-
      copied-files round-trip).
    - vm_display_idd.c: 32-bit S32_LE PCM audio path matches the
      Linux daemon's snd-aloop capture format.

- iso-patch.c gains a patch_ubuntu_esp_grub_for_debug pass that
  rewrites /EFI/ubuntu/grub.cfg via the FAT32 ESP, plus a qcow2->
  vhdx converter with a RFC 1951 DEFLATE inflater for compressed
  cluster handling.

- wsl-deps: Microsoft's libd3d12.so / libd3d12core.so / libdxcore.so
  fetched on demand from the public NuGet feed
  pkgs.dev.azure.com/shine-oss/wsl (no auth). Staged at
  /opt/appsandbox/wsl-deps on the guest and put on /etc/ld.so.conf.d
  rather than /usr/lib/wsl/lib (which is overlaid by the agent's
  9P mount).

UI: web/{app.js,index.html} expose Linux VM creation + GPU selection,
distribution dropdown for cached Ubuntu ISOs, and the ISO picker for
custom images.
2026-05-19 20:21:43 -04:00
James Stringer 5b5c111105 Auto-select default adapter when switching VM to bridged 2026-05-05 19:32:40 -04:00
James Stringer 7d76acdf52 Make downloads more reliable on macOS 2026-04-22 22:43:37 -04:00
James Stringer 228a3095a4 Fix unable to interrupt download 2026-04-22 21:48:16 -04:00
James Stringer f7a6878380 Add a new try all GPU mode (hcs gpu mirror) 2026-04-21 18:31:16 -04:00
James Stringer ad551fb39e Set Computer Name 2026-04-18 22:59:38 -04:00
James Stringer aad2902c0a SSH + Clipboard + File staging for macOS 2026-04-18 22:14:59 -04:00
James Stringer 09631de935 Hide snapshot column in VM table on macOS 2026-04-16 18:31:05 -04:00
James Stringer 5a29dd6376 Show OS Type dropdown on macOS with macOS pre-selected
The dropdown was hidden on macOS causing osType to be missing
from the create request. Now it's visible with a macOS option
added and auto-selected/disabled on Mac.
2026-04-14 22:28:30 -04:00
James Stringer c3952ba376 Hide Windows-only fields in create modal on macOS
The macOS backend auto-downloads the restore image from Apple,
so image/template selection, GPU, credentials, and Windows
options are unnecessary. The Create button is always enabled on
macOS since no image path is required.
2026-04-14 22:26:22 -04:00
James Stringer c819574e10 Route shared web UI through both WebView2 and WKWebView bridges 2026-04-14 22:04:22 -04:00
James Stringer 5d7c9ef22d remove standalone p9 client, fix ux spinner when staging files 2026-04-13 20:40:56 -04:00
James Stringer 6246186277 Turn Create Sandbox into a modal 2026-04-13 18:08:56 -04:00
James Stringer a26f1e9b19 UI polish 2026-04-11 22:48:59 -04:00
James Stringer aa14fd0a36 Remove RDP, auto open IDD as soon as we detect it sending frames on first boot 2026-04-11 22:30:41 -04:00
James Stringer e7d48750de add SSH support, fix a couple bugs
bugs fixed: the agent -> host messaging passing was unreliable
The NAT IP address failed to automatically set on first boot for VMs created from ISO.

SSH doesn't require internet which is cool, goes over Hyper-V sockets.
2026-04-11 00:23:01 -04:00
James Stringer ab54d35e41 Check for and prompt the user to install Virtual Machine Platform 2026-04-10 19:13:14 -04:00
James Stringer 4b80616749 various fixes + polish
set nat as default network, set IP address automatically when in NAT mode, don't open the rdp display on win11 home, fix a bug where display would open again at shutdown if it was closed
2026-04-08 22:57:43 -04:00
James Stringer bc257b73c3 Split out UI + Create DLL 2026-04-08 18:48:45 -04:00
James Stringer 23d600545e More snapshot refactoring 2026-03-21 14:27:32 -04:00
James Stringer 48700686f3 Refactor Snapshot system 2026-03-21 12:36:58 -04:00
James Stringer c494b9b235 stop vm being deleted if first start fails + start error messages 2026-03-19 22:30:31 -04:00
James Stringer 80fdfc3946 improve idd display performance and fix edit dropdown in network column 2026-03-19 21:43:04 -04:00
James Stringer 96cd9fa892 Fix a slow to close window and a vm name warning 2026-03-19 19:41:59 -04:00
James Stringer 5db568ea4e Initial commit 2026-03-18 18:44:36 -04:00