fireguard
CONTENT

Overview

fireguard - Firecracker MicroVMs management application. It manages VMs lifecycle (create/start/stop) and can setup a network between them so that VMs can communicate with each other as well as with host system. fireguard configures NAT so that VMs can have an access to the external network (Internet). It manages dhcpd, iptables and routing tables so that you don't need to setup them yourself.

Requirements

Requires NOPASSWD sudo access to:

Download

You can download fireguard from here

Documentation

Configuration

Before using fireguard make sure to create configuration file ".fireguard" and place it in your $HOME location:

originVm = <ORIGIN_VM_LOCATION>
hostIface = <HOST_IFACE>

Where:

Usage

fireguard [ --config CONFIG_FILE ]  <COMMAND>

Where:

vm

Work with VMs, accepts following arguments:

Where:

net

Work with networks, accepts following arguments:

Examples

Configuration file

originVm = /home/ubuntu/vms/alpinelinux-3.8-kernel4.14
hostIface = eth0

Usage

Create new VM:

fireguard vm create
Creating new VM...
id: vm-1
home folder: /home/ubuntu/fireguardHome/stage/vm-1
socket: /home/ubuntu/fireguardHome/stage/vm-1/firecracker.sock
state: STOPPED
pid: Optional.empty
vmConfig: path: /home/ubuntu/fireguardHome/stage/vm-1/vm_config.json
memoryGb: 1000
vcpu: 1
hostIface: Optional.empty
mac: Optional.empty

Start a VM:

fireguard vm start vm-1
Starting VM with id vm-1...

Connect to the VM console:

screen -r vm-1

Show all available VMs:

fireguard vm showAll
id: vm-2
home folder: /home/ubuntu/vms/stage/vm-2
socket: /home/ubuntu/vms/stage/vm-2/firecracker.sock
state: STARTED
pid: Optional[91798]
vmConfig: path: /home/ubuntu/vms/stage/vm-2/vm_config.json
memoryGb: 8
vcpu: 1
hostIface: Optional.empty
mac: Optional.empty


id: vm-1
home folder: /home/ubuntu/vms/stage/vm-1
socket: /home/ubuntu/vms/stage/vm-1/firecracker.sock
state: STARTED
pid: Optional[91804]
vmConfig: path: /home/ubuntu/vms/stage/vm-1/vm_config.json
memoryGb: 8
vcpu: 1
hostIface: Optional.empty
mac: Optional.empty

Start all VMs:

fireguard vm startAll
Starting VM with id vm-1...

Starting VM with id vm-2...

Restart VM:

fireguard vm restart vm-1
Stopping VM with id vm-1...
Starting VM with id vm-1...

Create network

fireguard net create 10.1.2.0 255.255.255.0
Creating new network...
id: net-1
subnet: /10.1.2.0
netmask: /255.255.255.0
ifaces: []

Attach vm-1 to network net-1

fireguard net attach vm-1 net-1
Attaching vm-1 to net-1 network...