{"id":22454715,"url":"https://github.com/shapeblue/mbx","last_synced_at":"2026-01-17T06:06:22.719Z","repository":{"id":46531091,"uuid":"329720584","full_name":"shapeblue/mbx","owner":"shapeblue","description":"🐒📦 Build, run, test monkey-powered local CloudStack dev/qa env","archived":false,"fork":false,"pushed_at":"2025-12-29T12:38:56.000Z","size":7605,"stargazers_count":25,"open_issues_count":9,"forks_count":10,"subscribers_count":13,"default_branch":"main","last_synced_at":"2026-01-13T12:30:29.060Z","etag":null,"topics":["cloudstack","cloudstack-qa","kvm"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shapeblue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-01-14T19:59:13.000Z","updated_at":"2025-12-29T12:38:57.000Z","dependencies_parsed_at":"2025-04-10T10:37:20.395Z","dependency_job_id":"3b49028a-0216-4480-a9cd-5b9a97231a1f","html_url":"https://github.com/shapeblue/mbx","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/shapeblue/mbx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapeblue%2Fmbx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapeblue%2Fmbx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapeblue%2Fmbx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapeblue%2Fmbx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shapeblue","download_url":"https://codeload.github.com/shapeblue/mbx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapeblue%2Fmbx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28501633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudstack","cloudstack-qa","kvm"],"created_at":"2024-12-06T07:08:53.216Z","updated_at":"2026-01-17T06:06:22.711Z","avatar_url":"https://github.com/shapeblue.png","language":"Shell","readme":"# mbx 🐒📦\n\n\u003cimg src=\"https://raw.githubusercontent.com/shapeblue/mbx/main/doc/images/box-start.png\" style=\"width:500px;\"\u003e\n\nMonkeyBox `mbx` enables building CloudStack packages and deploying CloudStack\ndev and qa environment using pre-built DHCP-enabled VM templates.\n\nTable of Contents\n=================\n\n* [Architecture](#architecture)\n    * [Storage](#storage)\n    * [Networking](#networking)\n    * [Deployment](#deployment)\n* [Compatibility](#compatibility)\n* [Installation and Setup](#installation-and-setup)\n    * [Setup NFS Storage](#setup-nfs-storage)\n    * [Setup KVM](#setup-kvm)\n    * [Setup mbx](#setup-mbx)\n* [Using mbx](#using-mbx)\n* [CloudStack Development](#cloudstack-development)\n    * [Install Development Tools](#install-development-tools)\n    * [Setup MySQL Server](#setup-mysql-server)\n    * [Setup NFS storage](#setup-nfs-storage-1)\n    * [Dev: Build and Test CloudStack](#dev-build-and-test-cloudstack)\n    * [Debugging CloudStack](#debugging-cloudstack)\n* [Contributing](#contributing)\n* [Troubleshooting](#troubleshooting)\n    * [iptables](#iptables)\n\n## Architecture\n\n![mbx architecture](doc/images/arch.png)\n\nAn `mbx` environment consists of VMs that runs the CloudStack management server\nand hypervisor hosts. These VMs are provisioned on a local host-only `monkeynet`\nnetwork which is a /16 nat-ed RFC1918 IPv4 network. The diagram above shows how\nnested guest VMs and virtual router are plugged in nested-virtual networks that\nrun in a nested KVM host VM.\n\nTo learn more about CloudStack as a user, you may read:\n\nhttps://github.com/shapeblue/hackerbook/blob/main/0-init.md\n\nhttps://github.com/shapeblue/hackerbook/blob/main/1-user.md\n\n### Storage\n\n`mbx` requires NFS storage to be setup and exported for the base path\n`/export/testing` for environment-specific primary and secondary storages.\n\nA typical `mbx` environment upon deployment creates two primary storage\ndirectories (`primary1` and `primary2`) and one secondary storage directory\n(`secondary`). The secondary storage directory is seeded with supported\nCloudStack version-specific `systemvmtemplates` if necessary when the env is\nlaunched using `mbx launch`. The seeded `systemvmtemplate` is then used to\ncreate system VMs such as the Secondary-Storage VM, Console-Proxy VM and Virtual\nRouter in an `mbx` environment.\n\n### Networking\n\n`mbx` requires a local 172.20.0.0/16 natted network such that the VMs on this\nnetwork are only accessible from the workstation/host but not by the outside\nnetwork. The `mbx init` command initialises this network.\n\n    External Network\n      .                     +-----------------+\n      |              virbr1 | MonkeyBox VM1   |\n      |                  +--| IP: 172.20.0.10 |\n    +-----------------+  |  +-----------------+\n    | Host x.x.x.x    |--+\n    | IP: 172.20.0.1  |  |  +-----------------+\n    +-----------------+  +--| MonkeyBox VM2   |\n                            | IP: 172.20.x.y  |\n                            +-----------------+\n\nThe 172.20.0.0/16 RFC1918 private network is used, as the other 192.168.x.x and\n10.x.x.x CIDRs may already be in use by VPN, lab resources and office/home networks.\n\nTo keep the setup simple, all MonkeyBox VMs have a single NIC which can be\nused as a single physical network in CloudStack that has the public, private,\nmanagement/control and storage networks. A complex setup is possible by adding\nmultiple virtual networks and nics on them.\n\n### Deployment\n\nFor QA env, `mbx` will deploy a single `mgmt` VM that runs the management\nserver, the usage server, MySQL server, marvin integration tests etc. and two\nhypervisor host VMs.\n\nFor Dev env, `mbx` will deploy a single hypervisor host VM and the management\nserver, usage server, MySQL server etc. are all run from the workstation/host by\nthe developer.\n\nFor both QA and Dev environments, the environment-specific NFS storage are\ngenerally directories under `/export/testing` which serve as both primary and\nsecondary storage.\n\nThe `mbx` templates are initialised and downloaded at\n`/export/monkeybox/templates/`.\n\nThe `mbx` environments, their configurations and VM disks are hosted at\n`/export/monkeybox/boxes/`.\n\n## Compatibility\n\nHost requirements:\n- Ubuntu 22.04/24.04 LTS (Ubuntu Recommended) or EL8/9**\n- Recommended 32GB RAM with Intel VT-x or AMD-V enabled 4+cores CPU\n- Uninstall any other hypervisor software (such as VMware workstation, VirtualBox)\n\n**Note: `mbx` has been tested and developed on Ubuntu 22.04 and 24.04 LTS; VMware environment require vmxnet3 which may not be supported on EL environments\n\nSupported Management Server (Templates):\n- EL7 (CentOS 7)\n- EL8 (AlmaLinux 8)\n- EL9 (AlmaLinux 9)\n\nSupported Hypervisors (Templates):\n- KVM: EL7, EL8, EL9\n- VMware vSphere: 6.7u3, 7 (7.0u3), 8 (8.0, 8u3)\n- XCP-ng: 8.2, 8.3\n- XenServer: 7.1 LSTR, 8.4\n\nTested CloudStack versions:\n- 4.16\n- 4.17\n- 4.18\n\n- MBX QA \u0026 Development supported with CloudStack version 4.16 and later.\n- Smoketests supported CloudStack versions: 4.16 or later.\n\nNote: legacy CloudStack releases older than v4.16 will not work.\n\nRefer to https://docs.cloudstack.apache.org for CloudStack version-specific\nhypervisor and distro compatibility matrix.\n\n## Installation and Setup\n\nVideo: https://shapeblue-engineering-videos.s3.eu-west-1.amazonaws.com/mbx/mbx-installation.mp4\n\n`mbx` requires:\n\n- NFS storage\n- (Baremetal) QEMU/KVM host for running nested VMs (Ubuntu and CentOS have been tested)\n- Docker for building CloudStack packages: https://docs.docker.com/engine/install/ubuntu/\n\nAdditional notes:\n- Default password for all `mbx` templates for the root user is `P@ssword123`.\n- Default password for CloudStack `admin` user is `password`.\n\n### Setup NFS Storage\n\nOn Ubuntu:\n\n    apt-get install nfs-kernel-server quota sshpass wget jq bc\n    echo \"/export  *(rw,sync,no_root_squash,no_subtree_check)\" \u003e /etc/exports\n    mkdir -p /export/testing\n    exportfs -a\n    sed -i -e 's/^RPCMOUNTDOPTS=\"--manage-gids\"$/RPCMOUNTDOPTS=\"-p 892 --manage-gids\"/g' /etc/default/nfs-kernel-server\n    sed -i -e 's/^STATDOPTS=$/STATDOPTS=\"--port 662 --outgoing-port 2020\"/g' /etc/default/nfs-common\n    echo \"NEED_STATD=yes\" \u003e\u003e /etc/default/nfs-common\n    sed -i -e 's/^RPCRQUOTADOPTS=$/RPCRQUOTADOPTS=\"-p 875\"/g' /etc/default/quota\n    service nfs-kernel-server restart\n\nOn EL8 (Rocky Linux 8):\n\n    dnf install -y epel-release\n    dnf install nfs-utils sshpass wget jq bc\n    echo \"/export  *(rw,sync,no_root_squash,no_subtree_check)\" \u003e /etc/exports\n    mkdir -p /export/testing\n\n    # Add the following to /etc/sysconfig/nfs\n    LOCKD_TCPPORT=32803\n    LOCKD_UDPPORT=32769\n    MOUNTD_PORT=892\n    RQUOTAD_PORT=875\n    STATD_PORT=662\n    STATD_OUTGOING_PORT=2020    \n\n    # Start NFS and rpcbind\n    systemctl enable --now rpcbind\n    systemctl enable --now nfs-server\n\n    # Disable/configure firewalld as necessary\n    systemctl disable --now firewalld\n\n### Setup KVM\n\nOn Ubuntu:\n\n    apt-get install qemu-kvm libvirt-daemon libvirt-daemon-system libvirt-clients bridge-utils virtinst cpu-checker libnss-libvirt sysfsutils\n    kvm-ok\n\nOn EL8 (Rocky Linux 8):\n\n    yum install bridge-utils net-tools chrony qemu-kvm qemu-img libvirt libvirt-daemon libvirt-daemon-driver-qemu libvirt-nss virt-install\n\nOn Ubuntu, fixing permissions for libvirt-qemu (for non-root users):\n\n    sudo getfacl -e /export\n    sudo setfacl -m u:libvirt-qemu:rx /export\n\nOn EL8/Rocky Linux, add polkit rule to allow non-root users to use virsh (replace 'rohit' with your username):\n\n    # cat /etc/polkit-1/rules.d/50-org.libvirt.unix.manage.rules\n    polkit.addRule(function(action, subject) {\n        if (action.id == \"org.libvirt.unix.manage\" \u0026\u0026\n            subject.user == \"rohit\") {\n                return polkit.Result.YES;\n                polkit.log(\"action=\" + action);\n                polkit.log(\"subject=\" + subject);\n        }\n    });\n\nNote: mbx depends on Libvirt NSS for name resolution; replace `rohit` with your username on the host.\n\nNext, add the `libvirt libvirt_guest` in the nss config file, following so that `grep -w 'hosts:' /etc/nsswitch.conf` returns: (note: ensure the same order as below)\n\n    files libvirt libvirt_guest dns mymachines\n\nFor Ubuntu, allow non-root users to add tap interfaces to a bridge:\n\n    sudo chmod u+s /usr/lib/qemu/qemu-bridge-helper\n    sudo bash -c 'mkdir -p /etc/qemu \u0026\u0026 echo \"allow virbr0\" \u003e\u003e/etc/qemu/bridge.conf \u0026\u0026 echo \"allow virbr1\" \u003e\u003e/etc/qemu/bridge.conf'\n\nFor EL8/Rocky Linux, do this:\n\n    sudo bash -c 'mkdir -p /etc/qemu-kvm \u0026\u0026 echo \"allow virbr0\" \u003e\u003e /etc/qemu-kvm/bridge.conf \u0026\u0026 echo \"allow virbr1\" \u003e\u003e /etc/qemu-kvm/bridge.conf'\n\nInstall `virt-manager`, the virtual machine manager graphical tool to manage VMs on your machine.\n\nOn Ubuntu:\n\n    apt-get install virt-manager\n\nOn EL8 (Rocky Linux 8):\n\n    yum install -y virt-manager\n\n![VM Manager](doc/images/virt-manager.png)\n\n### Setup `mbx`\n\n    git clone https://github.com/shapeblue/mbx /export/monkeybox\n\n    # Enable mbx under $PATH, for bash:\n    echo export PATH=\"/export/monkeybox:$PATH\" \u003e\u003e ~/.bashrc\n    # Enable mbx under $PATH, for zsh:\n    echo export PATH=\"/export/monkeybox:$PATH\" \u003e\u003e ~/.zshrc\n\n    # Initialise `mbx` by opening in another shell:\n    mbx init\n\nThe `mbx init` should be run on first install and on upgrade which will update\ntemplates and domain xmls. When mbx init is executed on upgrade, ensure no mbx\nVMs are running.\n\nThe `mbx init` command initialises the `monkeynet` network. You can check and confirm the\nnetwork using:\n\n    $ virsh net-list --all\n    Name                 State      Autostart     Persistent\n    ----------------------------------------------------------\n    default              active     yes           yes\n    monkeynet            active     yes           yes\n\nAlternatively, you may open `virt-viewer` manager and click on:\n\n    Edit -\u003e Connection Details -\u003e Virtual Networks\n\nYou may also manually add/configure a virtual network with NAT in 172.20.0.0/16\nlike below:\n\n![VM Manager Virt Network](doc/images/virt-net.png)\n\nThis will create a virtual network with NAT and CIDR 172.20.0.0/16, the gateway\n`172.20.0.1` is also the workstation/host's virtual bridge IP. The virtual network's\nbridge name `virbrX` may be different and it does not matter as long as you've a\nNAT-enabled virtual network in 172.20.0.0/16.\n\n    Your workstation/host IP address is `172.20.0.1`.\n\n## Using `mbx`\n\nVideo: https://shapeblue-engineering-videos.s3.eu-west-1.amazonaws.com/mbx/mbx-usage-demo.mp4\n\nThe `mbx` tool can be used to build CloudStack packages, deploy dev or QA\nenvironments with KVM, VMware, XenServer and XCP-ng hypervisors, and run\nsmoketests on them.\n\n    $ mbx\n    MonkeyBox 🐵 v0.3\n    Available commands are:\n      init: initialises monkeynet and mbx templates\n      package: builds packages from a git repo and sha/tag/branch\n      list: lists available environments\n      deploy: creates QA env with two monkeybox VMs and creates marvin cfg file\n      launch: launches QA env zone using environment's marvin cfg file\n      test: start marvin tests\n      dev: creates dev env with a single monkeybox VM and creates marvin cfg file\n      agentscp: updates KVM agent in dev environment using scp and restarts it\n      ssh: ssh into a mbx VM\n      stop: stop all env VMs\n      start: start all env VMs\n      destroy: destroy environment\n\n0. On first run or when upgrading `mbx`, please run:\n\n    mbx init\n\n1. To list available environments and `mbx` templates (mbxts), run:\n\n    mbx list\n\n2. To build packages using `mbx`:\n\n    mbx package --repo \u003crepo, default: shapeblue/cloudstack\u003e --tag \u003ctag|branch|PR, default: main\u003e --distro \u003cdistro - el7|el8|el9|debian, default: el8\u003e --output-dir \u003coutput directory, default: /export/testing/builds\u003e --flags \u003cmaven build flags, default: ''\u003e\n\n2. To deploy an environment, run:\n\n    mbx deploy \u003cname of env, default: mbxe\u003e \u003cmgmt server template, default: mbxt-kvm-el8\u003e \u003chypervisor template, default: mbxt-kvm-el8\u003e \u003crepo, default: http://packages.shapeblue.com/cloudstack/upstream/el8/4.20\u003e\n\nExample to deploy test matrix (kvm, vmware, xenserver) environments:\n\n    mbx deploy 420-kenv mbxt-kvm-el8 mbxt-kvm-el8 # deploys ACS 4.20 + KVM EL8 env\n    mbx deploy 420-venv mbxt-kvm-el8 mbxt-vmware7 # deploys ACS 4.20 + VMware7(u3) env\n    mbx deploy 420-xenv mbxt-kvm-el8 mbxt-xcpng82 # deploys ACS 4.20 + XCP-ng 8.2 env\n\nMore examples with custom packages repositories:\n\n    mbx deploy cs420-kvm mbxt-kvm-el8 mbxt-kvm-el8 http://download.cloudstack.org/el/8/4.20/\n\n3. Once `mbx` environment is deployed, to launch a zone run:\n\n    mbx launch \u003cname of the env, run `mbx list` for env name\u003e\n\n4. To run smoketests, run:\n\n    mbx list # find your environment\n    mbx ssh \u003cname of the mbx mgmt server VM\u003e\n    cd /marvin\n    bash -x smoketests.sh\n\n5. To destroy your mbx environment, run:\n\n    mbx destroy \u003cname of the env, see mbx list for env name\u003e\n\nNote: to use `qemu-ev` on EL7 KVM hosts, after deploying an environment you\ncan run the following on KVM hosts (before launching the zone):\n\n    yum install centos-release-qemu-ev\n    yum install qemu-kvm-ev\n\n### Accessing MBX Remotely\n\nThis section is only for mbx users who want to access their mbx environments remotely.\nFor this we suggest setting up wireguard VPN.\n\nTo setup wireguard on Ubuntu: (note replace `LIBVIRT_PRT` with the chain name that libvirt uses for NAT rules)\n\n    sudo apt-get install wireguard resolvconf\n    wg genkey | sudo tee /etc/wireguard/private.key\n    sudo cat /etc/wireguard/private.key | wg pubkey | sudo tee /etc/wireguard/public.key\n\n    # cat /etc/wireguard/wg0.conf\n    [Interface]\n    PrivateKey = \u003cyour base64_encoded_private_key_goes_here\u003e\n    Address = 10.6.0.1/24\n    PostUp = iptables -I FORWARD -i wg0 -j ACCEPT; iptables -t nat -I LIBVIRT_PRT -o cloudbr0 -j MASQUERADE\n    PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D LIBVIRT_PRT -o cloudbr0 -j MASQUERADE\n    #MTU = 1420\n    ListenPort = 51820\n    SaveConfig = true\n\n    [Peer]\n    \u003c... add rest of the peer config here...\u003e\n\nNote: you'll need to allow/enable port 51820/udp.\n\nYou may need forwarding enabled if you're connecting to a peer WireGuard server,\nadd the following to /etc/sysctl.conf:\n\n    net.ipv4.ip_forward=1\n\nAnd then run:\n\n    sysctl -p\n\nFinally enable the server:\n\n    sudo systemctl enable wg-quick@wg0.service\n    sudo systemctl start wg-quick@wg0.service\n    sudo systemctl status wg-quick@wg0.service\n\n## MBX CloudStack Development\n\nNote: this is not for developers of 3rd party integration/feature that don't\nrequire changes in CloudStack, such developers should use a QA environment. MBX\ndevelopment usage is supported to work with CloudStack 4.16 and onwards.\n\nThis section covers how a CloudStack developer can run management server and\nMySQL server locally to do development of CloudStack using `mbx` dev boxes along\nside an IDE and other tools.\n\nFor developer env, it is recommended that you run your favourite IDE such as\nIntelliJ IDEA, text-editors, your management server, MySQL server and NFS server\n(secondary and primary storages) on your workstation (not in a VM) where these\nservices can be accessible to VMs, KVM hosts etc. at your host IP `172.20.0.1`.\n\nTo deploy a dev env, you can run `mbx dev \u003cname of env\u003e \u003chypervisor template\u003e`.\nFor example:\n\n    $ mbx dev some-feature mbxt-kvm-el8\n\nThe above will deploy a single hypervisor host and generate a marvin config file\nthat you can use to deploy a zone.\n\nTo ssh into deployed hypervisor VM (with NSS configured), you can login by\nsimply using:\n\n    $ mbx ssh \u003cname of the dev VM or IP\u003e\n\nRefer to hackerbook for up-to-date guidance on learning CloudStack development:\nhttps://github.com/shapeblue/hackerbook\n\n### Install Development Tools\n\nRun this:\n\n    $ sudo apt-get install openjdk-11-jdk maven python-mysql.connector libmysql-java mysql-server mysql-client bzip2 nfs-common uuid-runtime python-setuptools ipmitool genisoimage\n\nSetup IntelliJ (recommended) or any IDE of your choice. Get IntelliJ IDEA\ncommunity edition from:\n\n    https://www.jetbrains.com/idea/download/#section=linux\n\nInstall pyenv, jenv as well.\n\nSetup `aliasrc` that defines some useful bash aliases, exports and utilities\nsuch as `agentscp`. Run the following while in the directory root:\n\n    $ echo \"source $PWD/files/aliasrc\" \u003e\u003e ~/.bashrc\n    $ echo \"source $PWD/files/aliasrc\" \u003e\u003e ~/.zshrc\n\nYou may need to `source` your shell's rc/profile or relaunch shell/terminal\nto use `agentscp`.\n\n### Setup MySQL Server\n\nAfter installing MySQL server, configure the following settings in its config\nfile such as at `/etc/mysql/mysql.conf.d/mysqld.cnf` and restart mysql-server:\n\n    [mysqld]\n\n    sql-mode=\"STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION\"\n    server_id = 1\n    innodb_rollback_on_timeout=1\n    innodb_lock_wait_timeout=600\n    max_connections=1000\n    log-bin=mysql-bin\n    binlog-format = 'ROW'\n\n### Setup NFS storage\n\nAfter installing nfs server, configure the exports:\n\n    echo \"/export  *(rw,async,no_root_squash,no_subtree_check)\" \u003e /etc/exports\n    mkdir -p /export/testing/primary /export/testing/secondary\n\nBeware: For Dev env, before deploying a zone on your monkeybox environment, make\nsure to seed the correct systemvmtemplate applicable for your branch. In your\ncloned CloudStack git repository you can use the `cloud-install-sys-tmplt` to\nseed the systemvmtemplate. Also note this may or may not be necessary depending\non your development base branch.\n\nThe following is an example to setup `4.15` systemvmtemplate which you should\nrun after deploying the CloudStack db: (please use CloudStack branch/version specific\nsystemvmtemplate)\n\n    cd /path/to/cloudstack/git/repo\n    wget http://packages.shapeblue.com/systemvmtemplate/4.15/systemvmtemplate-4.15.1-kvm.qcow2.bz2\n    ./scripts/storage/secondary/cloud-install-sys-tmplt \\\n          -m /export/testing/secondary -f systemvmtemplate-4.15.1-kvm.qcow2.bz2 \\\n          -h kvm -o localhost -r cloud -d cloud\n\n### Dev: Build and Test CloudStack\n\nIt's assumed that the directory structure is something like:\n\n        /\n        ├── $HOME/lab/cloudstack\n        └── /export/monkeybox\n\nFork the repository at: github.com/apache/cloudstack, or get the code:\n\n    $ git clone https://github.com/apache/cloudstack.git\n\nNoredist CloudStack builds requires additional jars that may be installed from:\n\n    https://github.com/shapeblue/cloudstack-nonoss\n\nClone the above repository and run the install.sh script, you'll need to do\nthis only once or whenever the noredist jar dependencies are updated in the above\nrepository.\n\nBuild using:\n\n    $ mvn clean install -Dnoredist -P developer,systemvm\n\nDeploy database using:\n\n    $ mvn -q -Pdeveloper -pl developer -Ddeploydb\n\nRun management server using:\n\n    $ mvn -pl :cloud-client-ui jetty:run  -Dnoredist -Djava.net.preferIPv4Stack=true\n\nInstall marvin:\n\n    $ sudo pip install --upgrade tools/marvin/dist/Marvin*.tar.gz\n\nWhile in CloudStack's repo's root/top directory, run the folllowing to copy\nagent scripts, jars, configs to your KVM host:\n\n    $ cd /path/to/git-repo/root\n    $ mbx agentscp 172.20.1.10  # Use the appropriate KVM box IP\n\nDeploy datacenter using:\n\n    $ python tools/marvin/marvin/deployDataCenter.py -i ../monkeybox/adv-kvm.cfg\n\nExample, to run a marvin test:\n\n    $ nosetests --with-xunit --xunit-file=results.xml --with-marvin --marvin-config=../monkeybox/adv-kvm.cfg -s -a tags=advanced --zone=KVM-advzone1 --hypervisor=KVM test/integration/smoke/test_vm_life_cycle.py\n\nNote: Use nosetests-2.7 to run a smoketest, if you've nose installed for both Python2.7 and Python3.x in your environment.\n\nWhen you fix an issue, rebuild cloudstack and push new changes to your KVM host\nusing `agentscp` which will also restart the agent:\n\n    $ agentscp 172.20.1.10\n\nTo push new changes to your Managment server use:\n\n    $ mgmtscp 172.20.0.185\n\nUsing IDEA IDE:\n- Import the `cloudstack` directory and select `Maven` as build system\n- Go through the defaults, in the profiles page at least select noredist, vmware\n  etc.\n- Once IDEA builds the codebase cache you're good to go!\n\n### Debugging CloudStack\n\nPrior to starting CloudStack management server using mvn (or otherwise), export\nthis on your shell:\n\n    export MAVEN_OPTS=\"$MAVEN_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n\"\n\nTo remote-debug the KVM agent, put the following in\n`/etc/default/cloudstack-agent` in your monkeybox and restart cloudstack-agent:\n\n    JAVA=/usr/bin/java -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n\n\nThe above will ensure that JVM will start with debugging enabled on port 8787.\nIn IntelliJ, or your IDE/editor you can attach a remote debugger to this\naddress:port and put breakpoints (and watches) as applicable.\n\n## Contributing\n\nReport issues on https://github.com/shapeblue/mbx/issues\n\nSend a pull request on https://github.com/shapeblue/mbx\n","funding_links":[],"categories":["Development"],"sub_categories":["Development Environment"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshapeblue%2Fmbx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshapeblue%2Fmbx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshapeblue%2Fmbx/lists"}