FMO-os system management tool
- Install auto-completion
- FMO-TOOL modules
- Docker Compose Infrastructure (DCI) module
- Dynamic Devices Passthrough (DDP) module
- Dynamic PortForwarding (DPF) module
- VMs manage module
- System manage module
In order to use auto-completion (use TAB
) run following command:
$ fmo-tool --install-completion
bash completion installed in /home/$USER/.bash_completions/fmo-tool.sh
Completion will take effect once you restart the terminal
Currently fmo-tool
contains following modules:
dci
- Docker Compose Infrastructure (DCI) moduleddp
- Dynamic Devices Passthrough (DDP) moduledpf
- Dynamic PortForwarding (DPF) modulessh
- ssh to VMs modulevms
- VMs manage modulesystem
- System manage module
$ fmo-tool --help
Usage: fmo-tool [OPTIONS] COMMAND [ARGS]...
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --install-completion Install completion for the current shell. โ
โ --show-completion Show completion for the current shell, to copy it or customize the installation. โ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Commands โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ dci Manage Docker Compose Infrastructure (DCI) โ
โ ddp Manage Dynamic Devices Passthrough (DDP) โ
โ dpf Manage Dynamic PortForwarding (DPF) โ
โ ssh SSH to vm โ
โ system Manage system โ
โ vms Manage VMs โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Manage Docker Compose Infrastructure:
$ fmo-tool dci --help
Usage: fmo-tool dci [OPTIONS] COMMAND [ARGS]...
Manage Docker Compose Infrastructure (DCI)
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Commands โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ enabled Check DCI enabled status for VM โ
โ restart Request DCI restart โ
โ start Request DCI start โ
โ status Request DCI status โ
โ stop Request DCI stop โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
$ fmo-tool dci enabled dockervm
True
$ fmo-tool dci enabled netvm
False
$ sudo fmo-tool dci status dockervm
โ fmo-dci.service
Loaded: loaded (/etc/systemd/system/fmo-dci.service; enabled; preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2024-10-24 08:13:05 UTC; 11s ago
Process: 4934 ExecStart=/nix/store/f5iwvhsai8pds33a8rbw4awi796xwwlf-unit-script-fmo-dci-start/bin/fmo-dci-start (code=exited, status=14)
Main PID: 4934 (code=exited, status=14)
IP: 0B in, 0B out
CPU: 54ms
sudo fmo-tool dci { start | stop | restart } dockervm
$ fmo-tool ddp --help
Usage: fmo-tool ddp [OPTIONS] COMMAND [ARGS]...
Manage Dynamic Devices Passthrough (DDP)
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Commands โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ add Add a new VM DDP rule โ
โ config Print VM DDP config โ
โ delete Delete the VM DDP rule โ
โ enabled Check or set/reset DDP enabled status for VM โ
โ generate Generate VM DDP config โ
โ rules Print VM DDP rules โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
$ fmo-tool ddp enabled netvm
False
$ fmo-tool ddp enabled dockervm
True
$ sudo fmo-tool ddp enabled -e dockervm
True
$ sudo fmo-tool ddp enabled -d netvm
False
$ fmo-tool ddp rules dockervm
0 {'bus': 'usb', 'productid': '01a9', 'vendorid': '1546'}
1 {'bus': 'usb', 'productid': '2303', 'vendorid': '067b'}
$ fmo-tool ddp rules dockervm
0 {'bus': 'usb', 'productid': '01a9', 'vendorid': '1546'}
1 {'bus': 'usb', 'productid': '2303', 'vendorid': '067b'}
$ sudo fmo-tool ddp delete dockervm 1
Delete rule: 1
Delete rule: {'bus': 'usb', 'productid': '2303', 'vendorid': '067b'}
Please unplug the device for rules to take effect!
$ lsusb
Bus 004 Device 005: ID 413c:81d7 Dell Inc. DW5821e Snapdragon X20 LTE
...
Bus 003 Device 004: ID 067b:2303 Prolific Technology Inc. USB-Serial Controller -- let's add this device
...
Bus 001 Device 001: ID 1d6b:0002 Linux 6.1.38 xhci-hcd xHCI Host Controller
$ sudo fmo-tool ddp add -v 067b -p 2303 dockervm
Add a new rule
$ fmo-tool dpf --help
Usage: fmo-tool dpf [OPTIONS] COMMAND [ARGS]...
Manage Dynamic PortForwarding (DPF)
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Commands โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ add Add a new VM DPF rule โ
โ config Print VM DPF config โ
โ delete Delete the VM DPF rule โ
โ enabled Check or set/reset DPF enabled status for VM โ
โ restart Request DPF restart โ
โ rules Print VM DPF rules โ
โ start Request DPF start โ
โ status Request DPF status โ
โ stop Request DPF stop โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
$ fmo-tool dpf enabled netvm
True
$ fmo-tool dpf enabled dockervm
False
$ fmo-tool dpf rules netvm
...
6 {'dip': '192.168.101.11', 'dport': '123', 'proto': 'udp', 'sport': '123', 'sip': 'NA'}
7 {'dip': '192.168.101.11', 'dport': '123', 'proto': 'tcp', 'sport': '123', 'sip': 'NA'}
8 {'dip': '192.168.101.2', 'dport': '22', 'proto': 'tcp', 'sport': '42', 'sip': 'NA'}
if you want to apply / play with those rules manually:
$ fmo-tool dpf rules netvm -v
...
iptables -I INPUT -p udp --dport 123 -j ACCEPT
iptables -t nat -I PREROUTING -p udp -d 192.168.101.11 --dport 123 -j DNAT --to-destination NA:123
iptables -I INPUT -p tcp --dport 123 -j ACCEPT
iptables -t nat -I PREROUTING -p tcp -d 192.168.101.11 --dport 123 -j DNAT --to-destination NA:123
iptables -I INPUT -p tcp --dport 42 -j ACCEPT
iptables -t nat -I PREROUTING -p tcp -d 192.168.101.2 --dport 42 -j DNAT --to-destination NA:22
NA
means IP address will be taken from ip-address file
$ fmo-tool dpf rules netvm
...
6 {'dip': '192.168.101.11', 'dport': '123', 'proto': 'udp', 'sport': '123', 'sip': 'NA'}
7 {'dip': '192.168.101.11', 'dport': '123', 'proto': 'tcp', 'sport': '123', 'sip': 'NA'}
8 {'dip': '192.168.101.2', 'dport': '22', 'proto': 'tcp', 'sport': '42', 'sip': 'NA'}
$ sudo fmo-tool dpf delete netvm 8
Delete rule: 8
Delete rule: {'dip': '192.168.101.2', 'dport': '22', 'proto': 'tcp', 'sport': '42'}
$ sudo fmo-tool dpf add --dip 192.168.101.11 --sport 42 --dport 22 netvm
Add a new rule
# To apply new rules need to restart DPF service:
$ sudo fmo-tool dpf restart netvm
$ sudo fmo-tool dpf status netvm
โ fmo-dynamic-portforwarding-service.service
Loaded: loaded (/etc/systemd/system/fmo-dynamic-portforwarding-service.service; enabled; preset: enabled)
Active: inactive (dead) since Thu 2024-10-24 08:38:04 UTC; 1min 12s ago
Duration: 647ms
Process: 1438 ExecStart=/nix/store/n5v2igzmi74s123q85v24hxfsr5z1lzb-unit-script-fmo-dynamic-portforwarding-service-start/bin/fmo-dynamic-portforwarding-service-start (code=exited, status=0/SUCCESS)
Main PID: 1438 (code=exited, status=0/SUCCESS)
IP: 0B in, 0B out
CPU: 358ms
...
Oct 24 08:38:04 netvm fmo-dynamic-portforwarding-service-start[1438]: Apply a new port forwarding: 192.168.248.1:123 to 192.168.101.11:123 proto: udp
Oct 24 08:38:04 netvm fmo-dynamic-portforwarding-service-start[1438]: Apply a new port forwarding: 192.168.248.1:123 to 192.168.101.11:123 proto: tcp
Oct 24 08:38:04 netvm fmo-dynamic-portforwarding-service-start[1438]: Apply a new port forwarding: 192.168.248.1:42 to 192.168.101.11:22 proto: tcp
Oct 24 08:38:04 netvm systemd[1]: fmo-dynamic-portforwarding-service.service: Deactivated successfully.
sudo fmo-tool dpf { start | stop | restart } netvm
You can ssh to VMs with only sudo
password:
[host:~]$ sudo fmo-tool ssh netvm
Last login: Thu Oct 24 07:11:10 2024 from 192.168.zzz.xxx
[netvm:~]$
You may get VMs list
, check VM ip
address, ssh
to vm, { start
| stop
| restart
} VM and check it's status
$ sudo fmo-tool vms --help
Usage: fmo-tool vms [OPTIONS] COMMAND [ARGS]...
Manage VMs
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Commands โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ config Print VM config โ
โ ip Get VM IP address โ
โ list Get VM list โ
โ restart Restart VM โ
โ ssh SSH to vm โ
โ start Start VM โ
โ status Get VM status โ
โ stop Stop VM โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
$ sudo fmo-tool system --help
Usage: fmo-tool system [OPTIONS] COMMAND [ARGS]...
Manage system
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Commands โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ alias Get/Set system alias โ
โ config Get full system config โ
โ cr Get/Set system docker Container Repository โ
โ gw Get/Set system default gateway โ
โ ip Get/Set system ip address โ
โ name Get system iso name โ
โ ra Get system RegistrationAgent version โ
โ release Get system release version โ
โ restore Restore default config โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
$ fmo-tool system ip
192.168.248.1
$ fmo-tool system name
fmo-os-rugged-laptop-7330
$ fmo-tool system release
v1.0.0a
$ fmo-tool system ra
v0.8.4
$ sudo fmo-tool system restore