The create command in MarinaBox CLI is used to create a new session in a secure and isolated sandbox environment. This command supports multiple environment types and additional configuration options.

Video Tutorial


Command Syntax

mb local create --env-type=<browser|desktop> [--tag=<TAG>] [--kiosk] [--initial-url=<URL>]

Options:

  • --env-type: Specifies the type of environment for the session. Supported values:
    • browser: Creates a sandboxed browser environment.
    • desktop: Creates a sandboxed desktop environment.
  • --tag: (Optional) Assigns a custom tag to the session for easier identification.
  • --kiosk: (Optional) Launches Chrome in kiosk mode (browser environment only). Removes tab controls and runs in fullscreen.
  • --initial-url: (Optional) Specifies the initial URL to open when the browser starts (browser environment only).

Examples

1. Create a Browser Session

mb local create --env-type=browser

This creates a browser session with default resolution and no tag.

2. Create a Desktop Session with Custom Resolution

mb local create --env-type=desktop

3. Create a Tagged Session

mb local create --env-type=desktop --tag=TestSession

This creates a desktop session with a custom tag TestSession.

4. Create a Kiosk Mode Browser Session

mb local create --env-type=browser --kiosk

This creates a browser session in kiosk mode, ideal for presentations or public displays.

5. Create a Browser Session with Initial URL

mb local create --env-type=browser --initial-url="https://example.com"

This creates a browser session that automatically opens example.com on startup.


Command Behavior

  1. Environment Validation: Ensures the specified env-type is valid (browser or desktop).
  2. Port Allocation: Dynamically assigns ports for the sandbox environment to avoid conflicts.
  3. Container Spin-Up: Creates the sandbox environment using the specified options and returns session details upon success.

Expected Output

Upon successful execution, the command returns details of the created session in JSON format:

{
  "session_id": "abc123xyz",
  "env_type": "browser",
  "status": "running",
  "resolution": "1200x800x24",
  "tag": "TestSession"
}

Use the session ID for subsequent commands to manage or view the session.


Get Support & Join Our Community