Manage browser disks
Create, switch, or permanently delete browser-hosted Xila disk images in OPFS.
This guide shows how to create, switch and permanently delete Xila disk images in the browser demonstration. Use it to manage test disks or to reset a corrupt disk.
By default, the demonstration runs on a memory disk: each tab starts from the current seed image and discards changes on reload. The saved-disk controls below appear after you turn on Keep my files between visits in the Xila Help panel.
The following diagram shows the states of a disk in the browser demonstration.
Every change of disk asks for a confirmation and then restarts Xila. A saved disk is a file in the Origin Private File System (OPFS). While one tab has it open, that tab holds the exclusive Web Lock xila-opfs:<name>: the active disk cannot be removed from its own tab, and removing a disk that another tab has open fails, because the removal must acquire the same lock. A second tab that opens the same disk fails with a resource busy error. When the tab closes or switches disks, it releases the lock and the disk is closed again.
Before you begin
Section titled “Before you begin”- Open the browser demonstration at platforms.xila.dev or your local Trunk development server.
- A browser that supports the Origin Private File System (OPFS) and the Web Locks API.
- Turn on Keep my files between visits in the Xila Help panel to use saved disks.
- The demonstration page of this site shows the same demonstration in a frame. The frame and platforms.xila.dev use the same disks. Each disk is open in one tab at a time: a second tab that opens the same disk fails with a resource busy error.
- Back up any important files before deleting a disk.
Create a new disk
Section titled “Create a new disk”- Open the Xila Help sidebar panel located on the left edge of the browser demonstration.
- In the disk actions toolbar below Available disks, click New disk.
- When the browser confirmation dialog asks
Restart Xila using xila_YYYY-MM-DD.img?, click OK. - The runtime stops active writes and commits pending changes to the current disk. It releases the Web Lock and reloads on the fresh disk image, initialized from the current seed image (
seed.img).
Switch between saved disks
Section titled “Switch between saved disks”- In the Xila Help sidebar, locate the Available disks list.
- Click the name of the target disk to select it. Disks currently open in other tabs are marked with
(open). - Click Use selected disk.
- When prompted to confirm the restart, click OK. The runtime commits pending writes, records the selection in
localStorage, and reloads.
Remove an unused disk
Section titled “Remove an unused disk”- In Available disks, click the disk you want to delete. The currently active disk cannot be deleted from its own tab.
- Click Remove. If the button is disabled, the disk is either currently active or held by another open tab.
- When the confirmation prompt asks
Permanently remove <name> and all files stored on it?, click OK. - The disk manager acquires an exclusive lock on the image and removes the file from OPFS.
Reset storage using browser developer tools
Section titled “Reset storage using browser developer tools”If a corrupt image prevents the interface from loading, clear the OPFS entry directly:
- Close all open Xila tabs for the current origin.
- Open a new tab on the same origin (for example, the site root).
- Open the browser developer tools console and run:
const root = await navigator.storage.getDirectory();await root.removeEntry("xila_drive.img");- Alternatively, use the browser site settings to clear all stored data and cookies for the origin.
Verify the result
Section titled “Verify the result”- Reopen the demonstration page.
- Open the Xila Help sidebar.
- Confirm that Available disks displays the expected disk list and that the target image was removed or loaded.
- On a freshly created or reset disk, log in with the default administrator credentials:
- User name:
administrator - Password: (leave blank)
- User name:
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
| The Remove button remains disabled. | The selected disk is active in this tab or holds a Web Lock in another tab. | Select an inactive disk, or close other browser tabs running Xila on the same origin. |
The disk status displays Browser storage is unavailable. |
The browser is in a private browsing mode that restricts OPFS, or storage permissions are blocked. | Use a standard browsing window with OPFS and Web Locks enabled. |
| Startup stops with a mount error. | The existing disk image was corrupted or modified outside Xila. | Use the developer tools console command to remove the damaged disk and reload. |