Ops
Search…
Virtual Box
You can use Ops to run your local nanos in Virtual Box. You can use Ops CLI to create a .vdi image and launch a virtual machine with the image.

Pre-requisites

  1. 1.
    Install Virtual Box in your machine.
  2. 2.
    Ensure VBoxManage is in your shell path.
Note: If you are using WSL you may need to create a symlink in Windows filesystem with the name VBoxManage pointing to VBoxManage.exe.

Image Operations

Create Image

You can create an image with the following command.
1
$ ops image create <elf_file> -i <image_name> -t vbox
Copied!
For creating an image using a particular package, you need to provide the package name to ops image create command with -p option.
1
$ ops image create -c config.json -p node_v14.2.0 -a ex.js -i <image_name> -t vbox
Copied!
The Ops CLI will store the image in the directory vdi-images inside Ops default directory.

List Images

You can list existing images with ops image list -t vbox.
1
$ ops image list -t vbox
2
+--------------------------------------+------------------------+--------+---------+------------------+
3
| UUID | NAME | STATUS | SIZE | CREATEDAT |
4
+--------------------------------------+------------------------+--------+---------+------------------+
5
| 01071a8d-eb59-49c1-aa69-028f84cc6d06 | nanos-main-image | online | 10.0 GB | 3 days ago |
6
+--------------------------------------+------------------------+--------+---------+------------------+
7
| 01c5bd28-aa19-4883-a4c9-31f3ff9fd061 | nanos-node-image | online | 10.0 GB | 1 month ago |
8
+--------------------------------------+------------------------+--------+---------+------------------+
9
| 01cd3190-df52-47e8-b5c3-b05f7107819e | nanos-server-image | online | 10.0 GB | 1 year ago |
10
+--------------------------------------+------------------------+--------+---------+------------------+
Copied!

Delete Image

ops image delete <imagename> can be used to delete an image.
1
$ ops delete image nanos-main-image -t vbox
Copied!

Instance Operations

Create Instance

After creating the image, we can launch a virtual machine from an existing image.
1
$ ops instance create <image_name> -t vbox
Copied!

List Instances

You can list the virtual machines running on Virtual Box using ops instance list command.
1
$ ops instance list -t vbox
2
+--------------------------------------+------------------------+---------+-------------+-----------------------------------------+
3
| ID | NAME | STATUS | PRIVATE IPS | PUBLIC IPS |
4
+--------------------------------------+------------------------+---------+-------------+-----------------------------------------+
5
| 00d954cc-9603-43a0-915b-5c2ae75772b6 | nanos-main-image-15566 | running | 10.8.3.63 | 209.151.144.166 |
6
+--------------------------------------+------------------------+---------+-------------+-----------------------------------------+
Copied!

Get Logs for Instance

Work in progress.

Delete Instance

ops instance delete command can be used to delete a virtual machine.
1
$ ops instance delete my-instance-running -t vbox
Copied!
Last modified 7mo ago