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.
Requires NOPASSWD sudo access to:
You can download fireguard from here
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:
fireguard [ --config CONFIG_FILE ] <COMMAND>
Where:
Work with VMs, accepts following arguments:
Where:
Work with networks, accepts following arguments:
originVm = /home/ubuntu/vms/alpinelinux-3.8-kernel4.14 hostIface = eth0
Create new VM:
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:
Starting VM with id vm-1...
Connect to the VM console:
Show all available VMs:
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:
Starting VM with id vm-1... Starting VM with id vm-2...
Restart VM:
Stopping VM with id vm-1... Starting VM with id vm-1...
Create network
Creating new network... id: net-1 subnet: /10.1.2.0 netmask: /255.255.255.0 ifaces: []
Attach vm-1 to network net-1
Attaching vm-1 to net-1 network...