AI Personal Learning
and practical guidance
TRAE

Kernel Images: An Open Source Solution for Lightweight Sandboxed Browsers

General Introduction

Kernel Images is an open source project hosted on GitHub that provides a lightweight, sandboxed Chrome environment. It is based on Docker and Unikraft technology to build isolated browser instances , support for automation frameworks such as Playwright and Puppeteer , suitable for web testing , data crawling and AI agent development. The project is maintained by the onkernel team under the Apache 2.0 license, with open code and community contributions. Users can deploy the browser environment through simple configuration, enjoying the advantages of low resource consumption and fast startup. Officials also provide hosting services, users can join the waiting list for more features.

Kernel Images:轻量级沙盒化浏览器的开源解决方案-1


 

Function List

  • Provides a pre-configured Chrome browser with support for the Chrome DevTools protocol.
  • Compatible with Playwright and Puppeteer for easy automation script integration.
  • Provides a remote GUI interface via noVNC to support visual monitoring and control.
  • integrated (as in integrated circuit) Anthropic (used form a nominal expression) Computer Use agent that supports text and voice actions.
  • The unikernel implementation, based on Unikraft, supports automated hibernation and stateful snapshots.
  • Supports Docker container deployment and is compatible with Linux, macOS and Windows.
  • Ultra-low latency cold start (less than 20 ms) for high-performance scenarios.
  • Open port configuration for easy connection and debugging of external tools.

 

Using Help

Installation process

Kernel Images supports both Docker and Unikraft deployment methods. Below are the detailed steps for Linux, macOS (Windows users need to install Docker Desktop).

1. Install Docker

Ensure that Docker is installed on your system. run the following command to check it:

docker --version

If not installed, refer to the official guide:

  • Ubuntu/Debian:
    sudo apt update
    sudo apt install -y docker.io
    sudo usermod -aG docker $USER
    
  • macOS: Download Docker Desktop from the official Docker website.
  • Windows: Install Docker Desktop and enable WSL 2.

2. Cloning project warehouse

Clone the Kernel Images repository using Git:

git clone https://github.com/onkernel/kernel-images.git
cd kernel-images

3. Build a Docker image

In the project root directory, build the Docker image:

docker build -t kernel-images -f containers/docker/Dockerfile .

Verify that the image was built successfully:

docker images | grep kernel-images

4. Run the Docker container

Start a sandboxed instance of Chrome:

docker run -d -p 9222:9222 -p 6080:6080 --name kernel-browser kernel-images
  • -p 9222:9222: Map Chrome DevTools ports for automated framework connections.
  • -p 6080:6080: Maps a noVNC port for remote GUI access.
  • --name kernel-browser: Named containers for easy management.

5. (Optional) Unikraft deployment

Unikraft provides a lighter weight unikernel deployment for high performance scenarios. Install the Unikraft toolchain:

  • consultation unikernels/unikraft-cu/README.mdThe following is a list of the dependencies to be installed (e.g. kraftkit).
  • Build the unikernel image:
    cd unikernels/unikraft-cu
    make
    
  • Run the instance:
    kraft run
    

Main Functions

1. Connectivity automation framework

Kernel Images' Chrome environment supports both Playwright and Puppeteer; the following is a Playwright example:

  • Install Playwright:
    npm install playwright
    
  • Creating Scripts test.js::
    const { chromium } = require('playwright');
    (async () => {
    const browser = await chromium.connectOverCDP('http://localhost:9222');
    const page = await browser.newPage();
    await page.goto('https://example.com');
    console.log(await page.title());
    await browser.close();
    })();
    
  • Run the script:
    node test.js
    

2. Remote GUI monitoring

Kernel Images provides a remote GUI interface via noVNC. After starting the container, access the http://localhost:6080(Make sure the port 6080 The noVNC interface can be accessed to monitor the browser status, debug scripts or check network requests in real time (mapped). The interface supports both mouse and keyboard operation and is suitable for remote control.

3. Automated hibernation and snapshots

In Unikernel mode, the browser automatically hibernates when there is no network activity, with a very low (near zero) resource footprint. During hibernation, the system generates a snapshot of the browser state (including cookies, page position, window zoom, etc.). The state is restored:

kraft resume

The snapshot feature is suitable for long-running tasks such as crawling or testing, ensuring that tasks can be seamlessly continued after an interruption.

4. Anthropic agent integration

Kernel Images integrates with Anthropic's Computer Use agent to support operating the browser via text or voice commands. Procedure:

  • Sign up for an Anthropic account to get an API key.
  • Setting environment variables:
    export ANTHROPIC_API_KEY=your-api-key
    
  • Run the agent script (located in the agent-loop.py):
    python agent-loop.py
    
  • Enter commands in the chat screen, such as "Open example.com and take a screenshot" or "Fill out the form".

5. Ultra-low latency cold start

Unikernel mode has a cold boot time of less than 20 milliseconds, which is ideal for scenarios that require a fast response time (such as event-driven automation tasks.) Docker mode boots a little slower, but is still better than traditional virtual machines.

caveat

  • Ensure that the port 9222 cap (a poem) 6080 Unoccupied.
  • Regularly update mirrors for the latest features:
    docker pull kernel-images:latest
    
  • Deployment of Unikraft requires familiarity with the Linux environment, and it is recommended that you refer to the official documentation.
  • System Requirements: At least 2GB RAM, 10GB disk space.

 

application scenario

  1. Web Automation Testing
    Developers use Kernel Images to run Playwright scripts to simulate user actions and test website functionality. The sandboxed environment ensures test isolation and is suitable for CI/CD integration.
  2. Data Crawling
    Data analysts deploy Kernel Images to batch access web pages and extract structured data. Hibernation and snapshot features support long tasks and reduce server costs.
  3. AI Agent Development
    AI developers utilize Anthropic agents to build intelligences that support voice or text control for complex tasks such as automated form filling or content search.
  4. Remote Debugging and Collaboration
    Teams monitor browsers remotely through the noVNC interface, ideal for cross-location collaboration or cloud-based development, and view page rendering and script execution in real time.

 

QA

  1. Which operating systems does Kernel Images support?
    Docker mode supports Linux, macOS, and Windows (requires Docker Desktop). unikraft mode primarily supports Linux.
  2. How do I keep my sandbox environment safe?
    Browser instances run in an isolated Docker container or unikernel, completely separate from the host system, reducing security risks.
  3. Is the Anthropic Agent feature required?
    No, Anthropic account is not required for Basic Browser functionality. Proxy functionality requires an API key.
  4. How low is the cold start latency?
    Unikernel mode cold boots in less than 20 milliseconds, Docker mode is a bit slower but still efficient.
  5. How do I get involved in project development?
    consultation CONTRIBUTING.mdYou can also submit a pull request or raise an issue on GitHub.
May not be reproduced without permission:Chief AI Sharing Circle " Kernel Images: An Open Source Solution for Lightweight Sandboxed Browsers
en_USEnglish