Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diavirt

diavirt implements all of the functionality of Virtualization.framework in a command-line tool.

Simple Usage (UTM Compatibility)

diavirt can run a UTM VM using the UTM compatibility mode:

# Run the VM package named "Debian" with the viewer enabled
$ diavirt -v -u Debian
# Run the VM package named "Debian" in headless mode
$ diavirt -u Debian
# Run the VM package at the specified path in headless mode
$ diavirt -u ~/some/path/to/test.utm

Advanced Usage

diavirt takes in a configuration file which describes how to build up the virtual machine configuration.

{
  "cpuCoreCount": 2,
  "memorySizeInBytes": 2147483648,
  "platform": {
    "genericPlatform": {}
  },
  "bootLoader": {
    "efiBootLoader": {
      "efiVariableStore": {
        "variableStorePath": "efi.vars"
      }
    }
  },
  "graphicsDevices": [
    {
      "virtioGraphicsDevice": {
        "scanouts": [
          {
            "widthInPixels": 1280,
            "heightInPixels": 720
          }
        ]
      }
    }
  ],
  "keyboardDevices": [
    {
      "usbKeyboardDevice": {}
    }
  ],
  "pointingDevices": [
    {
      "usbScreenCoordinatePointingDevice": {}
    }
  ],
  "serialPorts": [
    {
      "virtioConsoleDevice": {},
      "stdioSerialAttachment": {}
    }
  ],
  "storageDevices": [
    {
      "diskImageAttachment": {
        "imageFilePath": "disk.raw"
      },
      "virtioBlockDevice": {}
    }
  ],
  "entropyDevices": [
    {
      "virtioEntropyDevice": {}
    }
  ],
  "memoryBalloonDevices": [
    {
      "virtioTraditionalMemoryBalloonDevice": {}
    }
  ],
  "networkDevices": [
    {
      "natNetworkAttachment": {},
      "virtioNetworkDevice": {}
    }
  ],
  "directorySharingDevices": []
}

To run diavirt with the specified configuration:

$ diavirt -v -c machine.json