Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ App Sandbox is a virtual machine app for Windows and macOS that's focused on per

Windows features:
- Works on Windows 11 Home or Pro, without Hyper-V
- Windows 11 or Ubuntu 26.04 LTS VM Support
- Windows 11 or Ubuntu 24.04 / 26.04 LTS VM Support
- Zero touch install
- Copy and Paste
- 2 Channel Audio
Expand Down
12 changes: 10 additions & 2 deletions src/app_win/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static void build_host_info_json(JsonBuilder *jb)
MEMORYSTATUSEX ms;
DWORD host_cores, host_ram_mb;
DWORD vm_cores = 0, vm_ram_mb = 0, vm_hdd_gb = 0;
wchar_t base_dir[MAX_PATH];
wchar_t base_dir[MAX_PATH], vm_dir[MAX_PATH];
ULARGE_INTEGER free_bytes;
DWORD free_gb = 0;
int i, count = asb_vm_count();
Expand All @@ -148,9 +148,16 @@ static void build_host_info_json(JsonBuilder *jb)
if (v) vm_hdd_gb += v->hdd_gb;
}

/* Report free space on the volume that actually backs the VM data
directory (%ProgramData%\AppSandbox), not the %ProgramData% root.
Querying the leaf directory lets GetDiskFreeSpaceEx follow a junction /
mount point when the user has redirected VM storage to another drive.
Fall back to the root when the directory does not exist yet. */
if (!GetEnvironmentVariableW(L"ProgramData", base_dir, MAX_PATH))
wcscpy_s(base_dir, MAX_PATH, L"C:\\ProgramData");
if (GetDiskFreeSpaceExW(base_dir, &free_bytes, NULL, NULL))
swprintf_s(vm_dir, MAX_PATH, L"%s\\AppSandbox", base_dir);
if (GetDiskFreeSpaceExW(vm_dir, &free_bytes, NULL, NULL) ||
GetDiskFreeSpaceExW(base_dir, &free_bytes, NULL, NULL))
free_gb = (DWORD)(free_bytes.QuadPart / (1024ULL * 1024 * 1024));

jb_int(jb, L"hostCores", (int)host_cores);
Expand Down Expand Up @@ -207,6 +214,7 @@ static void build_vm_json(JsonBuilder *jb, int i)
jb_bool(jb, L"buildingVhdx", v->building_vhdx);
jb_bool(jb, L"vhdxStaging", v->vhdx_staging);
jb_int(jb, L"vhdxProgress", v->vhdx_progress);
jb_string(jb, L"vhdxStep", v->vhdx_step);
jb_bool(jb, L"installComplete", v->install_complete);
jb_bool(jb, L"sshEnabled", v->ssh_enabled);
jb_int(jb, L"sshPort", (int)v->ssh_port);
Expand Down
369 changes: 347 additions & 22 deletions src/backend_win/asb_core.c

Large diffs are not rendered by default.

370 changes: 290 additions & 80 deletions tools/iso-patch/prefetch_build_deps.c

Large diffs are not rendered by default.

494 changes: 404 additions & 90 deletions tools/iso-patch/ubuntu_vhdx.c

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion tools/linux/wsl-mesa/50-appsandbox-gpu
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,20 @@
WSL_MESA=/opt/wsl-mesa
WSL_MESA_LIB="$WSL_MESA/lib/x86_64-linux-gnu"
WSL_LIB=/usr/lib/wsl/lib
# Distro Mesa's own d3d12 gallium driver (Ubuntu builds it for WSL). Used
# when no wsl-mesa prebuilt exists for this release (only 26.04 ships one;
# firstboot removes an ABI-incompatible one). Needs libdxcore/libd3d12,
# which firstboot puts on the loader path from /opt/appsandbox/wsl-deps.
STOCK_D3D12=/usr/lib/x86_64-linux-gnu/dri/d3d12_dri.so

if [ -e /dev/dxg ] && [ -d "$WSL_MESA_LIB" ]; then
if [ -e /dev/dxg ] && [ ! -d "$WSL_MESA_LIB" ] && [ -e "$STOCK_D3D12" ]; then
echo "LD_LIBRARY_PATH=$WSL_LIB"
echo "GALLIUM_DRIVER=d3d12"
echo "MESA_LOADER_DRIVER_OVERRIDE=d3d12"
echo "__GLX_VENDOR_LIBRARY_NAME=mesa"
# No VK_DRIVER_FILES: stock mesa-vulkan-drivers has no dzn ICD on
# 24.04, so Vulkan stays on lavapipe. OpenGL apps still hit the GPU.
elif [ -e /dev/dxg ] && [ -d "$WSL_MESA_LIB" ]; then
# LD_LIBRARY_PATH covers two needs:
# - $WSL_MESA_LIB picks Mesa's d3d12 gallium + dzn Vulkan over stock.
# - $WSL_LIB lets apps that dlopen the WSL NVIDIA userspace libs by
Expand Down
11 changes: 10 additions & 1 deletion tools/linux/wsl-mesa/appsandbox-gpu
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,17 @@ WSL_MESA=/opt/wsl-mesa
WSL_MESA_LIB="$WSL_MESA/lib/x86_64-linux-gnu"
WSL_MESA_VK_ICD="$WSL_MESA/share/vulkan/icd.d/dzn_icd.x86_64.json"
WSL_LIB=/usr/lib/wsl/lib
# Distro Mesa's d3d12 driver: the fallback when this release has no
# wsl-mesa prebuilt (see 50-appsandbox-gpu). OpenGL only; Vulkan stays
# on lavapipe because stock mesa-vulkan-drivers ships no dzn ICD.
STOCK_D3D12=/usr/lib/x86_64-linux-gnu/dri/d3d12_dri.so

if [ -e /dev/dxg ] && [ -d "$WSL_MESA_LIB" ]; then
if [ -e /dev/dxg ] && [ ! -d "$WSL_MESA_LIB" ] && [ -e "$STOCK_D3D12" ]; then
export LD_LIBRARY_PATH="$WSL_LIB${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export __GLX_VENDOR_LIBRARY_NAME=mesa
export GALLIUM_DRIVER=d3d12
export MESA_LOADER_DRIVER_OVERRIDE=d3d12
elif [ -e /dev/dxg ] && [ -d "$WSL_MESA_LIB" ]; then
# LD_LIBRARY_PATH covers two needs:
# - $WSL_MESA_LIB picks Mesa's d3d12 gallium + dzn Vulkan over stock.
# - $WSL_LIB lets apps that dlopen the WSL NVIDIA userspace libs by
Expand Down
7 changes: 6 additions & 1 deletion web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,12 @@ function updateStatusCell(td, vm) {

if (vm.buildingVhdx) {
needsSpinner = true;
label = vm.vhdxStaging ? 'Staging files... ' : 'Building Disk (' + (vm.vhdxProgress || 0) + '%) ';
/* vhdxStep names the current phase ("Downloading packages 42/182",
"Building rootfs", ...); the prefetch downloads used to sit at
"Building Disk (0%)" for minutes and look hung. */
if (vm.vhdxStaging) label = 'Staging files... ';
else if (vm.vhdxStep) label = vm.vhdxStep + ' (' + (vm.vhdxProgress || 0) + '%) ';
else label = 'Building Disk (' + (vm.vhdxProgress || 0) + '%) ';
className = 'status-building';
} else if (vm.running && vm.shuttingDown) {
className = 'status-shutting-down';
Expand Down