ethicnology / nubo-init

Multipass cloud-init configurations for Jellyfin, Bitcoin …

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nobu-init

multipass

Multipass is a lightweight VM manager for Linux, Windows and macOS. It's designed for developers who want a fresh Ubuntu environment with a single command. It uses KVM on Linux, Hyper-V on Windows and HyperKit on macOS to run the VM with minimal overhead. It can also use VirtualBox on Windows and macOS. Multipass will fetch images for you and keep them up to date.

Since it supports metadata for cloud-init, you can simulate a small cloud deployment on your laptop or workstation.

QEMU -> LXD

multipass set local.driver=lxd

usage

jellyfin

multipass launch 20.04 --name jellyfin --cloud-init jellyfin.yaml
multipass exec jellyfin -- sudo service jellyfin status
# ● jellyfin.service - Jellyfin Media Server
#      Loaded: loaded (/lib/systemd/system/jellyfin.service; enabled; vendor pres>
#     Drop-In: /etc/systemd/system/jellyfin.service.d
#              └─jellyfin.service.conf
#      Active: active (running) since Wed 2022-05-04 11:55:38 CEST; 1min 37s ago

bitcoin

multipass launch --name btc --cloud-init bitcoin.yaml --disk 40G # testnet blockchain
multipass exec btc -- bitcoin-cli -testnet getblockchaininfo
# {
#   "chain": "test",
#   "blocks": 0,
#   "headers": 0,
#   "bestblockhash": "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943",
#   "difficulty": 1,
#   "time": 1296688602,
#   "mediantime": 1296688602,
#   "verificationprogress": 1.595119552376496e-08,
#   "initialblockdownload": true,
#   "chainwork": "0000000000000000000000000000000000000000000000000000000100010001",
#   "size_on_disk": 293,
#   "pruned": false,
#   "warnings": ""
# }

expose multipass guest to your network

All these commands are temporary, if you want them to persist after reboot, please use crontab.

activate ip forwarding

sysctl -w net.ipv4.ip_forward=1

Gather informations

host link:

ip link 
LINK=eth0

guest ip:

multipass info jellyfin | grep "IPv4:.*" # show guest ip
IP=10.204.183.40

guest port:

PORT=8096 # default jellyfin port

iptables

sudo iptables -t nat -I PREROUTING 1 -i $LINK -p tcp --dport $PORT -j DNAT --to-destination $IP:$PORT
sudo iptables -I FORWARD 1 -p tcp -d $IP --dport $PORT -j ACCEPT

About

Multipass cloud-init configurations for Jellyfin, Bitcoin …

License:GNU General Public License v3.0