You are viewing the arm version of our documentation.


Command Reference

Anka CLI Command Reference
> anka  --help
usage: anka [options] <command>

   Anka command line tool

options:
  -j,--machine-readable
                     Output a machine readable format (JSON)
  --version          Output the Anka version

commands:
  list               List local VM library
  config             Manage the CLI configuration
  show               Show a VM's properties
  modify             Modify a VM parameters
  view               Open VM display
  run                Run a command inside of a VM (will start VM if suspended or stopped
  create             Creates a VM
  start              Start or resume a VM
  stop               Shut down a VM(s)
  clone              Clone a VM
  push               Push a VM template the Registry
  pull               Pull a VM template from the registry
  suspend            Suspend a running VM(s)
  mount              Mount or check the mounted directories the VM
  unmount            Unmount the mounted directory
  reboot             Reboot a running VM(s)
  delete             Delete a VM(s) and tags
  registry           Configure and control the Registry
  cp                 Copy files in/out of the Anka VM and host
  license            Control Licensing

List

> anka list --help
usage: list [options] [vm...]

   List local VM library

options:
  -a,--all           Show all the VMs including cached ones
  -f,--field <val>   Specify the fields displayed for the VM
❯ anka list
+---------------------+--------------------------------------+----------------------+---------+
| name                | uuid                                 | creation_date        | status  |
+---------------------+--------------------------------------+----------------------+---------+
| 12.0-beta-xcode13.1 | 61e1a370-89b4-435a-a816-8bfdf7e9fe5a | Oct 15 08:20:40 2021 | stopped |
+---------------------+--------------------------------------+----------------------+---------+
| 12.0-beta (v2)      | 26c18e20-f67a-4387-a7b7-236a277bb424 | Oct 15 08:20:40 2021 | stopped |
+---------------------+--------------------------------------+----------------------+---------+

❯ anka --machine-readable list | jq
{
  "status": "OK",
  "body": [
    {
      "name": "12.0-beta-xcode13.1",
      "uuid": "61e1a370-89b4-435a-a816-8bfdf7e9fe5a",
      "creation_date": "2021-10-16T07:20:40Z",
      "status": "stopped"
    },
    {
      "name": "12.0-beta",
      "uuid": "26c18e20-f67a-4387-a7b7-236a277bb424",
      "creation_date": "2021-10-16T07:20:40Z",
      "version": "v2",
      "status": "stopped"
    }
  ]
}

❯ anka --machine-readable list --field name --field version | jq
{
  "status": "OK",
  "body": [
    {
      "name": "12.0-beta-xcode13.1"
    },
    {
      "name": "12.0-beta",
      "version": "v2"
    }
  ]
}

Config

> anka config --help
usage: config [options] [param...]

   Manage the CLI configuration

options:
  -l,--list          List parameter(s)
  -r,--reset         Reset parameter(s) back to default
❯ anka config
+-----------------------------+-----------------------------------------------------------------------------------+
| addons_disk_tool            | /Library/Application Support/Veertu/Anka/guestaddons/create_update_disk.sh        |
+-----------------------------+-----------------------------------------------------------------------------------+
| addons_identifier           | ANKA_ADDONS_IDENTIFIER                                                            |
+-----------------------------+-----------------------------------------------------------------------------------+
| addons_image                | /Library/Application Support/Veertu/Anka/guestaddons/anka-addons-mac              |
+-----------------------------+-----------------------------------------------------------------------------------+
| addons_pkg                  | com.veertu.anka.guestaddons.pkg                                                   |
+-----------------------------+-----------------------------------------------------------------------------------+
| addons_postupdate           | /Library/Application Support/Veertu/Anka/guestaddons/postupdate.sh                |
+-----------------------------+-----------------------------------------------------------------------------------+
| adresses_per_byte           | 250                                                                               |
+-----------------------------+-----------------------------------------------------------------------------------+
| allow_nonunique_names       | False                                                                             |
+-----------------------------+-----------------------------------------------------------------------------------+
| anka_executable             | /Library/Application Support/Veertu/Anka/bin/headless.app/Contents/MacOS/headless |
+-----------------------------+-----------------------------------------------------------------------------------+
| anka_image_maker_executable | /Library/Application Support/Veertu/Anka/bin/anka_image                           |
+-----------------------------+-----------------------------------------------------------------------------------+
| anka_viewer                 | /Applications/Anka.app                                                            |
+-----------------------------+-----------------------------------------------------------------------------------+
| ankacp_executable           | /Library/Application Support/Veertu/Anka/bin/ankacp                               |
+-----------------------------+-----------------------------------------------------------------------------------+
| ankactl_executable          | /Library/Application Support/Veertu/Anka/bin/ankactl                              |
+-----------------------------+-----------------------------------------------------------------------------------+
| ankanet_sock                | /var/run/ankanetd                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| block_nocache               | 1                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| bridge_name                 |                                                                                   |
+-----------------------------+-----------------------------------------------------------------------------------+
| ca_bundle                   | /Users/m1mini/.anka/ca-bundle.crt                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| chunk_size                  | 0                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| config_path                 | /Library/Application Support/Veertu/Anka:~/.anka/settings.ini                     |
+-----------------------------+-----------------------------------------------------------------------------------+
| default_disk                | 137438953472                                                                      |
+-----------------------------+-----------------------------------------------------------------------------------+
| default_format              | 0                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| default_nvcpu               | 4                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| default_passwd              | admin                                                                             |
+-----------------------------+-----------------------------------------------------------------------------------+
| default_ram                 | 4294967296                                                                        |
+-----------------------------+-----------------------------------------------------------------------------------+
| default_user                | anka                                                                              |
+-----------------------------+-----------------------------------------------------------------------------------+
| delete_logs                 | 1                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| fvutil_executable           | /Library/Application Support/Veertu/Anka/bin/fvutil                               |
+-----------------------------+-----------------------------------------------------------------------------------+
| img_lib_dir                 | /Users/m1mini/Library/Application Support/Veertu/Anka/img_lib                     |
+-----------------------------+-----------------------------------------------------------------------------------+
| io_threads                  | 0                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| log_dir                     | /Users/m1mini/Library/Logs/Anka/                                                  |
+-----------------------------+-----------------------------------------------------------------------------------+
| log_file                    | anka.log                                                                          |
+-----------------------------+-----------------------------------------------------------------------------------+
| mac_random_bytes            | 2                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| max_vms_allowed             | 255                                                                               |
+-----------------------------+-----------------------------------------------------------------------------------+
| mitigations                 | 0                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| nice                        | 0                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| operations_timeout          | 300                                                                               |
+-----------------------------+-----------------------------------------------------------------------------------+
| options_api_url             | https://8ewgf8mtn4.execute-api.us-west-2.amazonaws.com/prod/key/info              |
+-----------------------------+-----------------------------------------------------------------------------------+
| permanent_mac_prefix        | 86,69,69                                                                          |
+-----------------------------+-----------------------------------------------------------------------------------+
| portfwd_base                | 10000                                                                             |
+-----------------------------+-----------------------------------------------------------------------------------+
| process_type                | Interactive                                                                       |
+-----------------------------+-----------------------------------------------------------------------------------+
| product_root                | /Library/Application Support/Veertu/Anka                                          |
+-----------------------------+-----------------------------------------------------------------------------------+
| propagate_license           | 0                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| propagate_name              | 0                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| pull_checkout               | 1                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| puller_threads              | 10                                                                                |
+-----------------------------+-----------------------------------------------------------------------------------+
| qncpu                       | 0                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| quantum                     | 0                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| qvcpu                       | 0                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| registry_remotes_file_path  | /Users/m1mini/.anka/remote                                                        |
+-----------------------------+-----------------------------------------------------------------------------------+
| state_lib_dir               | /Users/m1mini/Library/Application Support/Veertu/Anka/img_lib                     |
+-----------------------------+-----------------------------------------------------------------------------------+
| table_fmt                   | grid                                                                              |
+-----------------------------+-----------------------------------------------------------------------------------+
| time_sync                   | 1                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| trim_disk                   | 1                                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| uhost_executable            | /Library/Application Support/Veertu/Anka/bin/uhost                                |
+-----------------------------+-----------------------------------------------------------------------------------+
| vlaunch_sock                | /var/run/vlaunchd                                                                 |
+-----------------------------+-----------------------------------------------------------------------------------+
| vlaunch_sock_gui            | ~/.anka/vlaunchd                                                                  |
+-----------------------------+-----------------------------------------------------------------------------------+
| vm_lib_dir                  | /Users/m1mini/Library/Application Support/Veertu/Anka/vm_lib                      |
+-----------------------------+-----------------------------------------------------------------------------------+
| vm_lock_dir                 | /Users/m1mini/Library/Application Support/Veertu/Anka/vm_lib/.locks               |
+-----------------------------+-----------------------------------------------------------------------------------+
| vnc_password                | admin                                                                             |
+-----------------------------+-----------------------------------------------------------------------------------+
❯ anka config puller_threads
4

❯ anka config puller_threads 10

❯ anka config puller_threads
10

Show

> anka show --help
usage: show [options] vmid [param...]

   Show a VM's properties

options:
  -t,--tag <val>     Specify VM tag, current by default
❯ anka show 12.0-beta
+---------+--------------------------------------+
| uuid    | 26c18e20-f67a-4387-a7b7-236a277bb424 |
+---------+--------------------------------------+
| name    | 12.0-beta (v2)                       |
+---------+--------------------------------------+
| created | Oct 15 08:20:40 2021                 |
+---------+--------------------------------------+
| vcpu    | 8                                    |
+---------+--------------------------------------+
| memory  | 12G                                  |
+---------+--------------------------------------+
| display | 1024x768                             |
+---------+--------------------------------------+
| disk    | 128GiB (22.83GiB on disk)            |
+---------+--------------------------------------+
| addons  | 3.0.0.135.8400565                    |
+---------+--------------------------------------+
| network | shared                               |
+---------+--------------------------------------+
| status  | stopped Oct 18 18:57:50 2021         |
+---------+--------------------------------------+

❯ anka --machine-readable show 12.0-beta | jq
{
  "status": "OK",
  "body": {
    "uuid": "26c18e20-f67a-4387-a7b7-236a277bb424",
    "name": "12.0-beta",
    "version": "v2",
    "creation_date": "2021-10-16T07:20:40Z",
    "cpu_cores": 8,
    "cpu_frequency": 0,
    "cpu_htt": false,
    "ram": "12884901888",
    "ram_size": 12884901888,
    "frame_buffers": 1,
    "hard_drive": 137438953472,
    "encrypted": false,
    "image_size": 24518402048,
    "addons_version": "3.0.0.135.8400565",
    "stop_date": "2021-10-19T17:57:50Z",
    "status": "stopped"
  }
}

❯ anka --machine-readable show 12.0-beta --tag v2 | jq
{
  "status": "OK",
  "body": {
    "uuid": "26c18e20-f67a-4387-a7b7-236a277bb424",
    "name": "12.0-beta",
    "creation_date": "2021-10-19T12:57:57Z",
    "cpu_cores": 8,
    "cpu_frequency": 0,
    "cpu_htt": false,
    "ram": "12884901888",
    "ram_size": 12884901888,
    "frame_buffers": 1,
    "hard_drive": 137438953472,
    "encrypted": false,
    "image_size": 21119369216,
    "addons_version": "3.0.0.135.8400565",
    "stop_date": "2021-10-19T17:58:31Z",
    "status": "stopped"
  }
}

Modify

> anka modify --help
usage: modify vmid <command>

   Modify a VM parameters

commands:
  name               Set new template name for the VM
  cpu                Set number of vcpu cores and frequency
  ram                Set RAM size and parameters
  network            Modify network card settings
  disk               Modify hard drive settings
  display            Configure displays

modify {vmNameOrUUID} name

> anka modify 12.0-beta name --help
usage: name name

   Set new template name for the VM

modify {vmNameOrUUID} cpu

> anka modify 12.0-beta cpu --help
usage: cpu [options] [vcpu]

   Set number of vcpu cores and frequency

options:
  -f,--frequency <val>
                     Set the base vcpu frequency (Hz)

modify {vmNameOrUUID} ram

> anka modify 12.0-beta ram --help
usage: ram [size]

   Set RAM size and parameters

modify {vmNameOrUUID} network

> anka modify 12.0-beta network --help
usage: network [options]

   Modify network card settings

options:
  -t,--mode <val>    network mode: shared/host/bridge/disconnected
  -b,--bridge <val>
                     host interface name to bridge with in the bridge mode, or "auto"
  -m,--mac <val>     specify fixed MAC address, or "auto"
  --direct-mac       expose --mac externally
  --no-direct-mac    do not expose --mac externally (default)
  -v,--vlan <val>    assign VLAN ID, 0 to deassign
  -c,--controller <val>
                     set controller: anet, virtio-net
  --local            enable (default) inter-VM and VM-host communication
  --no-local         disable inter-VM and VM-host communication

modify {vmNameOrUUID} disk

> anka modify 12.0-beta disk --help
usage: disk [options]

   Modify hard drive settings

options:
  -c,--controller <val>
                     set controller: ablk/virtio-blk
  -s,--size <val>    set disk size
  -f,--file <val>    assign external image or device
  --ro               Mark the image as read-only for the VM
  --rw               Mark the image as writable (default) for the VM

modify {vmNameOrUUID} display

> anka modify 12.0-beta display --help
usage: display [options]

   Configure displays

options:
  -n,--count <val>   Configure number of displays (2 max)
  --headless         same as --count 0
  -p,--password      Prompt for VNC password, or get if from the ANKA_VNC_PASSWORD env
  --vnc <val>        Configure VNC: on/off/address
  --no-vnc           Disable VNC access to the VM
  -d,--dpi <val>     Set DPI (default is 72)
  -r,--resolution <val>
                     Set resolution, e.g. 1024x768 or 'default' to reset to default
  -f,--fps <val>     Set refresh rate (30fps by default)
  -c,--controller <val>
                     Set video controller: fbuf/pg
  --host-gpu-location <val>
                     Specify location of the host GPU to use, or 'any'
  --host-gpu-name <val>
                     Specify name of the host GPU to use, or 'any'
  --features <val>   Specify extended features flags as a bit mask

View

> anka view --help
usage: view [options] vmid

   Open VM display

options:
  -d,--display <val>
                     Specify the display(s) to view
  -s,--screenshot    Take PNG screenshot
  --click            Send HDI events
  --click-rec        Record HID events
  -o,--output <val>
                     Specify output file for the view operations

Run

> anka run --help
usage: run [options] vmid

   Run a command inside of a VM (will start VM if suspended or stopped

options:
  -D,-w,--workdir <val>
                     Working directory inside the VM
  -v,--volume <val>
                     Mount a host directory into VM
  -n,--no-volume     Use this flag to prevent implicit mounting of current folder (see --volume option)
  -E                 Inherit the entire environment in non-overriding mode
  -e <val>           Provide an environment variable in overriding mode
  -f,--env-file <val>
                     Provide environment variables from file
  -Q,--quiet         Suppress the stdout from the command
  -b,--background    Run the command in background returning PID to wait with 'wait [PID...]' command

❯ anka show 12.0-beta | grep status
| status  | stopped Oct 19 07:34:43 2021         |

❯ anka run 12.0-beta hostname
12-0-beta.local

❯ anka show 12.0-beta | grep status
| status  | running since Oct 19 07:34:59 2021   |

❯ TEST=123 anka run -e TEST 12.0-beta bash -c "env | grep TEST && echo \${TEST}"
TEST=123
123

anka run will source user “rc” files in a specific order:

The source sequence is:

  1. /etc/profile
  2. .bash_profile
  3. .bash_login
  4. .profile

Create

> anka create --help
usage: create [options] name

   Creates a VM

options:
  -m,--ram-size <val>
                     Set the RAM size
  -c,--cpu-count <val>
                     Set the number of CPU cores
  -d,--disk-size <val>
                     Set the disk size
  -a,--app <val>     Path to the macOS restore image
--app is not like the 2.X Anka intel version. It requires a restore image (ipsw) from apple, not a .app installer. For now, we will automatically download the latest Monterey restore image from apple on anka create --app latest.
  • We recommend naming your initial VM after the version of macOS.
  • Remember that VM templates are created under a specific user and will not be available to other users.
❯ anka create -a latest 12.0-beta
######################################################################## 100.0%
00c44c30-174a-4266-8833-89d6975754bd

Start

> anka start --help
usage: start [options] vmid

   Start or resume a VM

options:
  -f,--force         Start VM with minimum checks
  -q,--quiet         Minimize output
  -v,--view          Open VM in an Anka window
  -u,--update-addons
                     Start in (auto)update mode

Stop

> anka stop --help
usage: stop [options] [vmid...]

   Shut down a VM(s)

options:
  -a,--all           Shutdown all running VMs
  -f,--force         Forcefully stop the VM(s)

Clone

> anka clone --help
usage: clone [options] vmid [name...]

   Clone a VM

options:
  -c,--copy          Create an independent copy
  -t,--tag <val>     Clone particular VM tag (should be available locally)

Push

> anka push --help
usage: push [options] vmid

   Push a VM template the Registry

options:
  -t,--tag <val>     Set the tag name to push
  -v,--remote-vm <val>
                     The name of a registry template you want to push the tag onto
  -d,--description <val>
                     Set the description of the tag
  -f,--force         Forcefully push, regardless of a tag already existing
  -l,--local         Commit the template without pushing it to the Registry
  -s,--shallow       Include all the changes of an older tags
  -q,--quiet         Do not show progress
  -r,--registry <val>
                     Specifies an alternate destination of a push operation

Pull

> anka pull --help
usage: pull [options] vmid

   Pull a VM template from the registry

options:
  -t,--tag <val>     Pull the particular tag (latest if not specfied)
  -l,--local         Checkout (make it current) local tag
  --fetch-only       Download tag without checkout (making it current)
  -s,--shrink        Delete other local tags to optimize disk usage
  --check-download-size
                     
  -q,--quiet         Do not show progress
  -r,--regisry <val>
                     Specifies an alternate source of a pull operation

Suspend

> anka suspend --help
usage: suspend [options] [vmid...]

   Suspend a running VM(s)

options:
  -a,--all           Suspend all running VMs

Mount

> anka mount --help
usage: mount [dir] [mntpoint]

   Mount or check the mounted directories the VM

Unmount

> anka unmount --help
usage: unmount [options] [dir...]

   Unmount the mounted directory

options:
  -a,--all           Unmount all mounted directories

Reboot

> anka reboot --help
usage: reboot [options] [vmid...]

   Reboot a running VM(s)

options:
  -a,--all           Reboot all running VMs

Delete

> anka delete --help
usage: delete [options] [vmid...]

   Delete a VM(s) and tags

options:
  -a,--all           Delete all VMs in library
  -t,--tag <val>     Specify local tag to delete
  --yes              Do not expect user confirmation of VM deletion
  --cache            Delete temporary cache and ophran images

Registry

> anka registry --help
usage: registry [options] <command>

   Configure and control the Registry

options:
  -r,--remote <val>
                     Sets an alternate registry

commands:
  list-repos         List registries you have configured
  add                Add a registry
  set                Set default registry
  delete             Remove a registry from your configuration
  list               List VMs in registry
  show               Show a template's properties
  revert             Revert or delete a template

registry list-repos

> anka registry list-repos --help
usage: list-repos [options]

   List registries you have configured

options:
  -d,--default       Show only the default registry

registry add

> anka registry add --help
usage: add name url

   Add a registry

registry set

> anka registry set --help
usage: set name

   Set default registry

registry delete

> anka registry delete --help
usage: delete [options] [REG_NAME]

   Remove a registry from your configuration

options:
  -a,--all           Forget all registries

registry list

> anka registry list --help
usage: list [vmid]

   List VMs in registry

registry revert

> anka registry revert --help
usage: revert [options] vmid

   Revert or delete a template

options:
  -t,--tag <val>     TEXT

Cp

> anka cp --help
usage: cp [options]

   Copy files in/out of the Anka VM and host

options:
  -R                 copy the src and its entire subtree to the dst
  -L                 all symbolic links are followed
  -H                 symbolic links in the command are followed
  -P                 do not follow a symbolic links (default)
  -f                 remove and create the dst file on open failure
  -n                 do not overwrite an existing file.
  -p                 preserve the source file attributes
  -a                 same as -pPR options
  -v                 cause cp to be verbose, showing files as they are copied
❯ time anka cp ~/VirtualBox\ VMs/cloud-client-side-ha-1/cloud-client-side-ha-1.vdi 10.15.6:/Users/anka/
anka --debug cp  10.15.6:/Users/anka/  0.86s user 20.60s system 4% cpu 8:53.85 total

Compare the ~9 minutes it takes for anka cp to how much it takes to transfer the same file with scp:

❯ time scp -P 10000 -v ~/VirtualBox\ VMs/cloud-client-side-ha-1/cloud-client-side-ha-1.vdi [email protected]:/Users/anka/
scp -P 10000 -v  [email protected]:/Users/anka/  110.61s user 60.88s system 22% cpu 12:46.30 total

License

> anka license --help
usage: license <command>

   Control Licensing

commands:
  show               Show license information
  activate           Activate license key
  delete             Remove the current license
  accept-eula        Accept EULA (requires root privileges)

license show

> anka license show --help
usage: show <command>

   Show license information    

license activate

> anka license activate --help
usage: activate [options] key

   Activate license key

options:
  -f,--force         Silently override the current license
  --cid <val>        Submit the CustomerID

license delete

> anka license delete --help

license accept-eula

> anka license accept-eula --help